-
Notifications
You must be signed in to change notification settings - Fork 49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start @johananl!
a3e6db1
to
72dd915
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✔️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding this. +1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor suggestion but LGTM.
Great start @johananl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM.
The only thing I'm unsure about is the errors. I'm unsure if errors won't become cryptic or if we will simply have ton of review comments on error fromatting without much benefit.
Is there any other project using that style rule for errors? I guess from the blog post example maybe the go project itself?
Not sure I got your point. What change are you suggesting? Removing the guidelines about errors?
There is https://github.com/golang/go/wiki/CodeReviewComments#error-strings if you're looking for an official recommendation. But it also just makes sense IMO because error strings are chained. These guidelines produce consistently-formatted, readable errors. |
Yes, that can be simpler. But no problem, we can remove it later if we find that it creates overhead and little benefit :) |
I've added only things which I've found myself constantly commenting on in PRs. That was actually the trigger for me starting this document. IMO not having guidelines for error strings is what's causing overhead. But anyway - sure, the idea is to evolve this doc over time and of course if some guideline proves to be counterproductive we should revisit. |
441c793
to
51d748e
Compare
51d748e
to
f83fb0e
Compare
Thanks to everybody who chimed in. I will merge this since we don't seem to have any major disagreements around the content. |
This PR adds an initial code style guide for Lokomotive. The guide currently focuses mainly on Go code, however we could add guidelines for other types of code (e.g. HCL, Markdown).
I find it useful to maintain such a guide as I find myself commenting the same things over and over again in PRs and would love to have a document I could link to. I think that following a common and agreed-upon guide could make code reviews more efficient.
The document should be agreed upon by the team and is expected to evolve over time. The current state is by no means a comprehensive list of guidelines. Rather, it currently contains a small set of initial guidelines which I believe already have consensus in the team so we might as well formalize them.