-
Notifications
You must be signed in to change notification settings - Fork 753
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
cannot combine --select
and --ignore
#390
Comments
This behaviour was introduced by 9a95d72 which I think was trying to be smarter about situations like |
This updates the logic in the StyleGuide to allow users to specify both --select and --ignore to combine the power of both flags. Take for example: $ pep8 --select=E1 --ignore=E112 testsuite/E11.py Will allow us to filter out E112 while selecting the E1xx checks in general. Closes PyCQA#390
Her we update the logic in the StyleGuide to allow users to specify both --select and --ignore to combine the power of both flags. Take for example: $ pep8 --select=E1 --ignore=E112 testsuite/E11.py The example shows that we are now allowed to filter out E112 while selecting the other E1xx checks. A (potentially unfortunate) consequence of this change is that if a user specifies --select without --ignore and has codes ignored in their config file, then we will merge that into the options and continue to ignore those codes. Closes PyCQA#390
Here we update the logic in the StyleGuide to allow users to specify both --select and --ignore to combine the power of both flags. Take for example: $ pep8 --select=E1 --ignore=E112 testsuite/E11.py The example shows that we are now allowed to filter out E112 while selecting the other E1xx checks. A (potentially unfortunate) consequence of this change is that if a user specifies --select without --ignore and has codes ignored in their config file, then we will merge that into the options and continue to ignore those codes. Closes PyCQA#390
Just stumbled on that one in OpenStack Neutron where we inadvertently disabled all checks by enabling a single off_by_default check with select = in tox.ini. We are going to disable the selected check for the time being, but really, this should be solved in pep8. |
@booxter thanks for the data point. A few things:
|
Project: openstack/neutron 26230eb840df18f2e866ed12221a942a206c1729 Make pep8 job great again There is a bug in pep8, when 'select' used, it omits all default checks and runs only those specified by 'select'. We got hit by this issue since I2d26534230ffe5d01aa0aab6ec902f81cfba774d was merged which lead to almost no static checks in pep8 job. Also note that off_by_default decorator has no effect for now because factory in hacking is triggered after ignored checks are collected. There will be a follow-up patch for that in order to make pep8 doing its job quickly. [1] PyCQA/pycodestyle#390 Related-Bug: 1594756 Change-Id: I8e27f40908e1bb4307cc7c893169a9d99f3433c4
There is a bug in pep8, when 'select' used, it omits all default checks and runs only those specified by 'select'. We got hit by this issue since I2d26534230ffe5d01aa0aab6ec902f81cfba774d was merged which lead to almost no static checks in pep8 job. Also note that off_by_default decorator has no effect for now because factory in hacking is triggered after ignored checks are collected. There will be a follow-up patch for that in order to make pep8 doing its job quickly. [1] PyCQA/pycodestyle#390 Related-Bug: 1594756 Change-Id: I8e27f40908e1bb4307cc7c893169a9d99f3433c4
Project: openstack/neutron e62a670e703709cda12a671b8a50056239e48800 Switch to new hacking 0.12 The release includes its own check for delayed string interpolation for log messages, so we can now remove our own check for the same thing. The check is off-by-default, so we need to explicitly enable it. Sadly, select= directive in tox.ini is broken [1] so we need to enable the check with flake8 argument instead. [1] PyCQA/pycodestyle#390 Change-Id: Idc6b8e5b1cb594e130d4cc0cbcfffd362f9ab86a
The release includes its own check for delayed string interpolation for log messages, so we can now remove our own check for the same thing. The check is off-by-default, so we need to explicitly enable it. Sadly, select= directive in tox.ini is broken [1] so we need to enable the check with flake8 argument instead. [1] PyCQA/pycodestyle#390 Change-Id: Idc6b8e5b1cb594e130d4cc0cbcfffd362f9ab86a
This means that specifying a project that forbids E226 but allows W503 is really tedious :). I hope I'm just missing something, but
--select=W,E --ignore=W503
results in exactly the same behavior as just--select=W,E
.The text was updated successfully, but these errors were encountered: