Is there a way to disable individual pythonstyle c...
# general
f
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
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
@fierce-park-88503: we'd love a contrib plugin for
black
if you have the time!
h
@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)