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
chore: lint: update linter settings, fix lint errors #11968
Conversation
When we were setting up the initial linters we very explicitly disabled all linters which were based on pure opinion and weren't providing any value other than aesthetics based on the linters author taste. Linters which complain "oh no your variable should be ABC instead of Abc" are purely annoying, often wrong, and just slow down development, where often you'd just push a commit, now you have to push a commit, pray that the linter passes with no annoynig-positives, and possibly/likely go back to the PR to push some fixes which don't fix anything important Tldr most opinion-based linters imo don't make sense unless most of your team is junior devs |
I think I agree, I was getting slightly angry at it telling me that |
I like the sound of a global exclusion for this |
I'm alright turning off both of these things. Because these are not actual problems, but style matters |
c90a099
to
72070ce
Compare
I re-did this PR from scratch, and revisited the whole config. Here's the choices I've made:
|
* remove and replace some linters * remove some exclusions * make all exclusions more explicit matches
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.
Only looked at the SP side of things, but looks good to me
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.
Read through the diff - everything seems correct functionally.
Left 2 comments where things were most jarring.
72070ce
to
0b24e5c
Compare
@@ -410,7 +411,6 @@ func lookupEthAddress(addr address.Address, st *state.StateTree) (ethtypes.EthAd | |||
return ethAddr, nil | |||
} | |||
|
|||
// Otherwise, use the masked address. |
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.
@rvagg in the final diff-set this comment got lost
Unsure how important for understanding the rest of the stuff, this is your-ish area
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.
good catch, I'd rather not lose it, #12007
Ref: #11967
This isn't complete, I just banged through a few iterations of it to see the kinds of changes we're being asked to make. I think a better approach here is to add some exclusion error regexes. Most of the issues fall into two categories:
The latter suck in particular because a lot of them are on API methods. I've started adding explicit exclusions for those in here, but we could opt for a global exclusion (minimal might be something like
var-naming: var [A-Z].+ should be
to capture public variables).Or we could just hammer it with exclusions to minimise the diff in this PR in particular, even turn off
var-naming
entirely.