From aa03b73e60528bfff635abc36938eb904d2af206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mochol=C3=AD?= Date: Wed, 3 Feb 2021 09:37:06 +0100 Subject: [PATCH] Remove psf/black references (#5739) * Update pyproject.toml * Update setup.cfg * Update test.txt * Update CONTRIBUTING.md * Update requirements/test.txt --- .github/CONTRIBUTING.md | 2 +- pyproject.toml | 10 ++-------- requirements/test.txt | 2 -- setup.cfg | 5 +++-- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e12dc3cdb9..027cfaff87 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -113,7 +113,7 @@ In case you adding new dependencies, make sure that they are compatible with the ### Coding Style 1. Use f-strings for output formation (except logging when we stay with lazy `logging.info("Hello %s!", name)`. -2. Black code formatter is used using a `pre-commit` hook. +2. You can use `pre-commit` to make sure your code style is correct. ### Documentation diff --git a/pyproject.toml b/pyproject.toml index 29e64e2e90..7338a0556e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,13 +6,7 @@ requires = [ [tool.autopep8] max_line_length = 120 -ignore = ["W504", "W504", "E402", "E731", "C40", "E741", "F40", "F841"] - -[tool.black] -# https://github.com/psf/black -line-length = 120 -target-version = ["py38"] -exclude = "(.eggs|.git|.hg|.mypy_cache|.nox|.tox|.venv|.svn|_build|buck-out|build|dist)" +ignore = ["W503", "W504", "E402", "E731", "C40", "E741", "F40", "F841"] [tool.isort] known_first_party = [ @@ -22,7 +16,7 @@ known_first_party = [ "pytorch_lightning", "tests", ] -profile = "black" +profile = "google" line_length = 120 force_sort_within_sections = "False" order_by_type = "False" diff --git a/requirements/test.txt b/requirements/test.txt index 80ef988e70..1ca085ef2a 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -4,13 +4,11 @@ pytest>=5.0 # pytest-cov # pytest-flake8 flake8>=3.6 -flake8-black check-manifest twine==3.2 # scipy>=0.13.3 scikit-learn>=0.22.2 scikit-image>=0.17.2 -black>=20.8b1 isort>=5.6.4 mypy>=0.720, <0.800 pre-commit>=1.0 diff --git a/setup.cfg b/setup.cfg index 0c0198a340..a9ba0bc2ac 100644 --- a/setup.cfg +++ b/setup.cfg @@ -80,10 +80,11 @@ verbose = 2 format = pylint ignore = E731 # do not assign a lambda expression, use a def - W504 # line break occurred after a binary operator + W503 # line break before binary operator + W504 # line break after binary operator + # TODO: delete these next 2 because we no longer use black E203 # whitespace before ':'. Opposite convention enforced by black E231 # missing whitespace after ',', ';', or ':'; for black - W503 # line break before binary operator, need for black # setup.cfg or tox.ini