Skip to content

Commit

Permalink
Replace flake8 and isort with ruff (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
hillairet committed Sep 1, 2023
1 parent 565a6f6 commit aeb6044
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
15 changes: 4 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,13 @@ repos:
args: [--autofix]
- id: pretty-format-yaml
args: [--autofix, --indent, '2']
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/ambv/black
rev: 23.7.0
hooks:
- id: black
args: [-l, '100', --target-version, py35]
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.286
hooks:
- id: flake8
args: [--exclude, tests/exceptions/source]
additional_dependencies:
- flake8-bugbear==23.1.20
- pep8-naming==0.13.3
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
8 changes: 8 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Enforce pyflakes(F), pycodestyle(E, W), isort (I), bugbears (B), and pep8-naming (N) rules
select = ["F", "E", "W", "I", "B", "N"]
# Ignore these errors for now that are picked up by ruff but were not by flake8
ignore = ["B904", "B033", "B028", "B018"]
line-length = 100
exclude = ["tests/exceptions/source", "loguru/__init__.pyi"]
[pycodestyle]
max-doc-length = 100
15 changes: 0 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,6 @@ description = Build the HTML documentation.
commands =
sphinx-build -a -b html -W --keep-going docs/ docs/build

[isort]
line_length = 100
profile = black

[flake8]
max_line_length = 100
max_doc_length = 100
ignore =
# Line break before binary operator (PEP8 now recommend to break after binary operator)
W503
# Whitespace before ":" in slices
E203
exclude =
tests/exceptions/source

[pytest]
addopts = -l
testpaths =
Expand Down

0 comments on commit aeb6044

Please sign in to comment.