mirror of
https://github.com/systemd/systemd.git
synced 2025-03-02 12:58:35 +03:00
Merge pull request #34641 from behrmann/ukifystyle
Type annotate and format ukify
This commit is contained in:
commit
e318675398
23
.github/workflows/linter.yml
vendored
23
.github/workflows/linter.yml
vendored
@ -35,3 +35,26 @@ jobs:
|
||||
MULTI_STATUS: false
|
||||
VALIDATE_ALL_CODEBASE: false
|
||||
VALIDATE_GITHUB_ACTIONS: true
|
||||
|
||||
- name: Check that tabs are not used in Python code
|
||||
run: sh -c '! git grep -P "\\t" -- src/ukify/ukify.py'
|
||||
|
||||
- name: Install ruff and mypy
|
||||
run: |
|
||||
python3 -m pip install --break-system-packages --upgrade setuptools wheel pip
|
||||
python3 -m pip install --break-system-packages mypy types-Pillow ruff
|
||||
|
||||
- name: Run mypy
|
||||
run: |
|
||||
python3 -m mypy --version
|
||||
python3 -m mypy src/ukify/ukify.py
|
||||
|
||||
- name: Run ruff check
|
||||
run: |
|
||||
ruff --version
|
||||
ruff check src/ukify/ukify.py
|
||||
|
||||
- name: Run ruff format
|
||||
run: |
|
||||
ruff --version
|
||||
ruff format --check src/ukify/ukify.py
|
||||
|
21
src/ukify/mypy.ini
Normal file
21
src/ukify/mypy.ini
Normal file
@ -0,0 +1,21 @@
|
||||
[mypy]
|
||||
python_version = 3.9
|
||||
allow_redefinition = True
|
||||
# belonging to --strict
|
||||
warn_unused_configs = true
|
||||
disallow_untyped_calls = true
|
||||
disallow_untyped_defs = true
|
||||
disallow_untyped_decorators = true
|
||||
disallow_incomplete_defs = true
|
||||
check_untyped_defs = true
|
||||
no_implicit_optional = true
|
||||
warn_redundant_casts = true
|
||||
warn_unused_ignores = false
|
||||
warn_return_any = true
|
||||
no_implicit_reexport = true
|
||||
# extra options not in --strict
|
||||
pretty = true
|
||||
show_error_codes = true
|
||||
show_column_numbers = true
|
||||
warn_unreachable = true
|
||||
strict_equality = true
|
6
src/ukify/ruff.toml
Normal file
6
src/ukify/ruff.toml
Normal file
@ -0,0 +1,6 @@
|
||||
target-version = "py39"
|
||||
line-length = 109
|
||||
lint.select = ["E", "F", "I", "UP"]
|
||||
|
||||
[format]
|
||||
quote-style = "single"
|
1004
src/ukify/ukify.py
1004
src/ukify/ukify.py
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user