-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Refactor/replace black flake8 with ruff (#359)
* build(pyproject): replaced black and flake8 with ruff * style: applied automatic Ruff linting and formatting * style: Manual fixes of ruff linting results * ci: Linting and formatting on pull request * chore(pre-commit): Linting and Formatting runs on pre-commit and pre-push hooks * fix: Tests failing due to missing imports Ruff thought that the imports in context were unused. * fix: noqa on pep-8 naming for filters Not sure if this solves the error, I have renamed the file locally, but for some reason it doesn't propagate to GH * chore: rename filters and add class def
- Loading branch information
1 parent
4f45fdc
commit 578d7d9
Showing
42 changed files
with
689 additions
and
416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Check formatting and linting | ||
|
||
on: | ||
pull_request: | ||
push: { branches: [main] } | ||
|
||
jobs: | ||
ruff-check: | ||
name: Run ruff lint and format checks | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
|
||
- name: Installing dependencies | ||
run: pip install ruff | ||
|
||
- name: Run ruff lint | ||
run: ruff check . | ||
|
||
- name: Run ruff format | ||
run: ruff format . --check | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: lint | ||
name: Ruff Lint | ||
description: Linting using ruff | ||
entry: bash -c 'ruff check .' | ||
language: system | ||
stages: ["pre-commit", "pre-push"] | ||
|
||
- id: format | ||
name: Ruff Format | ||
description: Formatting using ruff | ||
entry: bash -c 'ruff format . --check' | ||
language: system | ||
stages: ["pre-commit", "pre-push"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.