diff options
| author | 2026-05-13 13:43:32 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:32 +0100 | |
| commit | 7122e2fced4ed8879442c08b9e97752c4b250f7c (patch) | |
| tree | 0113afb656e4164960e9f61ff233a86a1938c733 /justfile | |
| parent | b8dece21038c2a93b3c1a340164c79a74099e567 (diff) | |
| download | dotfiles-7122e2fced4ed8879442c08b9e97752c4b250f7c.tar.gz dotfiles-7122e2fced4ed8879442c08b9e97752c4b250f7c.tar.bz2 dotfiles-7122e2fced4ed8879442c08b9e97752c4b250f7c.zip | |
chore(python): add basedpyright type-checking
ruff (format + check) was already wired into fmt/check-fmt/lint. Add basedpyright as the type-checker for python so 'just lint' covers correctness too. Pyright config sets standard mode (lenient enough to not flood on stdlib edges) and excludes ipython_config.py whose 'c' is injected by IPython at config load time.
Diffstat (limited to 'justfile')
| -rw-r--r-- | justfile | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -211,6 +211,7 @@ lint *target: _lint_sh() { _need shellcheck shellcheck; shellcheck "$@"; } _lint_zsh() { _need shellcheck shellcheck; shellcheck --shell=bash "$@"; } _lint_py() { _need ruff ruff; ruff check "$@"; } + _lint_pytype() { _need basedpyright basedpyright; basedpyright "$@"; } _lint_toml() { _need taplo taplo-cli; taplo lint "$@"; } target='{{ target }}' @@ -228,6 +229,7 @@ lint *target: mapfile -t files < <(_find_by_ext py) [ ${#files[@]} -gt 0 ] && { _lint_py "${files[@]}" || rc=$?; } + [ ${#files[@]} -gt 0 ] && { _lint_pytype "${files[@]}" || rc=$?; } mapfile -t files < <(_find_by_ext toml) [ ${#files[@]} -gt 0 ] && { _lint_toml "${files[@]}" || rc=$?; } @@ -244,7 +246,7 @@ lint *target: case "$target" in *.lua) _lint_lua "$target" ;; *.sh) _lint_sh "$target" ;; - *.py) _lint_py "$target" ;; + *.py) _lint_py "$target"; _lint_pytype "$target" ;; *.toml) _lint_toml "$target" ;; *.md|*.json|*.jsonc|*.yaml|*.yml|*.css) echo "skip: $target (no linter; use check-fmt)" >&2; exit 0 ;; *) @@ -264,7 +266,7 @@ lint *target: doctor: #!/usr/bin/env bash rc=0 - for tool in stylua selene shfmt shellcheck ruff taplo prettier just; do + for tool in stylua selene shfmt shellcheck ruff basedpyright taplo prettier just; do if command -v "$tool" >/dev/null 2>&1; then printf ' ✓ %s (%s)\n' "$tool" "$(command -v "$tool")" else |
