-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Add staticcheck.conf to reduce unactionable noise in IDEs #34036
Conversation
Since we already specify a list of staticcheck rules to ignore in the scripts/staticcheck.sh wrapper script, this hoists those preferences up to the top of the package tree, so they also affect the staticcheck integration in editors like VSCode. This avoids unnecessary yellow-squiggles for capitalized error messages, and makes integrated linting much more useful.
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.
This is cool!
I think we can remove the -checks
argument from the script, so that we don't have two copies of these settings which may diverge. That seems to work locally for me, at least.
If it works in CI too, perhaps we should also add a comment to that script pointing at this config file for future people.
I was wondering if I could get away with that! :D I'll amend and we'll see what CI does with it |
Single source of truth. 🤘🏼
Nice, looks like just setting it globally works in CI too. |
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.
Nice, thanks!
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Turns out go-staticcheck will respect a config file and merge configs across subtrees of packages.
Since we already specify a list of staticcheck rules to ignore in the scripts/staticcheck.sh wrapper script, this hoists those preferences up to the top of the package tree, so they also affect the staticcheck integration in editors like VSCode. This avoids unnecessary yellow-squiggles for capitalized error messages, and makes integrated linting much more useful.
The thing I'm trying to make it shut up about
Target Release
1.7.x
Draft CHANGELOG entry
N/A; this has no runtime effect on Terraform.