https://pantsbuild.org/ logo
#general
Title
# general
f

fierce-park-88503

08/05/2019, 3:14 PM
Is there a way to disable individual pythonstyle checks? We want to start using
black
, but some of its choices go against some of the checks
e.g., “line break before binary operator” is a big one
e

enough-analyst-54434

08/05/2019, 3:42 PM
Yes, see:
Copy code
$ ./pants options | grep pycheck | grep ignore

pycheck-pycodestyle.ignore = ['E121', 'E124', 'E125', 'E127', 'E128', 'E401', 'E111', 'W291', 'W293', 'E701', 'E301', 'E302', 'W292'] (from HARDCODED)
pycheck-pyflakes.ignore = [] (from HARDCODED)
In this specific case, I think you want to add to the default
pycheck-pycodestyle.ignore
, ie add something like this to your `pants.ini`:
Copy code
$ cat << EOF >> pants.ini
> [pycheck-pycodestyle]
> ignore: +['W503']
> EOF
Which will yield:
Copy code
$ ./pants options | grep pycheck | grep ignore

pycheck-pycodestyle.ignore = ['E121', 'E124', 'E125', 'E127', 'E128', 'E401', 'E111', 'W291', 'W293', 'E701', 'E301', 'E302', 'W292', 'W503'] (from CONFIG in pants.ini)
pycheck-pyflakes.ignore = [] (from HARDCODED)
I got that particular value from here: https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
w

witty-crayon-22786

08/05/2019, 5:10 PM
@fierce-park-88503: we'd love a contrib plugin for
black
if you have the time!
h

hundreds-father-404

08/06/2019, 1:17 AM
@fierce-park-88503 indeed! I’ve been wanting to do it but haven’t found the time with starting teaching. I’d be happy to help with reviews (although am fairly unavailable most the day for immediate help with things)
2 Views