Skip to content

Commit

Permalink
ci: Use ruff to lint Python files
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Moreno <felipe@flpm.dev>
  • Loading branch information
flpm authored and godlygeek committed May 1, 2023
1 parent 7260cdf commit 5c6f07c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
15 changes: 8 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,24 @@ repos:
- id: rst-inline-touching-normal
stages: [pre-commit]

- repo: https://github.com/psf/black
rev: 23.3.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.262"
hooks:
- id: black
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
stages: [pre-commit]

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: flake8
- id: black
stages: [pre-commit]
types: [file, python]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
exclude_types: [python]
stages: [pre-commit]

- repo: https://github.com/sphinx-contrib/sphinx-lint
Expand Down
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ requires = [

build-backend = 'setuptools.build_meta'

[tool.isort]
[tool.ruff]
line-length = 95
select = ["F", "E", "W", "I001"]

[tool.ruff.isort]
force-single-line = true
known-first-party = ["pystack"]
known-third-party=["rich", "elftools", "pytest"]

[tool.isort]
force_single_line = true
multi_line_output = 3
include_trailing_comma = true
Expand Down
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

0 comments on commit 5c6f07c

Please sign in to comment.