Skip to content

Commit

Permalink
Migrate from pylint, flake8, isort and black to ruff (#437)
Browse files Browse the repository at this point in the history
* To check code run: ruff check .
* To format code run: ruff format .
* Fix bug when the self or cls parameters are typed, ignore that on describe
  • Loading branch information
nycholas committed Jan 20, 2024
1 parent c5d72ab commit 1601cd4
Show file tree
Hide file tree
Showing 40 changed files with 729 additions and 2,268 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/on_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
lint:
name: Lint
name: Lint and Format
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
Expand All @@ -32,12 +32,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install -r requirements/base.txt -r requirements/style.txt
- name: Run flake8
- name: Run ruff
run: |
flake8 src/ tests/
- name: Run pylint
run: |
pylint src/ tests/
ruff check .
test:
name: Test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.issue.pull_request.html_url }}
run: |
gh pr comment $PR --body 'The "Tests [Docker]" workflow will be started.'
gh pr comment $PR --body 'Running "Tests [Docker]" workflow.'
unit-tests:
name: Unit tests
Expand Down
42 changes: 7 additions & 35 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ default_stages: [commit]
fail_fast: true
default_language_version:
python: python3.12
ci:
autoupdate_schedule: monthly
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
Expand All @@ -16,39 +18,9 @@ repos:
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
hooks:
- id: pyupgrade
args: ['--py38-plus']
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
args: ['--safe']
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies:
- black==23.12.1
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-isort==6.1.1
- flake8-bugbear==24.1.17
- flake8-pyi==24.1.0
- flake8-quotes==3.3.2
- flake8-implicit-str-concat==0.4.0
- flake8-pyproject==1.2.3
args: ['--toml-config=pyproject.toml']
- repo: https://github.com/PyCQA/pylint
rev: v3.0.3
hooks:
- id: pylint
- id: ruff
- id: ruff-format
Loading

0 comments on commit 1601cd4

Please sign in to comment.