go-simpler / sloglint

🪵 Ensure consistent code style when using log/slog
https://go-simpler.org/sloglint
Mozilla Public License 2.0
75 stars 5 forks source link

feat: implement `-static-msg` #18

Closed mattdowdell closed 8 months ago

mattdowdell commented 8 months ago

This adds support for enforcing log messages are static by requiring the use of string literals or constants.

Fixes #17.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (61cece7) 88.00% compared to head (4a41eaa) 88.67%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #18 +/- ## ========================================== + Coverage 88.00% 88.67% +0.67% ========================================== Files 1 1 Lines 200 212 +12 ========================================== + Hits 176 188 +12 Misses 19 19 Partials 5 5 ``` | [Files](https://app.codecov.io/gh/go-simpler/sloglint/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-simpler) | Coverage Δ | | |---|---|---| | [sloglint.go](https://app.codecov.io/gh/go-simpler/sloglint/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-simpler#diff-c2xvZ2xpbnQuZ28=) | `88.67% <100.00%> (+0.67%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

tmzane commented 8 months ago

@mattdowdell Thank you!

mattdowdell commented 8 months ago

@tmzane What's the process for gettng the new options added here and in previous PRs available in golangci-lint? I'm happy to drive that forward, but any pointers you can provide would be appreciated.

tmzane commented 8 months ago

@mattdowdell the previous options should be available as soon as #4166 is merged and the next release of golangci-lint is published. Speaking about -static-msg, I just pushed v0.3.0 that includes it, should appear as a separate PR by dependabot. You could also use sloglint standalone until the new features are available in golangci-lint 😉