Štěpán Balážik
6e91738efe
Replace deprecated typing imports
...
More specific modules (like collections.abc) can now be used.
Generated with: ruff check --extend-select UP035 --fix
(cherry picked from commit ced002c4ab )
2026-02-25 13:33:46 +01:00
Štěpán Balážik
c04b9251aa
Clean up imports of dnspython modules
...
Add a pylint plugin that enforces:
- There is no bare `import dns` statement.
- All `dns.<module>` used are explicitly imported.
- There are no unused `dns.<module>` imports.
Fix all the imports to conform with this check.
(cherry picked from commit d3186c7038 )
2026-02-25 13:33:25 +01:00
Štěpán Balážik
17cf986396
Replace Optional[T] with T | None
...
Generated with: ruff check --extend-select UP045 --fix && black .
(cherry picked from commit fe38515ad0 )
2026-02-25 13:33:25 +01:00
Štěpán Balážik
89ce3b5e74
Remove the rest of Union usages by hand
...
These require some manual changes.
(cherry picked from commit cdb7428431 )
2026-02-25 13:33:25 +01:00
Štěpán Balážik
a7ef013f6d
Built-in types are now subscriptable
...
Generated with: ruff check --extend-select UP006 --fix
(cherry picked from commit 790745da18 )
2026-02-25 13:33:25 +01:00
Štěpán Balážik
e5d5a6433c
Remove unused imports
...
Generated with: ruff check --extend-select F401 --fix
(cherry picked from commit b00f16f026 )
2026-02-25 13:33:25 +01:00
Štěpán Balážik
6e9e3b7208
Define __all__ in __init__.py files
...
Fix ruff's F401 unused-import errors in these files.
Also sort them with: ruff check --extend-select RUF022 --fix.
(cherry picked from commit 2b9c5ccd77 )
2026-02-25 13:33:25 +01:00
Štěpán Balážik
746ca1d481
Automatically sort imports in Python code
...
Generated with: ruff check --extend-select I --fix (with the changes to
pyproject.toml applied).
(cherry picked from commit ffd5b6ac26 )
2026-02-25 13:33:20 +01:00
Štěpán Balážik
a2cdf5d8cd
Lint code in doc directory
...
Adjust ignore lists of linters to check more code.
(cherry picked from commit 0fb7403ef4 )
2026-02-25 13:15:05 +01:00
Štěpán Balážik
68b9928f0f
Fix vulture warnings and tweak ignore lists
...
Run vulture on the whole repository, fix most errors in previously
unchecked code, adjust ignore lists.
(cherry picked from commit 57ecaee95d )
2026-02-25 13:15:05 +01:00
Štěpán Balážik
5e6399411a
Fix 'Too many return statements' pylint error
...
Refactor `Key.match_properties` into multiple functions.
(cherry picked from commit 19076c0d4d )
2026-02-25 13:15:05 +01:00
Štěpán Balážik
50f6dcdc75
Fix pylint's 'invalid-name' errors
...
Where possible comply with the naming rules. Add exceptions for the
function names used in KASP tests.
(cherry picked from commit 50ed74197c )
2026-02-25 13:15:05 +01:00
Štěpán Balážik
dd18071893
Reintroduce pylint checks that are not being violated
...
We might reintroduce them later if they become obnoxious.
(cherry picked from commit 115e64ea9e )
2026-02-25 13:15:05 +01:00
Štěpán Balážik
a8911683d7
Fix the rest of 'Formatting a regular string which could be an f-string'
...
Some fixes have to be done manually.
(cherry picked from commit a384283497 )
2026-02-25 13:15:05 +01:00
Štěpán Balážik
ce66d794fc
Add a small config for the ruff tool
...
It will be used for automated refactors of Python code.
(cherry picked from commit b7000ba9b0 )
2026-02-25 13:15:05 +01:00
Štěpán Balážik
c5c7790aa8
Centralize Python tooling configuration in pyproject.toml
...
This allows easy running of the tools from the project root both in CI
and locally.
(cherry picked from commit 601fc1f1cf )
2026-02-25 13:15:05 +01:00