-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mypy as static type checker (#129)
* umu_consts: add XDG_DATA_HOME * umu_consts: fix type * umu_plugins: fix type * umu_plugins: fix types * umu_log: fix type * umu_util: fix types * umu_runtime: fix types * umu_proton: fix types * umu_run: fix types * Add pyproject.toml - Configuration file for mypy * workflows: add mypy workflow * Revert "umu_consts: add XDG_DATA_HOME" This reverts commit c5ceb71. * umu_consts: update FLATPAK_PATH - Flatpak guarantees the existence of XDG_DATA_HOME and other XDG environment variables * Ruff lint * workflows: update static.yml * umu_log: fix type * Update pyproject.toml * umu_run: update format * Fix module imports - Since we've already imported the os and sys modules in our entry point, no need to selectively import functions from them * umu_util: update format * umu_proton: don't initialize vars * umu_run: add fixme tag to runtime workaround * umu_runtime: move uninitialized var to top level scope * umu_runtime: remove return statement * umu_runtime: update string slicing logic * umu_runtime: fix string logic
- Loading branch information
Showing
9 changed files
with
186 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: mypy | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
version: ["3.10"] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.version }} | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
- name: Check types with mypy | ||
run: | | ||
pip install mypy | ||
cd umu && mypy . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[tool.mypy] | ||
python_version = "3.10" | ||
warn_return_any = true | ||
ignore_missing_imports = true | ||
|
||
disable_error_code = [ | ||
# Allow redefinitions since we redefine an error variable before raising exceptions | ||
"no-redef" | ||
] | ||
|
||
exclude = [ | ||
'^umu_test\.py$', | ||
'^umu_test_plugins\.py$', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.