-
Notifications
You must be signed in to change notification settings - Fork 186
Remove redundant _linter
suffix from auto names?
#872
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
Comments
to clarify, you just want the #nolint logic to automatically add the first thing that comes to mind is that custom linters may not be snake case, e.g. we use UpperCamelCase for all functions, including our linters. |
I don't want to change the behavior of nolint. Instead I propose to change the automatically generated linter names (in with_defaults and in Linter) such that they don't include the _linter suffix. User-visible changes here are the linter names in Feel free to check out the draft PR to see what exactly changes. |
I don't think changing the function names is a good idea, but the nolint parser could probably add the |
We're not changing the function names, we're changing the names in the |
please add tests of with_defaults & exclusions where a custom linter doesn't have the _linter suffix, if there aren't any yet |
@AshesITR added this to 3.0.0 milestone since it sounds like we should make some decision before release. I recall you said this might be obsolete. |
I closed the initial draft. |
Would that work like:
excludes both I could be OK with that. Is there any equivalent in, say, pylint? |
Just had another thought about this. This would also benefit other naming schemes which use suffixes (e.g. a hypothetical @MichaelChirico what are your thoughts on this? |
it does sound better; the downside is if it'll be abused? nolint: expect_nuwould match expect_null_linter OTOH if downstream want to be overly concise maybe that's up to them? or we could use an option to disable that (like warnPartialMatchDollar) |
Adding a switch seems like a viable solution if downstream complains about this feature. We should definitely warn if an exclusion couldn't be matched (e.g. due to non-uniqueness), though. |
SGTM |
The new
# nolint: xxx.
feature makes it more likely for linter names to appear in source code.I would therefor suggest we remove the redundant
_linter
suffix from the names to make most lint exclusions look more natural.Compare:
to
wdyt?
cc @MichaelChirico @jimhester
The text was updated successfully, but these errors were encountered: