ci: Update lint configuration

This commit is contained in:
Philipp Hörist
2026-06-06 18:19:21 +02:00
parent 2522264c7d
commit cc63a25fe0
3 changed files with 23 additions and 39 deletions
-11
View File
@@ -24,17 +24,6 @@ test-pyright:
- pyright - pyright
interruptible: true interruptible: true
test-isort:
image: gajim-test
stage: test
rules:
- changes:
- "**/*.py"
script:
- isort --version
- isort --check .
interruptible: true
test-ruff-lint: test-ruff-lint:
image: gajim-test image: gajim-test
stage: test stage: test
+3 -1
View File
@@ -1,10 +1,12 @@
repos: repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit - repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.14.8 rev: v0.15.7
hooks: hooks:
- id: ruff-check - id: ruff-check
exclude: ".githooks/" exclude: ".githooks/"
- id: ruff-format - id: ruff-format
- id: ruff-check
args: [--select, I, --fix]
- repo: https://github.com/codespell-project/codespell - repo: https://github.com/codespell-project/codespell
rev: v2.4.1 rev: v2.4.1
+20 -27
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "gajim-plugins" name = "gajim-plugins"
requires-python = ">=3.11" requires-python = ">=3.12"
license = {text = "GPL-3.0-or-later"} license = {text = "GPL-3.0-or-later"}
version = "0.0.1" version = "0.0.1"
@@ -8,7 +8,6 @@ version = "0.0.1"
dev = [ dev = [
"codespell==2.4.1", "codespell==2.4.1",
"gajim@git+https://dev.gajim.org/gajim/gajim.git", "gajim@git+https://dev.gajim.org/gajim/gajim.git",
"isort==7.0.0",
"nbxmpp@git+https://dev.gajim.org/gajim/python-nbxmpp.git", "nbxmpp@git+https://dev.gajim.org/gajim/python-nbxmpp.git",
"pre-commit", "pre-commit",
"pygobject-stubs@git+https://github.com/pygobject/pygobject-stubs.git", "pygobject-stubs@git+https://github.com/pygobject/pygobject-stubs.git",
@@ -17,17 +16,12 @@ dev = [
"ruff==0.14.8", "ruff==0.14.8",
] ]
[tool.black]
line-length = 88
target-version = ["py310", "py311", "py312"]
required-version = "24.10.0"
[tool.codespell] [tool.codespell]
skip = "*__pycache__*,build,dist,test,./acronyms_expander/acronyms.py,.egg-info,.git,*.po,*.po~,*.pot,*.nsi,*.spec,*.svg" skip = "*__pycache__*,build,dist,test,./acronyms_expander/acronyms.py,.egg-info,.git,*.po,*.po~,*.pot,*.nsi,*.spec,*.svg"
ignore-words-list = "THIRDPARTY,Toi,fpr" ignore-words-list = "THIRDPARTY,Toi,fpr"
[tool.pyright] [tool.pyright]
pythonVersion = "3.10" pythonVersion = "3.12"
pythonPlatform = "All" pythonPlatform = "All"
typeCheckingMode = "strict" typeCheckingMode = "strict"
@@ -43,10 +37,9 @@ exclude = [
[tool.ruff] [tool.ruff]
line-length = 88 line-length = 88
target-version = "py310" target-version = "py312"
[tool.ruff.lint] [tool.ruff.lint]
select = [ select = [
"A", # flake8-builtins "A", # flake8-builtins
# "AIR", # Airflow # "AIR", # Airflow
@@ -72,7 +65,7 @@ select = [
# "FIX", # flake8-fixme # "FIX", # flake8-fixme
# "FLY", # flynt # "FLY", # flynt
"G", # flake8-logging-format "G", # flake8-logging-format
# "I", # isort "I", # isort
"ICN", # flake8-import-conventions "ICN", # flake8-import-conventions
# "INP", # flake8-no-pep420 # "INP", # flake8-no-pep420
"INT", # flake8-gettext "INT", # flake8-gettext
@@ -178,20 +171,20 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.mccabe] [tool.ruff.lint.mccabe]
max-complexity = 15 max-complexity = 15
[tool.isort] [tool.ruff.lint.isort]
profile = "black" case-sensitive = false
force_alphabetical_sort_within_sections = true order-by-type = false
force_single_line = true force-single-line = true
group_by_package = true section-order = [
known_typing = ["typing"] "future",
known_gajim = ["gajim"] "typing",
sections = [ "standard-library",
"FUTURE", "third-party",
"TYPING", "gajim",
"STDLIB", "first-party",
"THIRDPARTY", "local-folder"
"GAJIM",
"FIRSTPARTY",
"LOCALFOLDER"
] ]
skip_gitignore = true
[tool.ruff.lint.isort.sections]
gajim = ["gajim"]
typing = ["_typeshed", "typing", "typing_extensions"]