diff --git a/.github/renovate.json5 b/.github/renovate.json5 index c031ee570c..a7261fdcfe 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -3,9 +3,12 @@ extends: ["config:base"], labels: ["dependencies"], // For convenient searching in GitHub pip_requirements: { - fileMatch: ["pyproject.toml", "tox.ini"] + fileMatch: ["^tox.ini$"] }, - packageRules: [ + pip_setup: { + fileMatch: ["^pyproject.toml$", "(^|/)setup\\.py$"] + }, + packageRules: [ { // Automerge patches, pin changes and digest changes. // Also groups these changes together. @@ -23,6 +26,7 @@ }, { // GitHub Actions are higher priority to update than most dependencies. + groupName: "GitHub Actions", matchManagers: ["github-actions"], prPriority: 1 }, @@ -52,8 +56,9 @@ { // tox.ini can get updates too if we specify for each package. fileMatch: ["tox.ini"], + depTypeTemplate: "devDependencies", matchStrings: [ - "# renovate: datasource=(?\\S+)\n\\s+(?.*?)[=><]=?(?.*?)\\n", + "# renovate: datasource=(?\S+)\n\s+(?.*?)(\[[\w]*\])*[=><]=?(?.*?)\n" ] } ], diff --git a/pyproject.toml b/pyproject.toml index 2934a67e7a..31b4370c93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,6 +72,30 @@ pythonPlatform = "Linux" venvPath = ".tox" venv = "py38" +[tool.mypy] +python_version = "3.8" +packages = ["starcraft"] +exclude = [ + "build" +] +warn_unused_configs = true +warn_redundant_casts = true +strict_equality = true +strict_concatenate = true +warn_return_any = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +[[tool.mypy.overrides]] +module = ["starcraft"] +disallow_untyped_defs = true +no_implicit_optional = true + +[[tool.mypy.overrides]] +module = ["tests.*"] +strict = false + [tool.ruff] line-length = 88 target-version = "py38" diff --git a/tox.ini b/tox.ini index cf7149ed52..c7381e8f32 100644 --- a/tox.ini +++ b/tox.ini @@ -59,6 +59,8 @@ deps = ruff>=0.0.226 # renovate: datasource=pypi codespell[tomli]>=2.2.2 + # renovate: datasource=pypi + mypy[reports]>=0.991 env_dir = {work_dir}/linting runner = ignore_env_name_mismatch @@ -66,14 +68,16 @@ runner = ignore_env_name_mismatch find = find {tox_root} \( -name .git -o -name .tox \) -prune -o -print filter = file --mime-type -Nnf- | grep shellscript | cut -f1 -d: -[testenv:lint-{black,ruff,pyright,shellcheck,codespell}] +[testenv:lint-{black,ruff,pyright,shellcheck,codespell,mypy}] description = Lint the source code base = testenv, lint labels = lint allowlist_externals = pyright: pyright shellcheck: bash, xargs + mypy: mkdir commands_pre = + mypy: mkdir -p .mypy_cache shellcheck: bash -c '{[shellcheck]find} | {[shellcheck]filter} > {env_tmp_dir}/shellcheck_files' commands = black: black --check --diff {tty:--color} {posargs} . @@ -81,6 +85,7 @@ commands = pyright: pyright --lib {posargs} shellcheck: xargs -ra {env_tmp_dir}/shellcheck_files shellcheck codespell: codespell --toml {tox_root}/pyproject.toml {posargs} + mypy: mypy --install-types --non-interactive . [testenv:format-{black,ruff,codespell}] description = Automatically format source code