Add repo config and python project template
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
# Run the full test suite
|
||||
test:
|
||||
pipenv run pytest
|
||||
|
||||
# Auto-fix imports and formatting (autoflake, isort, black)
|
||||
fmt:
|
||||
pipenv run autoflake --recursive --remove-all-unused-imports --remove-unused-variables --in-place {{PKG}} tests conftest.py
|
||||
pipenv run isort {{PKG}} tests conftest.py
|
||||
pipenv run black {{PKG}} tests conftest.py
|
||||
|
||||
# Verify imports and formatting without modifying files
|
||||
fmt-check:
|
||||
pipenv run autoflake --recursive --check --remove-all-unused-imports --remove-unused-variables {{PKG}} tests conftest.py
|
||||
pipenv run isort --check-only --diff {{PKG}} tests conftest.py
|
||||
pipenv run black --check --diff {{PKG}} tests conftest.py
|
||||
|
||||
# Lint package and tests (python -m so the repo root lands on sys.path)
|
||||
lint:
|
||||
pipenv run python -m pylint {{PKG}} 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
|
||||
Reference in New Issue
Block a user