Skip to content

Commit

Permalink
Upgrade ruff and replace black with ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
jsma authored and laymonage committed Nov 17, 2023
1 parent 7bb535f commit 9a2177d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 2 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@
"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
Expand Down

0 comments on commit 9a2177d

Please sign in to comment.