Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: add linter for error/trace/log messages #102
base: main
Are you sure you want to change the base?
feat: add linter for error/trace/log messages #102
Changes from 6 commits
112c60a
b2f01ef
be9c517
040069b
c239b77
3f79b9d
0289a9c
3264e84
b0608aa
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
these were correct - https://github.com/getoutreach/lintroller/blob/main/internal/config/config.go#L122
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.
shouldn't you just be checking the first character for capitalization?
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.
+1 to George's comment. This should only check the first letter.
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.
So this is where maybe other people's standards and ORCS standards diverge. We make the entire error message lowercase. What is the value in only the first letter being lowercase?
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.
the things that come to my mind immediately are acronyms (ASCII, etc) and abbreviations (ID, etc) and initialisms (UUID, etc)
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.
FWIW i do see where you're going though if we forget about what i just mentioned above @clevelittlefield-outreach
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.
yeah people resist on the acronyms, but the whole goal of this is to always find that error in the code/logs and not worry about casing, the first letter alone doesnt provide value
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.
i understand where you're coming from. i'm not the owner of this repo anymore (i just know the most about it) and im not on DT, so ultimately I'm going to defer this one over to @jkinkead
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.
I love the idea of having standardized style. I don't love the idea of having bespoke standardized style. For a widely-used linter, we should be adhering to established third-party standards.
Google's style guide (what I suggest we use, and what is linked in the linter) says:
It further says:
I don't think this should deviate from this style guide, unless we can find an official Golang one that says something different.
Teams that want a different style that's still compatible with this (e.g. all characters lowercase), that's fine, but I don't think the linter should enforce that rule.
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.
So that exception will be hard to codify (unless beginning with an exported name, a proper noun or an acronym), and I dont think we want to have people do nolints to enforce that exception. That rule (not uppercase for first character only) honestly seem like arbitrary aesthetics rather than serving a clear purpose.
I do not understand the further part, we have one string here, how can it be all capitalized in another context?
Beyond that, I swore that gobox (back in go-outreach days) at one time in the readme asked for all lowercase errors. Using that starter guidance, but also building around that idea, is we want all strings of this sort to be able to be found going from code to datadog and from datadog to code. One of those at the time was case sensitive. I would have to test again to see if that is still the case. The point of leaving out casing it so avoid those accidental misses due to case.
If we decide this linter is not right for all of outreach, that is ok. I questioned that when we said it could be outreach wide in the first place because I have seen plenty of code that violates that. We will also have lots of violations when we build a linter for this guideline as well. Which circles back to the original question, how can we build and include in the ruleset a linter just for just the ORCS team?
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.
@jkinkead thoughts?