diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0c0aef4..d2cabe69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ on: jobs: lint: - name: Lint and flake code + name: Lint and ruff code runs-on: ubuntu-latest steps: diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index abf82742..00000000 --- a/.isort.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[settings] -skip_glob=msgspec/__init__.py,examples/* -multi_line_output=3 -include_trailing_comma=true -combine_as_imports=true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 143d9533..fd24f180 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..bf8e8153 --- /dev/null +++ b/pyproject.toml @@ -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 diff --git a/setup.cfg b/setup.cfg index 4a1cdacd..86465ce0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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