diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f3863bbcf92921a4da7ddce666c50b0d1044131d..3ab85fb5fc529cf7e5a6fa111d0028d021b7d2de 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,24 @@ ci: autoupdate_branch: devel repos: -- repo: https://github.com/PyCQA/flake8 - rev: 7.1.0 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.4.8 hooks: - - id: flake8 + - id: ruff + args: + - --fix + - --exit-non-zero-on-fix + - --ignore + - UP036 + - id: ruff-format - repo: https://github.com/cheshirekow/cmake-format-precommit rev: v0.6.13 hooks: - id: cmake-format +- repo: https://github.com/pappasam/toml-sort + rev: v0.23.1 + hooks: + - id: toml-sort-fix - repo: https://github.com/pre-commit/mirrors-clang-format rev: v18.1.8 hooks: @@ -30,8 +40,4 @@ repos: - id: end-of-file-fixer - id: mixed-line-ending - id: trailing-whitespace -- repo: https://github.com/psf/black - rev: 24.4.2 - hooks: - - id: black exclude: tests/test_python-syntax_error.py diff --git a/pyproject.toml b/pyproject.toml index 1a17557071f27ad42492ac50938837012a43538e..ed93b36bf8da34a682d74ba1cb05284f26c47d7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,11 @@ -[tool.isort] -line_length = 88 +[tool.ruff] +extend-exclude = ["cmake"] + +[tool.ruff.lint] +extend-select = ["I", "NPY", "RUF", "UP", "W"] + +[tool.ruff.lint.isort] +known-first-party = ["example_robot_data"] + +[tool.tomlsort] +all = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 4155cd476bc92ae6f1511bc3f6eb31b696607e30..0000000000000000000000000000000000000000 --- a/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[flake8] -max-line-length = 88 -exclude = tests/test_python-syntax_error.py -ignore = E226, E704, E24, E121, W504, E126, E123, W503, E203