28 lines
1.1 KiB
Makefile
28 lines
1.1 KiB
Makefile
# Run the full test suite
|
|
test *args:
|
|
pipenv run pytest -q {{args}}
|
|
|
|
# Auto-fix imports and formatting (autoflake, isort, black)
|
|
fmt:
|
|
pipenv run autoflake --recursive --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports --in-place new_python tests conftest.py
|
|
pipenv run isort new_python tests conftest.py
|
|
pipenv run black new_python tests conftest.py
|
|
|
|
# Verify imports and formatting without modifying files
|
|
fmt-check:
|
|
pipenv run autoflake --recursive --check --remove-all-unused-imports --remove-unused-variables --ignore-init-module-imports new_python tests conftest.py
|
|
pipenv run isort --check-only --diff new_python tests conftest.py
|
|
pipenv run black --check --diff new_python tests conftest.py
|
|
|
|
# Lint package and tests (python -m so the repo root lands on sys.path)
|
|
lint:
|
|
pipenv run python -m pylint new_python tests conftest.py
|
|
|
|
# Install the versioned pre-commit hook into .git/hooks
|
|
install-hooks:
|
|
cp hooks/pre-commit .git/hooks/pre-commit
|
|
chmod +x .git/hooks/pre-commit
|
|
|
|
# All quality checks; must be green before staging (see AGENTS.md)
|
|
ci: fmt-check lint test
|