Skip to content
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

Rework TOML loading; BLK907 for invalid pyproject.toml #16

Closed
wants to merge 1 commit into from

Conversation

peterjc
Copy link
Owner

@peterjc peterjc commented Aug 8, 2019

A reworking of PR #15.

Builds on #11, makes the caching of parsed pyproject.toml files more explicit (run flake8 -v ... | grep black to see this in the logs).

Adds new BLK997 if a pyproject.toml file is invalid, allows using flake8 --black-config '' ... (or any other bash syntax to pass an empty string) to mean ignore any pyproject.toml files.

What do you think @098799 ?

@peterjc peterjc added the enhancement New feature or request label Aug 8, 2019
@098799
Copy link

098799 commented Aug 8, 2019

Have to say I'm completely lost in the logic of override and the if/elif/return madness, but don't have much time now to try to simplify it. Still, I strongly feel like you're overengineering stuff: there should be one if (is the black config supplied in the config? is it a correct file?) which checks from which file the config should be loaded (project or global).

@peterjc
Copy link
Owner Author

peterjc commented Aug 8, 2019

If you're completely lost, then it is too complicated.

One simplification would be if we could offload the path normalisation to flake8 (my issue #13), but that seems to me to be broken: https://gitlab.com/pycqa/flake8/issues/562

@peterjc
Copy link
Owner Author

peterjc commented Aug 8, 2019

Note also that using flake8 to do the path normalisation would currently prevent using None (or any non-string) as a default value in order to tell apart no value set, and the empty string being used. PR proposed:
https://gitlab.com/pycqa/flake8/merge_requests/337

@peterjc
Copy link
Owner Author

peterjc commented Aug 9, 2019

Closing for a third attempt...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants