From 202ec8f91daa0b221e623e08f0a51aac649150ab Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Thu, 19 Dec 2024 10:51:08 -0500 Subject: [PATCH] fix(common.mk): get upstream setup-lint --- common.mk | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/common.mk b/common.mk index 4f5c9ef49..8eaafed22 100644 --- a/common.mk +++ b/common.mk @@ -49,7 +49,7 @@ setup-tests: install-uv install-build-deps ##- Set up a testing environment with uv sync --frozen $(SETUP_TESTS_EXTRA_ARGS) .PHONY: setup-lint -setup-lint: install-uv install-shellcheck ##- Set up a linting-only environment +setup-lint: install-uv install-shellcheck install-pyright install-lint-build-deps ##- Set up a linting-only environment uv sync --frozen --no-install-workspace --extra lint --extra types .PHONY: setup-docs @@ -234,6 +234,17 @@ else $(warning Codespell not installed. Please install it yourself.) endif +.PHONY: install-pyright +install-pyright: install-uv +ifneq ($(shell which pyright),) +else ifneq ($(shell which snap),) + sudo snap install --classic pyright +else + # Workaround for a bug in npm + [ -d "$(HOME)/.npm/_cacache" ] && chown -R `id -u`:`id -g` "$(HOME)/.npm" || true + uv tool install pyright +endif + .PHONY: install-ruff install-ruff: ifneq ($(shell which ruff),)