-
Notifications
You must be signed in to change notification settings - Fork 5
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
Update gocritic
enabled/disabled checks to fix linter
#40
Conversation
sorry to be a curmudgeon but I disagree with all three of these style rules lmao 😅 |
Haha, I don't mind at all Luke. I only wanted to apply the same linters we have in Edit: I wanted to add that even though I agree these rules are often silly, I am very much in favour of adding them because they unify our codebase. For me, there's nothing worse than reading through a codebase and seeing who wrote it. It's just annoying for the reader. I think Chris and I have evolved to develop a very similar style but we can not agree on capitalising comments it seems. I write |
agreed, consistency is very important. If I didn't believe that, I would have given up on Go a long time ago. :P
If the linter could auto-fix everything, I probably wouldn't care about it much. Sometimes Perhaps a better approach to linting would be to run the linter just once, every few months, and manually look through the flagged violations and decide if they're worth fixing. That way, we can get most of the benefits without being henpecked on every CI push :P |
To be fair the fact that it wasn't clear whether memory should be reused or not from a quick glance is probably enough reason to keep that linter rule and use the more traditional pattern to make that clear. I could probably get behind the other patterns even though deleting in an if seems odd at first but at least it's super obvious and might not hide unexpected behaviour^^ |
I don't want to make this PR the PR where we discuss what checks we should enable/disable. Can we do that when we centralise the configs? I reverted all changes only to make this PR all about getting |
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 think we should still keep the append linter but I don't mind dropping the other ones.
Definitely not in favour of running linters only once a month cause
- nobody ever checks the result of scheduled actions
- linting once a month is like saying you'll clean your apartment once a month instead of putting stuff away right away. You'll just build up a mess that is too annoying to fix.
This PR adjusts our linter so it passes again after upgrading
golangci
tov1.57.0
.