-
Notifications
You must be signed in to change notification settings - Fork 200
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 --ignore-folders #22
Conversation
…ders to ignore (e.g. myProject/tests)
Is the purpose to only have the naming checks ignore those folders? |
@sigmavirus24 yes. I will also add ignore-conventions so you will be able to specify which conventions will be skipped / ignored. |
@karantan no other plugin to flake8 currently provides this (as far as I'm aware) and other plugins use the |
…-ignore-conventions param to work. It checks ignore-folders and ignore-conventions and it ignores all the errors that are given in ignore-conventions in specific folder that is given in ignore-folders. e.g. > flake8 test_naming --ignore-conventions=N801,N802 --ignore-folders=test_naming/foo,test_naming/bar This will ignore errors N801 and N802 in folders test_naming/foo and test_naming/bar
- ignore-conventions option is now changed. It accepts this structure: `tests/foo: N8XY, tests/bar: N80X N80Y N80Z`. This means that in folder tests/foo error code N8XY will be ignored and in fodler tests/bar error codes N80X, N80Y and N80Z will be ignored. - added test for helper function that is parsing ignore-conventions option
@sigmavirus24 My use case for this is to be able to ignore "N802 function name should be lowercase" inside my tests (because I like to be creative with test method naming), but enforce it everywhere else in my codebase. |
I don't think this is appropriate in pep8-naming. This is something that might be better suited to Flake8, but would need a nuanced approach. My main concern with adding this to pep8-naming is that other Flake8 plugins will adopt the same thing. I'm fairly certain optparse will complain if we try to doubly register the same option name with different descriptions so if this is something plugins want to ignore, it might be best to have it as a flag in Flake8 proper to have one flag to rule them all that plugins can use. That said, Flake8 generally does not provide flags by default that are no-op flags, so I'm not sure it makes sense there either. |
Solved with https://pypi.python.org/pypi/flake8-putty. |
Added option which allows the user to specify a list of folders to ignore (e.g. myProject/tests)