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:
parent
8a5c125418
commit
e3fb3ce96e
7 changed files with 13 additions and 6 deletions
2
.github/workflows/super-linter.yml
vendored
2
.github/workflows/super-linter.yml
vendored
|
@ -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
|
||||
|
|
4
.github/workflows/upload-pypi-source.yml
vendored
4
.github/workflows/upload-pypi-source.yml
vendored
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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__)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 = ''
|
||||
|
|
Loading…
Reference in a new issue