diff --git a/common.mk b/common.mk index 2af6199..7434b38 100644 --- a/common.mk +++ b/common.mk @@ -84,19 +84,40 @@ format-codespell: ##- Fix spelling issues with codespell .PHONY: lint-ruff lint-ruff: install-ruff ##- Lint with ruff +ifneq ($(CI),) + @echo ::group::$@ +endif ruff check $(SOURCES) ruff format --diff $(SOURCES) +ifneq ($(CI),) + @echo ::endgroup:: +endif .PHONY: lint-codespell lint-codespell: ##- Check spelling with codespell +ifneq ($(CI),) + @echo ::group::$@ +endif uv run codespell --toml pyproject.toml $(SOURCES) +ifneq ($(CI),) + @echo ::endgroup:: +endif .PHONY: lint-mypy lint-mypy: ##- Check types with mypy +ifneq ($(CI),) + @echo ::group::$@ +endif uv run mypy --show-traceback --show-error-codes $(PROJECT) +ifneq ($(CI),) + @echo ::endgroup:: +endif .PHONY: lint-pyright lint-pyright: ##- Check types with pyright +ifneq ($(CI),) + @echo ::group::$@ +endif ifneq ($(shell which pyright),) # Prefer the system pyright pyright --pythonpath .venv/bin/python else @@ -104,22 +125,46 @@ else [ -d "/home/ubuntu/.npm/_cacache" ] && chown -R 1000:1000 "/home/ubuntu/.npm" || true uv run pyright --pythonpath .venv/bin/python endif +ifneq ($(CI),) + @echo ::endgroup:: +endif .PHONY: lint-shellcheck lint-shellcheck: ##- Lint shell scripts +ifneq ($(CI),) + @echo ::group::$@ +endif git ls-files | file --mime-type -Nnf- | grep shellscript | cut -f1 -d: | xargs -r shellcheck +ifneq ($(CI),) + @echo ::endgroup:: +endif .PHONY: lint-yaml lint-yaml: ##- Lint YAML files with yamllint +ifneq ($(CI),) + @echo ::group::$@ +endif uv run --extra lint yamllint . +ifneq ($(CI),) + @echo ::endgroup:: +endif .PHONY: lint-docs lint-docs: ##- Lint the documentation +ifneq ($(CI),) + @echo ::group::$@ +endif uv run --extra docs sphinx-lint --max-line-length 88 --enable all $(DOCS) +ifneq ($(CI),) + @echo ::endgroup:: +endif .PHONY: lint-twine lint-twine: dist/* ##- Lint Python packages with twine uv tool run twine check dist/* +ifneq ($(CI),) + @echo ::endgroup:: +endif .PHONY: test test: ## Run all tests