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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use black code formatter #3852
Use black code formatter #3852
Conversation
[tool.black] | ||
target_version = ['py36', 'py37', 'py38'] | ||
include = '\.pyi?$' | ||
exclude = ''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've extended default exclude list for faster file discovery. We don't need to format cache dirs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really needed to include .pyi
stub files?
Codecov Report
@@ Coverage Diff @@
## master #3852 +/- ##
==========================================
+ Coverage 91.56% 91.62% +0.05%
==========================================
Files 277 277
Lines 15106 15108 +2
Branches 1474 1474
==========================================
+ Hits 13832 13842 +10
+ Misses 877 868 -9
- Partials 397 398 +1
Continue to review full report at Codecov.
|
With this PR we're adding |
Pipfile is actually toml format, but pipenv iteself doesn't support pyproject.toml yet. |
Depending on psf/black#759 |
Plus, psf/black#763 should fix this issue. |
We have to put this PR on hold until the next version of Black is released. This is supposed to happen in April (no exact date yet). |
As psf/black#763 is merged, and Pipenv supports pin any package via git commit, if we don't want to wait for black's release, |
@jxltom It would be great to migrate to Black as soon as possible. What's your opinion on relying on an unreleased version of a library @patrys @krzysztofwolski ? |
I'd rather wait for it to be released as I fear people would still use released versions and we'd end up changing the formats back and forth. |
It won't be a problem if users install packages via our Besides, I waited for a released version of black for half a year via psf/black#517, but there still has no release. Hope it can be released in early April. |
I would rather not use an unreleased version of the software which calls itself |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that if we change the line length, we have to update .editorconfig
re migration to toml: our tools slowly migrate to "new" format https://gitlab.com/pycqa/flake8/issues/428 and toml libs seem to be an issue. Shame it's not JSON. |
I just realized that in PR #4028 we're removing support for Python 3.5 which means we'll be no longer blocked by the issue in Black 馃帀 . |
@maarcingebala this week I'll update PR 馃帀 |
Refering to pylint-dev/pylint#289 (open since 2014). |
I updated the docs to mention pre-commit & black and added a black badge to the readme. |
Pylint produces false positives for C0330 which makes it harder to pass the codeclimate checks with black. In anyway, black is supposed to detect any bad continuation. Thus replacing C0330.
I want to merge this change because... ref #3846
Screenshots
Todo
Pull Request Checklist