Skip to content

Commit

Permalink
Replace black for ruff format (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas committed Dec 5, 2023
1 parent 3120785 commit 05c62d5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 29 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ jobs:
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Run Ruff
run: poetry run ruff .
- name: 🚀 Run Ruff linter
run: poetry run ruff check --output-format=github .
- name: 🚀 Run Ruff formatter
run: poetry run ruff format --check .

black:
name: black
Expand Down Expand Up @@ -120,8 +122,6 @@ jobs:
run: poetry run pre-commit run check-xml --all-files
- name: 🚀 Check YAML files
run: poetry run pre-commit run check-yaml --all-files
- name: 🚀 Check YAML files
run: poetry run pre-commit run check-yaml --all-files
- name: 🚀 Detect Private Keys
run: poetry run pre-commit run detect-private-key --all-files
- name: 🚀 Check End of Files
Expand Down
15 changes: 8 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
repos:
- repo: local
hooks:
- id: ruff
name: 🐶 Ruff
- id: ruff-check
name: 🐶 Ruff Linter
language: system
types: [python]
entry: poetry run ruff --fix
entry: poetry run ruff check --fix
require_serial: true
stages: [commit, push, manual]
- id: black
name: ☕️ Format using black
- id: ruff-format
name: 🐶 Ruff Formatter
language: system
types: [python]
entry: poetry run black
entry: poetry run ruff format
require_serial: true
stages: [commit, push, manual]
- id: blacken-docs
name: ☕️ Format documentation examples using black
language: system
Expand Down Expand Up @@ -63,7 +64,7 @@ repos:
entry: poetry run check-toml
- id: check-xml
name: ✅ Check XML files
entry: check-xml
entry: poetry run check-xml
language: system
types: [xml]
- id: check-yaml
Expand Down
24 changes: 7 additions & 17 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Changelog = "https://github.com/klaasnicolaas/python-odp-stockholm/releases"

[tool.poetry.group.dev.dependencies]
aresponses = "2.1.6"
black = "23.11.0"
blacken-docs = "1.16.0"
codespell = "2.2.6"
covdefaults = "2.3.0"
Expand Down Expand Up @@ -138,6 +137,18 @@ ignore = [
"D213", # Conflicts with other rules
"D417", # False positives in some occasions
"PLR2004", # Just annoying, not really useful

# Formatter conflicts
"COM812",
"COM819",
"D206",
"E501",
"ISC001",
"Q000",
"Q001",
"Q002",
"Q003",
"W191",
]

[tool.ruff.flake8-pytest-style]
Expand Down

0 comments on commit 05c62d5

Please sign in to comment.