Skip to content

Commit 7947097

Browse files
committed
CI/Lint: Add pyright and isort to the project
1 parent 283c863 commit 7947097

File tree

4 files changed

+105
-2
lines changed

4 files changed

+105
-2
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ format: install-dev
6363

6464
lint: install-dev
6565
$(POETRY) run black --check --extend-exclude test-data/gardenlinux .
66+
$(POETRY) run isort --check-only --skip test-data/gardenlinux .
67+
$(POETRY) run pyright
6668

6769
security: install-dev
6870
@if [ "$(CI)" = "true" ]; then \

poetry.lock

Lines changed: 63 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ moto = "^5.1.10"
2727
python-dotenv = "^1.1.1"
2828
pytest = "^8.4.1"
2929
pytest-cov = "^6.2.1"
30+
isort = "^6.0.1"
31+
pyright = "^1.1.403"
3032

3133
[tool.poetry.group.docs.dependencies]
3234
sphinx-rtd-theme = "^3.0.2"
@@ -42,6 +44,17 @@ gl-s3 = "gardenlinux.s3.__main__:main"
4244
pythonpath = ["src"]
4345
norecursedirs = "test-data"
4446

47+
[tool.isort]
48+
profile = "black"
49+
line_length = 120
50+
known_first_party = ["gardenlinux"]
51+
52+
[tool.pyright]
53+
typeCheckingMode = "strict"
54+
venvPath = "."
55+
venv = ".venv"
56+
exclude = ["test-data", "docs", "hack", ".venv", ".pytest-cache", "**/__pycache"]
57+
4558
[build-system]
4659
requires = ["poetry-core"]
4760
build-backend = "poetry.core.masonry.api"

pyrightconfig.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// Pyright is configured in 'strict' mode in pyproject.toml
3+
// This file overrides some reports and tones them down to warnings, if they are not critical.
4+
// It also turns some up to become warnings or errors.
5+
"reportShadowedImports": "warning",
6+
"reportImportCycles": "error",
7+
"reportOptionalMemberAccess": "warning",
8+
"reportOptionalSubscript": "warning",
9+
"reportOptionalContextManager": "warning",
10+
"reportOptionalCall": "warning",
11+
"reportUnusedVariable": "warning",
12+
"reportUnusedImport": "warning",
13+
"reportUnusedFunction": "warning",
14+
"reportUnusedCallResult": "warning",
15+
"reportUnusedClass": "warning",
16+
"reportUnnecessaryCast": "warning",
17+
"reportUnnecessaryComparison": "warning",
18+
"reportUnnecessaryIsInstance": "warning",
19+
"reportUnnecessaryContains": "warning",
20+
// Becomes useful after introduction of type annotations
21+
// "reportUnknownMemberType": "warning",
22+
// "reportUnknownParameterType": "warning",
23+
// "reportUnknownArgumentType": "warning",
24+
// "reportUnknownVariableType": "warning",
25+
"reportTypedDictNotRequiredAccess": "error",
26+
"reportDeprecated": "warning",
27+
}

0 commit comments

Comments
 (0)