-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Provide lists of lint / pycodestyle rules that Black makes obsolete #429
Comments
The black plugin fur sublimetext has this addon, if it may help |
Sounds like a reasonable thing we could document in the README :) Care to put together a PR? |
@zsol Not at all, if you don't mind waiting for me to find the time! I'm a little busy at the moment, but I may free up in a week or two. Additionally, adding all of these to explicit tests would help ensure the rules stay obsolete, and help justify individual rules being on the list. Though the tests may also be redundant if they're already covered. I suspect most of them are. Would you like that too? |
@jgirardet Thanks for that list! Do we have any idea if it's 'complete'? |
We should ask to @kaste |
It's not complete bc I ignored all tab warnings. |
We may also have to add W503 to this list: #52 |
See also: - psf/black#429 - psf/black#52 (W503)
See also: - psf/black#429 - psf/black#53 (W503)
See also: - psf/black#429 - psf/black#53 (W503)
See also: - psf/black#429 - psf/black#53 (W503)
See also: - psf/black#429 - psf/black#53 (W503)
See also: - psf/black#429 - psf/black#53 (W503)
See also: - psf/black#429 - psf/black#53 (W503) - cihai/cihai#140
See also: - psf/black#429 - psf/black#53 (W503) - cihai/cihai#140
See also: - cihai/cihai#140 - psf/black#429 - psf/black#53 (W503)
Thanks for creating this issue. This is the list I've come up with:
I wouldn't mind creating tests for this, but I'm not sure if they belong in or would be accepted in the Black repo. Maybe we should create a separate project? |
@chdsbd, thank you for your additional list. It differs from https://github.com/kaste/SublimeLinter-addon-black-for-flake/blob/master/plugin.py. I haven't checked every rule in both lists, the I'd argue the true list is probably a combination of the two, maybe plus more (e.g. E223/E224, I assume). It's a sufficiently long list, and hard enough to keep in my head, that tests make a lot of sense to me. IMO this list should be rules Black makes obsolete because it makes a decisive choice, not necessarily because it fixes it. If Black actively chooses to break a rule, it is still something I want to ignore. Let me pick on a rule in your list, but not Sublime's, to illustrate.
|
Disable Flake8 rules that are handled by Black. The list comes from psf/black#429 (comment).
* Add pre-commit configuration Add auto-formatting configuration using the https://pre-commit.com/ project. Having auto-formatting setup and automatically enforced helps speeding up development and review process. * Apply the auto-formatting on all files in the repository * Removes flake8-quotes as it conflicts with Black formatting * Disable some Flake8 rules Disable Flake8 rules that are handled by Black. The list comes from psf/black#429 (comment).
This PR proposes to add [Black](https://github.com/psf/black) into Koalas. - `dev/linter-python` detects if codes are formatted or not by Black - `dev/reformat` script that reformats the codes by using black. - It still keeps 100 line length style, and ignores `E231` and `E203` at pycodestyle. See also psf/black#429 and psf/black#1202. Black automatically formats and violates several rules. - Update contribution guide. Resolve #755 Co-authored-by: Deepyaman Datta <deepyaman.datta@utexas.edu>
Ping! I think PR #1371 pretty much resolves this issue. Although, I should look into why the list above has a lot of ignore rules. |
As for SublimeLinter, this list here is applied as a post filter. T.i. you can have a normal flake8 configuration for example for CI, only in the editor then a lot of errors are suppressed iff you're running the black formatter e.g. on save. That's why you have a minimal list for where black and flake8 just disagree, and the maximal list provided here where black is a fixer for flake8 errors. |
This PR proposes to add [Black](https://github.com/psf/black) into Koalas. - `dev/linter-python` detects if codes are formatted or not by Black - `dev/reformat` script that reformats the codes by using black. - It still keeps 100 line length style, and ignores `E231` and `E203` at pycodestyle. See also psf/black#429 and psf/black#1202. Black automatically formats and violates several rules. - Update contribution guide. Resolve #755 Co-authored-by: Deepyaman Datta <deepyaman.datta@utexas.edu>
See also: - psf/black#429 - psf/black#53 (W503) - cihai/cihai#140
Information Request / Addition to README
This is related to #259 (comment), but I have the opposite aim as that thread. For me, my editor shows everything flake8 is catching for me, but many things I'm intentionally not worrying about because I know Black will handle it. I want to continue to have flake8 tell me valuable things, but never bother me for anything Black handles. They are distractions. I can add all of these rules to my
.flake8
, which works great, but I've been only finding them as I go.Is there a complete list of Black-made obsolete pycodestyle rules? I know only a subset of these rules are made obsolete.
I'd love to just drop that list in my
.flake8
and never be bothered by the obsolete rules again. I suggest adding this list to the README.The text was updated successfully, but these errors were encountered: