Move black from SuperLinter to upload workflow, use 21.12b0 in pre-commit (#10103)

* black==21.12b0 in pre-commit

Match `setup.py`.

* move black from super linter to upload workflow

* black (updated)

* configure so black . works

* --check --diff for black
This commit is contained in:
Kyle Altendorf 2022-02-21 00:33:09 -05:00 committed by GitHub
parent 8a5c125418
commit e3fb3ce96e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 6 deletions

View file

@ -62,7 +62,6 @@ jobs:
DEFAULT_BRANCH: main
LINTER_RULES_PATH: .
MARKDOWN_CONFIG_FILE: .markdown-lint.yml
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
PYTHON_FLAKE8_CONFIG_FILE: .flake8
PYTHON_ISORT_CONFIG_FILE: .isort.cfg
PYTHON_PYLINT_CONFIG_FILE: pylintrc
@ -77,7 +76,6 @@ jobs:
VALIDATE_POWERSHELL: true
VALIDATE_PYTHON_PYLINT: true
VALIDATE_PYTHON_FLAKE8: true
VALIDATE_PYTHON_BLACK: true
# VALIDATE_PYTHON_ISORT: true
VALIDATE_SHELL_SHFMT: true
VALIDATE_TYPESCRIPT_ES: true

View file

@ -48,6 +48,10 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
python -m pip install .[dev]
- name: Lint source with black
run: |
black --check --diff .
- name: Lint source with flake8
run: |
flake8 chia tests

View file

@ -46,7 +46,7 @@ repos:
- id: check-ast
- id: debug-statements
- repo: https://github.com/psf/black
rev: 21.8b0
rev: 21.12b0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8

View file

@ -114,7 +114,6 @@ if getattr(sys, "frozen", False):
path = f"{application_path}/{name_map[service_name]}"
return path
else:
application_path = os.path.dirname(__file__)

View file

@ -23,7 +23,6 @@ if sys.version_info < (3, 8):
def get_args(t: Type[Any]) -> Tuple[Any, ...]:
return getattr(t, "__args__", ())
else:
from typing import get_args

View file

@ -10,7 +10,6 @@ if sys.version_info < (3, 8):
def get_origin(t: Type[Any]) -> Optional[Type[Any]]:
return getattr(t, "__origin__", None)
else:
from typing import get_args, get_origin

View file

@ -8,3 +8,11 @@ local_scheme = "no-local-version"
[tool.black]
line-length = 120
target-version = ['py37', 'py38', 'py39']
include = '''
^/(
[^/]*.py
| (benchmarks|build_scripts|chia|tests|tools)/.*\.pyi?
)$
'''
exclude = ''