]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
chore: add isort configuration
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 11 Feb 2025 21:23:50 +0000 (22:23 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 14 Feb 2025 17:52:10 +0000 (18:52 +0100)
.pre-commit-config.yaml
psycopg/setup.cfg
pyproject.toml
tools/async_to_sync.py

index 082386b6786e9291b0ffaf70d2f6f30e5c673940..9c27ef8abdfaca457c0c8a53a316fa9db83fa4b9 100644 (file)
@@ -32,3 +32,9 @@ repos:
         language: system
         entry: mypy --pretty --follow-imports=silent
         files: \.py[i]?$
+
+      - id: isort
+        name: isort
+        language: system
+        entry: isort
+        files: \.(py[i]?|pxd|pyx)$
index 1c23bd917a93a5bfcf75282094e80dfccf365e46..c4a645f29b2bc1e72613efda6765dc5a9a6445ea 100644 (file)
@@ -79,6 +79,8 @@ dev =
     codespell >= 2.2
     dnspython >= 2.1
     flake8 >= 4.0
+    isort >= 6.0
+    isort-psycopg
     mypy >= 1.14
     pre-commit >= 4.0.1
     types-setuptools >= 57.4
index ce539c1d41757ccd6316a0e6ad5bd5e3f126d81b..f684b648997390e0b1216f4a47e24b1fcc130851 100644 (file)
@@ -64,3 +64,9 @@ disallow_untyped_calls = false
 [tool.codespell]
 ignore-words-list = "alot,ans,ba,fo,te,erro,varning"
 skip = "build,_build,.tox,.mypy_cache,.venv,pq.c,_psycopg.c,*.html"
+
+[tool.isort]
+profile = "black"
+length_sort = true
+multi_line_output = 9
+sort_order = "psycopg"  # requires the isort-psycopg module
index 563214444b2c47b040468d5f9c69bbaca08a4f11..ae4d755ccf0c4b1ce9b1cad3d11e8de0a9dad5d0 100755 (executable)
@@ -132,6 +132,7 @@ def convert(fpin: Path, fpout: Path) -> None:
         print(output, file=f)
 
     sp.check_call(["black", "-q", str(fpout)])
+    sp.check_call(["isort", "-q", str(fpout)])
 
 
 def check(outputs: list[str]) -> int: