Skip to content

Commit

Permalink
Replace black for ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas committed Dec 30, 2023
1 parent 5623141 commit 77356a7
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 151 deletions.
31 changes: 4 additions & 27 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +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 .

black:
name: black
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4.1.1
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Run black on docs
run: poetry run blacken-docs
- name: 🚀 Run Ruff linter
run: poetry run ruff check --output-format=github .
- name: 🚀 Run Ruff formatter
run: poetry run ruff format --check .

pre-commit-hooks:
name: pre-commit-hooks
Expand Down Expand Up @@ -120,8 +99,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
21 changes: 8 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +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
require_serial: true
- id: blacken-docs
name: ☕️ Format documentation examples using black
language: system
files: '\.(rst|md|markdown|py|tex)$'
entry: poetry run blacken-docs
entry: poetry run ruff format
require_serial: true
stages: [commit, push, manual]
- id: check-ast
name: 🐍 Check Python AST
language: system
Expand Down Expand Up @@ -63,7 +58,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
Loading

0 comments on commit 77356a7

Please sign in to comment.