kopia lustrzana https://github.com/wagtail/wagtail
Upgrade `ruff` and replace `black` with `ruff format`
rodzic
7bb535f8a2
commit
9a2177dc19
|
@ -20,7 +20,7 @@ jobs:
|
|||
paths:
|
||||
- .venv
|
||||
- run: pipenv run ruff check .
|
||||
- run: pipenv run black --target-version py38 --check --diff .
|
||||
- run: pipenv run ruff format --check .
|
||||
- run: pipenv run semgrep --config .semgrep.yml --error .
|
||||
- run: git ls-files '*.html' | xargs pipenv run djhtml --check
|
||||
- run: pipenv run curlylint --parse-only wagtail
|
||||
|
|
|
@ -2,18 +2,12 @@ default_language_version:
|
|||
node: system
|
||||
python: python3
|
||||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.3.0
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3
|
||||
args: ['--target-version', 'py38']
|
||||
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: 'v0.0.290'
|
||||
rev: 'v0.1.5'
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: [--fix, --exit-non-zero-on-fix]
|
||||
- id: ruff-format
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||
rev: v3.0.3
|
||||
|
|
6
Makefile
6
Makefile
|
@ -3,7 +3,7 @@
|
|||
help:
|
||||
@echo "clean-pyc - remove Python file artifacts"
|
||||
@echo "develop - install development dependencies"
|
||||
@echo "lint - check style with black, ruff, sort python with ruff, indent html, and lint frontend css/js"
|
||||
@echo "lint - check style with ruff, sort python with ruff, indent html, and lint frontend css/js"
|
||||
@echo "format - enforce a consistent code style across the codebase, sort python files with ruff and fix frontend css/js"
|
||||
@echo "test - run tests"
|
||||
@echo "coverage - check code coverage"
|
||||
|
@ -18,7 +18,7 @@ develop: clean-pyc
|
|||
npm install --no-save && npm run build
|
||||
|
||||
lint-server:
|
||||
black --target-version py38 --check --diff .
|
||||
ruff format --check .
|
||||
ruff check .
|
||||
curlylint --parse-only wagtail
|
||||
git ls-files '*.html' | xargs djhtml --check
|
||||
|
@ -35,8 +35,8 @@ lint-docs:
|
|||
lint: lint-server lint-client lint-docs
|
||||
|
||||
format-server:
|
||||
black --target-version py38 .
|
||||
ruff check . --fix
|
||||
ruff format .
|
||||
git ls-files '*.html' | xargs djhtml
|
||||
|
||||
format-client:
|
||||
|
|
3
setup.py
3
setup.py
|
@ -51,9 +51,8 @@ testing_extras = [
|
|||
"django-pattern-library>=0.7",
|
||||
# For coverage and PEP8 linting
|
||||
"coverage>=3.7.0",
|
||||
"black==22.3.0",
|
||||
"doc8==0.8.1",
|
||||
"ruff==0.0.290",
|
||||
"ruff==0.1.5",
|
||||
# For enforcing string formatting mechanism in source files
|
||||
"semgrep==1.40.0",
|
||||
# For templates linting
|
||||
|
|
Ładowanie…
Reference in New Issue