Closed medmunds closed 3 years ago
(I couldn't tell whether you had intended to keep flake8 alongside black, but guessed "yes" based on flake8 still appearing in the make lint
target and an accidentally-disabled Travis job.)
Install black in
make install
, so it is available formake format
Restore flake8 to
make install
, so it is available formake lint
Thanks for addressing this in particular. It wasn't possible until #133 was merged and was on my mind to address.
(I couldn't tell whether you had intended to keep flake8 alongside black, but guessed "yes" based on flake8 still appearing in the
make lint
target and an accidentally-disabled Travis job.)
Yes, definitely. 😁 They do complementary things.
I usually ignore E203, E302, W503, I201
in the flake8 config to avoid conflicts with black. Not sure if those should be added here at this time.
Oh, OK, I see a problem. Travis is using make install
—but with this PR that would include the developer tooling in the tests, which we don't really want. (Plus it fails on Python 3.5, because black is no longer available there.)
Two options:
make install
, but instead just run pip install -e ".[test]"
make install
back the way it was, and add a new make develop
target that also installs black and flake8 (and update the README Contributing section)Do you have a preference?
I usually ignore E203, E302, W503, I201 in the flake8 config to avoid conflicts with black. Not sure if those should be added here at this time.
I just copied the (current) recommended flake8 settings in the black docs. Easy enough to add the others if it would be helpful.
- Put
make install
back the way it was, and add a newmake develop
target that also installs black and flake8 (and update the README Contributing section)
This seems like a good approach to me.
I just copied the (current) recommended flake8 settings in the black docs. Easy enough to add the others if it would be helpful.
I wonder if W503 is no longer a conflict.
I think E302 and I201 could be left off, too. Those are just my own style preferences.
Sounds like W503 is now disabled by default in flake8, since a PEP 8 change a while back.
I think I201 depends on flake8-import-order, which we aren't currently using. (I don't think that's included with flake8 by default.)
I have no opinion on E302. (Well, actually, I agree with you, but in the spirit of deferring to opinionated formatting tools, I'm keeping my own opinion to myself :grin:)
Good to know that I can remove W503 from other projects. Yea, let's add flake8-import-order at some point, and then decide how we feel about all the newlines. I feel like without E302 the imports take up a whole screenful. 😁
Ready to merge, right?
Yep!
Thanks so much! 😁 🚀
@paulmelnikow my pleasure. Thank you for jumping in as an active maintainer!
Several minor fixes and improvements related to addition of black code formatter:
Makefile:
make install-tools
target to install development tooling needed formake format
andmake lint
make develop
target that installs tools and test packageREADME:
make develop
and recommendmake format-fix
Travis.yml:
include:
that was preventing flake8 job from runningtox.ini:
setup.cfg: