Add lint_diff command (#2449)

It's helpful for developers to run the linter locally on just the
changed files.

This PR adds support for a `lint_diff` command.

Ruff is still run over the entire directory since it's very fast.
doc
William FH 1 year ago committed by GitHub
parent 3d871853df
commit c9ae0c5808
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -23,9 +23,13 @@ format:
poetry run black .
poetry run ruff --select I --fix .
lint:
poetry run mypy .
poetry run black . --check
PYTHON_FILES=.
lint: PYTHON_FILES=.
lint_diff: PYTHON_FILES=$(shell git diff --name-only --diff-filter=d master | grep -E '\.py$$')
lint lint_diff:
poetry run mypy $(PYTHON_FILES)
poetry run black $(PYTHON_FILES) --check
poetry run ruff .
test:

Loading…
Cancel
Save