ignore-names does not apply for all checks
Unless I'm missing something, the ignore argument to the visitor methods is used only in FunctionNameCheck (N802). Is this by design? Would be great to apply this option for all checks.
I'd merge a pull request that implements this. I suspect the reasoning is that the implementor didn't want --ignore-names to be overly broad. Perhaps we should deprecate that option in favor of ignore-function-names and ignore-class-names etc. so that people can be specific.
@sigmavirus24 Judging by the first comment in https://github.com/PyCQA/pep8-naming/pull/19, the implementer submitted a partial WIP, intending to apply the logic to all error types. That said, I do agree with you that type-specific whitelists would be useful. So you'd like to continue supporting ignore-names with the current behavior but start emitting a DeprecationWarning, and implement ignore-*-names? I'd be happy to submit a PR.
Another discussion point: how granular should the options be? Ideally, there should be an option to ignore a list of names for each error type. One way to do it:
-
ignore-function-names(applies toN802) -
ignore-class-names(applies toN801) -
ignore-variable-names(applies toN803,N806,N81x) -
ignore-Nxx-names(applies toNxxspecifically)
Another approach entirely (similar to something suggested in the original PR) is to support
--ignore-names X N803:Y N804:mcs`
which would suppress all errors about X (class, function, etc.), N803 about Y, etc.
What are your thoughts?
We don't have a reverse mapping of violation code to checker class and I'd rather not build one or attempt to maintain it. Using explicitly named flags without using weird magical syntax makes the most sense. It's simple, explicit, and can be easily configured in INI.
ignore-names now also applies to N806, N815, and N816 checks as of #96.