-
Notifications
You must be signed in to change notification settings - Fork 59
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
mccable should allow ranged noqa exceptions #80
Comments
mccabe doesn't handle |
I added a feature request to flake8 itself at https://gitlab.com/pycqa/flake8/-/issues/679 -- I am not yet sure how it will be achievable but I hope that I explained the use-case well enough. |
Given that mccabe doesn't do anything like this and is basically not much of its own tool, I'm closing this |
Assuming you have some code that for historical reason on not may need an exemption from the desired
max-complexity
value, you should be able to specify an upper limit for the exception.Without an upper limit, there is no way to prevent complexity from increasing because the linter will always be happy.
Practical example at https://github.com/ansible/ansible-lint/blob/master/.flake8#L54-L55 which adds exception for specific file.
If working correctly something like
noqa: C901(12)
should be allowed, one that states that C901 should be ignored unless is bigger than 12 (assume that your overall project has lower limit).I am not aware of any workaround for achieving this.
The text was updated successfully, but these errors were encountered: