Skip to content

Commit

Permalink
Merge pull request #14 from lengau/pyright
Browse files Browse the repository at this point in the history
tools: Make typing use an editable install
  • Loading branch information
lengau authored Jan 26, 2023
2 parents 63fc646 + a59bb4d commit b715342
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,32 +56,45 @@ 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

[shellcheck]
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,mypy}]
[testenv:lint-{black,ruff,shellcheck,codespell}]
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} .
ruff: ruff --diff --respect-gitignore {posargs} .
pyright: pyright --lib {posargs}
shellcheck: xargs -ra {env_tmp_dir}/shellcheck_files shellcheck
codespell: codespell --toml {tox_root}/pyproject.toml {posargs}

[testenv:lint-{mypy,pyright}]
description = Static type checking
base = testenv
deps =
# renovate: datasource=pypi
mypy[reports]>=0.991
env_dir = {work_dir}/typing
runner = ignore_env_name_mismatch
package = editable
extras = [dev, types]
labels = lint, type
allowlist_externals =
pyright: pyright
mypy: mkdir
commands_pre =
mypy: mkdir -p .mypy_cache
commands =
pyright: pyright --lib {posargs}
mypy: mypy --install-types --non-interactive .

[testenv:format-{black,ruff,codespell}]
Expand Down

0 comments on commit b715342

Please sign in to comment.