Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documented design patterns and code conventions #2305

Merged

Conversation

pracucci
Copy link
Contributor

What this PR does:
While working on #2204 and #1512 I've realised it's difficult to succeed in the metrics refactoring it it's not a team effort and if we continue to accept PRs breaking the design we're heading to.

For this reason, I would like to propose some basic design patterns and code conventions doc (nothing new to frequent contributors) which we can link to while doing code reviews whenever we see these conventions violated.

What's your take?

Notes:

  • I've moved the content of CONTRIBUTING.md under docs/

Which issue(s) this PR fixes:
N/A

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Marco Pracucci <marco@pracucci.com>
Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gouthamve
Copy link
Contributor

Do we want to adopt Prometheus' style guide as well? https://github.com/prometheus/prometheus/blob/master/CONTRIBUTING.md#contributing

Mainly: Relevant coding style guidelines are the Go Code Review Comments and the _Formatting and style_section of Peter Bourgon's Go: Best Practices for Production Environments.

I have this muscle memory about "comments starting with capitals and ending with period" and other things I've built up since my Prometheus work that I've been suppressing :)

@pstibrany
Copy link
Contributor

I have this muscle memory about "comments starting with capitals and ending with period" and other things I've built up since my Prometheus work that I've been suppressing :)

Thanos has a lint check that verifies this! :)

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci
Copy link
Contributor Author

Mainly: Relevant coding style guidelines are the Go Code Review Comments and the _Formatting and style_section of Peter Bourgon's Go: Best Practices for Production Environments.

Makes much sense to me. I've added it. @gouthamve What's about now?

Copy link
Contributor

@gouthamve gouthamve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@jtlisi jtlisi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pracucci pracucci merged commit 228090e into cortexproject:master Mar 20, 2020
@pracucci pracucci deleted the doc-design-patterns-and-conventions branch March 20, 2020 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants