From e05861d27b670b437b01308859c8528a33e5ba23 Mon Sep 17 00:00:00 2001
From: Yoann Schneider <yschneider@teklia.com>
Date: Wed, 24 Apr 2024 07:47:27 +0000
Subject: [PATCH] Use ruff for isort

---
 .pre-commit-config.yaml |  4 ----
 ruff.toml               | 30 ++++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index ab231dc03c..dab142c89c 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,8 +1,4 @@
 repos:
-  - repo: https://github.com/pre-commit/mirrors-isort
-    rev: v5.10.1
-    hooks:
-      - id: isort
   - repo: https://github.com/astral-sh/ruff-pre-commit
     # Ruff version.
     rev: v0.3.7
diff --git a/ruff.toml b/ruff.toml
index 34f67e876b..6def6e2892 100644
--- a/ruff.toml
+++ b/ruff.toml
@@ -15,6 +15,8 @@ select = [
     "E",
     # request-without-timeout
     "S113",
+    # isort
+    "I",
     # flake8-debugger
     "T10",
     # escape-sequence-in-docstring
@@ -23,3 +25,31 @@ select = [
     "RET",
 ]
 ignore = ["E501", "RET502", "RET503"]
+
+[lint.isort]
+default-section = "first-party"
+known-third-party = [
+    "SolrClient",
+    "bleach",
+    "boto3",
+    "botocore",
+    "cryptography",
+    "corsheaders",
+    "django",
+    "django_admin_hstore_widget",
+    "django_rq",
+    "drf_spectacular",
+    "enumfields",
+    "gitlab",
+    "psycopg2",
+    "requests",
+    "responses",
+    "rest_framework",
+    "rq",
+    "setuptools",
+    "sqlparse",
+    "teklia_toolbox",
+    "tenacity",
+    "tripoli",
+    "yaml",
+]
-- 
GitLab