Skip to content
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

Closed
wants to merge 4 commits into from
Closed

- Add --ignore-folders #22

wants to merge 4 commits into from

Conversation

karantan
Copy link

Added option which allows the user to specify a list of folders to ignore (e.g. myProject/tests)

@sigmavirus24
Copy link
Member

Is the purpose to only have the naming checks ignore those folders?

@karantan
Copy link
Author

@sigmavirus24 yes.

I will also add ignore-conventions so you will be able to specify which conventions will be skipped / ignored.

@sigmavirus24
Copy link
Member

@karantan no other plugin to flake8 currently provides this (as far as I'm aware) and other plugins use the select and ignore flags for flake8 to ignore error-codes from pep8, pyflakes, and all plugins. Why are you seeking to add these flags when flake8 already (for the most part) supports these use-cases?

…-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
@zupo
Copy link

zupo commented Feb 2, 2016

@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.

@sigmavirus24
Copy link
Member

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.

@zupo
Copy link

zupo commented Jul 15, 2016

Solved with https://pypi.python.org/pypi/flake8-putty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants