diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e2c5e98fd..7d57c3a0c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,7 @@ repos: -- repo: https://github.com/ambv/black - rev: 22.3.0 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.9.0 hooks: - - id: black - language_version: python3.7 - additional_dependencies: ['click==8.0.4'] -- repo: https://github.com/pycqa/flake8 - rev: 5.0.4 - hooks: - - id: flake8 - args: - - "--config=setup.cfg" + - id: ruff + args: ['--fix'] + - id: ruff-format diff --git a/pyproject.toml b/pyproject.toml index 64b71429e..be47f69a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,5 +62,12 @@ repair-wheel-command = "delocate-wheel --require-archs {delocate_archs} -w {dest [tool.cibuildwheel.pyodide] -[tool.isort] +[tool.ruff] +line-length = 88 + +[tool.ruff.lint] +select = ["E", "F", "W", "C", "B", "B9"] +ignore = ["E203", "E266", "E501", "E731", "W503", "E741", "F541"] + +[tool.ruff.lint.isort] profile = "black" diff --git a/requirements.txt b/requirements.txt index 895bc3f7c..866128b31 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,14 +26,12 @@ cython>=3.0,<4.0 pytest>=5.2.0,!=7.1.0 pytest-timeout>=1.3.0,<2.0.0 mock>=2.0.0,<3.0.0 -flake8>=3.8.0,<6.0.0 hypothesis>=3.27.0,<7.0.0 mypy>=1.5.0,<1.6.0; platform_machine != "aarch64" and python_version >= "3.8" types-mock>=0.1.1 types-setuptools>=57.0.0 types-requests types-setuptools>=57.0.0 -black>=25.0.0 +ruff>=0.9.0 cython-lint>=0.15.0 -isort>=5.0,<6.0 confection>=0.0.4,<1.0.0 diff --git a/setup.cfg b/setup.cfg index 585c2694f..1ef8e3031 100644 --- a/setup.cfg +++ b/setup.cfg @@ -131,16 +131,6 @@ universal = false [sdist] formats = gztar -[flake8] -ignore = E203, E266, E501, E731, W503, E741, F541 -max-line-length = 80 -select = B,C,E,F,W,T4,B9 -exclude = - .env, - .git, - __pycache__, - _tokenizer_exceptions_list.py, - [tool:pytest] markers = slow: mark a test as slow