-
Notifications
You must be signed in to change notification settings - Fork 134
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
Provide more specific error message for StrictUsedVariable
check based on unused variable type
#2835
base: develop
Are you sure you want to change the base?
Conversation
Generate changelog in
|
dd6bf76
to
8b6b337
Compare
} | ||
} else { | ||
fixes = buildUnusedVarFixes(symbol, allUsageSites, state); | ||
reportUnusedAssignment(symbol, unused, specs, allUsageSites, state); |
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 only reports a match if the var is a local var, so no need to do it for all vars (including parameters) as we were before.
Fixes #2361
Before this PR
Turns out this was just a confusing error message. Previously, a code snippet like
would result in an error message
If you applied the fix from the error message, checks would fail because the field is read but has 'StrictUnusedVariable' suppressed because of its name (prefixed with an underscore).
But really, the correct fix is suggested below the code snippet/link - to remove the field (
Did you mean to remove this line?
).After this PR
==COMMIT_MSG==
Provide more specific error message for
StrictUsedVariable
check based on unused variable type==COMMIT_MSG==
Possible downsides?