Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace black for ruff format #554

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 4 additions & 25 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,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/[email protected]
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
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
19 changes: 7 additions & 12 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
107 changes: 1 addition & 106 deletions poetry.lock

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

2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ namur = "^1.0.0"
odp-amsterdam = "^6.0.0"

[tool.poetry.group.dev.dependencies]
black = "23.12.1"
blacken-docs = "1.16.0"
pre-commit = "3.6.2"
pre-commit-hooks = "4.5.0"
pylint = "3.1.0"
Expand Down