You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our projects setup.cfg we often add --black via addopts, so our CI always runs with black and any other project specific options that may be required:
[tool:pytest]
addopts = -n auto --black
However there are often cases when developing locally you do not wish to have your tests fail due to black. This poses a problem, because you have to edit your setup.cfg to remove --black and remember to add it back again when committing.
It would be really handy to have a --no-black argument that can be given that overrides the --black flag, if present. So a full invocation might expand to pytest --black --no-black, which would not run black.
The text was updated successfully, but these errors were encountered:
This seems very much like an issue with your setup - not the tool. It would require the tool to make an additional flag for having the flag but not seriously meaning it.
I am not the author of this project though, so I have no real say. Just my five cent.
This seems very much like an issue with your setup - not the tool. It would require the tool to make an additional flag for having the flag but not seriously meaning it.
This was also added to pytest-pylint for the same reasons. Using setup.cfg to enforce consistent pytest options is a very, very common (and recommended) pattern. The downside of this is it's annoying to remove some flags, which is usually only needed with plugins like pylint or black.
So yeah it would require adding an additional flag, but the only setup that's at fault here is pytest :(
In our projects
setup.cfg
we often add--black
viaaddopts
, so our CI always runs with black and any other project specific options that may be required:However there are often cases when developing locally you do not wish to have your tests fail due to black. This poses a problem, because you have to edit your
setup.cfg
to remove--black
and remember to add it back again when committing.It would be really handy to have a
--no-black
argument that can be given that overrides the--black
flag, if present. So a full invocation might expand topytest --black --no-black
, which would not run black.The text was updated successfully, but these errors were encountered: