-
Notifications
You must be signed in to change notification settings - Fork 9
feat: implement -msg-style
#76
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
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.
The idea is good, but I think there are room from improvements
Please accept my feedbacks and reviews
Also, I wouldn't add a boolean to enforce only the lowercase. But a flag with constants (a iota maybe, or string) to control if log message should start with an uppercase letter (as state in the section about error strings in Go convention), a lowercase letter (what you want to do), or simply do not enforce this (that would be the default behavior). Please read this for the context |
Done, how about this? I like that it is not a boolean anymore, this can be expanded to regular expressions later on, as long as it does not match with Also added |
251dbda
to
32b184f
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.
Very good implementation
A few suggestions anyway, feel free to cherry pick them
Amended your suggestion without changes (only added two missing curly braces and reformatted). Tests are green, the suggestion was correct well done! :-) |
Yeah ! ✌️ Good thing to know, the review and feedbacks I made was done with my phone only. 💪 So I'm pretty amazed it worked directly 😅 Please note, I'm a random Gopher, and compulsive code reviewer. I have huge curiosity about linters. Your PR came to solve issue I'm facing too. That's why I jumped in the PR and made feedbacks because I liked your implementation and I had some feedbacks. I enjoyed you were open to them. Let's now wait for owner or maintainer feedbacks. |
If you liked what I suggested and how I helped you, I would like to suggest you to add a Co-authored-by tag in your commit message. You can take a look here if you never used it
Also, please note you should consider updating your commit message that only mentions "lowercase" feature you started with. I think you should update it. |
I swear I thought it was you... :-D Cheers. |
c1e9f2d
to
4bb58de
Compare
@lzap hey, thanks for the PR (and @ccoVeille for the review), I'll take a look shortly! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #76 +/- ##
==========================================
+ Coverage 84.01% 85.14% +1.13%
==========================================
Files 2 2
Lines 269 303 +34
==========================================
+ Hits 226 258 +32
- Misses 35 37 +2
Partials 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Don't worry about the failing linter check, that's on me to fix. |
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
I'm thinking about the following renames:
With this, we can easily add new style options in the future, such as @lzap @ccoVeille hope you guys don't mind. Otherwise, LGTM. |
I just pushed v0.10.0, expected to land in the next golangci-lint release. |
Implements message rule check, this isn't a regexp but I feel that is an overkill. Reason for this is that
slog
is all about structured logging, if you are doing structured logging into a message field, you are probably doing it wrong :-)Fixes: #65
Cheers.