-
Notifications
You must be signed in to change notification settings - Fork 1
IN-1676 - Update Makefile, pre-commit, linting, and dependency conventions #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d0455a4
03ea697
91ea2b2
73cdc54
9ab8ac9
b911605
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| linux/arm64 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| name: CI | ||
| permissions: read-all | ||
| on: | ||
| pull_request: | ||
| paths-ignore: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,28 @@ | ||
| default_language_version: | ||
| python: python3.12 | ||
| python: python3.13 | ||
| default_stages: | ||
| - pre-push | ||
| repos: | ||
| - repo: local | ||
| hooks: | ||
| - id: black-apply | ||
| name: black-apply | ||
| entry: uv run black | ||
| - id: ruff-format | ||
| name: ruff-format | ||
| entry: uv run ruff format --diff | ||
| language: system | ||
| pass_filenames: true | ||
| types: ["python"] | ||
| types: [ "python" ] | ||
|
|
||
| - id: mypy | ||
| name: mypy | ||
| entry: uv run mypy | ||
| language: system | ||
| pass_filenames: true | ||
| types: ["python"] | ||
| exclude: "tests/" | ||
| - id: ruff-apply | ||
| name: ruff-apply | ||
| entry: uv run ruff check --fix | ||
| types: [ "python" ] | ||
| exclude: "(tests/|output/|migrations/)" | ||
|
|
||
| - id: ruff-check | ||
| name: ruff-check | ||
| entry: uv run ruff check | ||
| language: system | ||
| pass_filenames: true | ||
| types: ["python"] | ||
| - id: pip-audit | ||
| name: pip-audit | ||
| entry: uv run pip-audit | ||
| language: system | ||
| pass_filenames: false | ||
| types: [ "python" ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 3.12 | ||
| 3.13 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,22 +6,26 @@ help: # Preview Makefile commands | |
| /^[-_[:alpha:]]+:.?*#/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST) | ||
|
|
||
| # ensure OS binaries aren't called if naming conflict with Make recipes | ||
| .PHONY: help venv install update test coveralls lint black mypy ruff safety lint-apply black-apply ruff-apply | ||
| .PHONY: help install venv update test coveralls lint lint-fix security my-app | ||
|
|
||
| ############################################## | ||
| # Python Environment and Dependency commands | ||
| ############################################## | ||
|
|
||
| install: .venv .git/hooks/pre-commit # Install Python dependencies and create virtual environment if not exists | ||
| install: .venv .git/hooks/pre-commit .git/hooks/pre-push # Install Python dependencies and create virtual environment if not exists | ||
| uv sync --dev | ||
|
|
||
| .venv: # Creates virtual environment if not found | ||
| @echo "Creating virtual environment at .venv..." | ||
| uv venv .venv | ||
|
|
||
| .git/hooks/pre-commit: # Sets up pre-commit hook if not setup | ||
| @echo "Installing pre-commit hooks..." | ||
| uv run pre-commit install | ||
| .git/hooks/pre-commit: # Sets up pre-commit commit hooks if not setup | ||
| @echo "Installing pre-commit commit hooks..." | ||
| uv run pre-commit install --hook-type pre-commit | ||
|
|
||
| .git/hooks/pre-push: # Sets up pre-commit push hooks if not setup | ||
| @echo "Installing pre-commit push hooks..." | ||
| uv run pre-commit install --hook-type pre-push | ||
|
Comment on lines
+15
to
+28
|
||
|
|
||
| venv: .venv # Create the Python virtual environment | ||
|
|
||
|
|
@@ -41,31 +45,21 @@ coveralls: test # Write coverage data to an LCOV report | |
| uv run coverage lcov -o ./coverage/lcov.info | ||
|
|
||
| #################################### | ||
| # Code quality and safety commands | ||
| # Code linting and formatting | ||
| #################################### | ||
|
|
||
| lint: black mypy ruff safety # Run linters | ||
|
|
||
| black: # Run 'black' linter and print a preview of suggested changes | ||
| uv run black --check --diff . | ||
|
|
||
| mypy: # Run 'mypy' linter | ||
| lint: # Run linting, alerts only, no code changes | ||
| uv run ruff format --diff | ||
| uv run mypy . | ||
|
|
||
| ruff: # Run 'ruff' linter and print a preview of errors | ||
| uv run ruff check . | ||
|
|
||
| safety: # Check for security vulnerabilities | ||
| uv run pip-audit | ||
|
|
||
| lint-apply: black-apply ruff-apply # Apply changes with 'black' and resolve 'fixable errors' with 'ruff' | ||
|
|
||
| black-apply: # Apply changes with 'black' | ||
| uv run black . | ||
|
|
||
| ruff-apply: # Resolve 'fixable errors' with 'ruff' | ||
| lint-fix: # Run linting, auto fix behaviors where supported | ||
| uv run ruff format . | ||
| uv run ruff check --fix . | ||
|
|
||
| security: # Run security / vulnerability checks | ||
ghukill marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| uv run pip-audit | ||
|
|
||
| ############################## | ||
| # CLI convenience commands | ||
| ############################## | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.