From 762efc23085bcbf058729f8751aa5e8e942e5b0f Mon Sep 17 00:00:00 2001
From: Guilhem Saurel <guilhem.saurel@laas.fr>
Date: Tue, 9 Jul 2024 12:02:39 +0200
Subject: [PATCH] =?UTF-8?q?flake8=20+=20black=20=E2=86=92=20ruff?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .pre-commit-config.yaml | 20 +++++++++++++-------
 pyproject.toml          | 13 +++++++++++--
 setup.cfg               |  4 ----
 3 files changed, 24 insertions(+), 13 deletions(-)
 delete mode 100644 setup.cfg

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index f3863bb..3ab85fb 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 1a17557..ed93b36 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 4155cd4..0000000
--- 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
-- 
GitLab