Skip to content

Commit

Permalink
Migrate project from using flake8 & isort to ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
samiashi authored and jcrist committed Jul 6, 2023
1 parent 524de6b commit f122b13
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
lint:
name: Lint and flake code
name: Lint and ruff code
runs-on: ubuntu-latest

steps:
Expand Down
5 changes: 0 additions & 5 deletions .isort.cfg

This file was deleted.

12 changes: 3 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.275
hooks:
- id: isort
- id: ruff
language_version: python3

- repo: https://github.com/psf/black
Expand All @@ -11,12 +11,6 @@ repos:
- id: black
language_version: python3

- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
language_version: python3

- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
Expand Down
25 changes: 25 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[tool.ruff]
exclude = [
"*.pyi",
"__init__.py",
"_version.py",
"versioneer.py",
"basic_typing_examples.py",
"json.py",
"msgpack.py",
"test_JSONTestSuite.py",
"conf.py",
]
ignore = [
"E721", # Comparing types instead of isinstance
"E741", # Ambiguous variable names
]
select = [
"E", # PEP8 Errors
"F", # Pyflakes
"W", # PEP8 Warnings
]
line-length = 100

[tool.ruff.isort]
combine-as-imports = true
17 changes: 0 additions & 17 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
[flake8]
exclude =
__init__.py,
_version.py,
versioneer.py,
basic_typing_examples.py,
json.py,
msgpack.py,
test_JSONTestSuite.py,
conf.py
ignore =
E721, # Comparing types instead of isinstance
E741, # Ambiguous variable names
W503, # line break before binary operator
W504, # line break after binary operator
max-line-length = 100

[codespell]
skip=*.py,*.c,*.h

Expand Down

0 comments on commit f122b13

Please sign in to comment.