22 just --list --unsorted
33
44# Run all build-related recipes in the justfile
5- run-all : install-deps format-python check-python check-unused test-python check-security check-spelling check-commits build-website
5+ run-all : check-spelling check-commits build-website
66
77# Install the pre-commit hooks
88install-precommit :
@@ -13,78 +13,22 @@ install-precommit:
1313 # Update versions of pre-commit hooks
1414 uvx pre-commit autoupdate
1515
16- # Install Python package dependencies
17- install-deps :
18- uv sync --all-extras --dev
19-
20- # Run the Python tests
21- test-python :
22- uv run pytest
23- # Make the badge from the coverage report
24- uv run genbadge coverage \
25- - i coverage.xml \
26- - o htmlcov/ coverage.svg
27-
28- # Check Python code for any errors that need manual attention
29- check-python :
30- # Check formatting
31- uv run ruff check .
32- # Check types
33- uv run mypy .
34-
35- # Reformat Python code to match coding style and general structure
36- format-python :
37- uv run ruff check --fix .
38- uv run ruff format .
39-
40- # Build the documentation website using Quarto
41- build-website :
42- # To let Quarto know where python is.
43- export QUARTO_PYTHON=.venv/ bin/ python3
44- # Delete any previously built files from quartodoc.
45- # -f is to not give an error if the files don't exist yet.
46- rm -f docs/ reference/ *.qmd
47- uv run quartodoc build
48- uv run quarto render --execute
49-
50- # Run checks on commits with non-main branches
16+ # Check the commit messages on the current branch that are not on the main branch
5117check-commits :
5218 #!/ bin/ zsh
5319 branch_name=$(git rev-parse --abbrev-ref HEAD)
5420 number_of_commits=$(git rev-list --count HEAD ^main)
5521 if [[ ${branch_name} != " main" && ${number_of_commits} -gt 0 ]]
5622 then
57- uv run cz check --rev-range main..HEAD
23+ uvx --from commitizen cz check --rev-range main..HEAD
5824 else
59- echo " Can't either be on ${branch_name} or have more than ${number_of_commits} ."
25+ echo " On `main` or current branch doesn't have any commits ."
6026 fi
6127
62- # Run basic security checks on the package
63- check-security :
64- uv run bandit -r src/
65-
6628# Check for spelling errors in files
6729check-spelling :
68- uv run typos
30+ uvx typos
6931
70- # Build the documentation as PDF using Quarto
71- build-pdf :
72- # To let Quarto know where python is.
73- export QUARTO_PYTHON=.venv/ bin/ python3
74- uv run quarto install tinytex
75- # For generating images from Mermaid diagrams
76- uv run quarto install chromium
77- uv run quarto render --profile pdf --to pdf
78- find docs -name " mermaid-figure-*.png" -delete
79-
80- # Check for unused code in the package and its tests
81- check-unused :
82- # exit code=0: No unused code was found
83- # exit code=3: Unused code was found
84- # Three confidence values:
85- # - 100 %: function/method/class argument, unreachable code
86- # - 90 %: import
87- # - 60 %: attribute, class, function, method, property, variable
88- # There are some things should be ignored though, with the allowlist.
89- # Create an allowlist with `vulture --make-allowlist`
90- uv run vulture src/ tests/ **/ vulture-allowlist.py
32+ # Build the website using Quarto
33+ build-website :
34+ uvx --from quarto quarto render
0 commit comments