diff --git a/justfile b/justfile index 00dde3c..314d9fc 100644 --- a/justfile +++ b/justfile @@ -2,7 +2,7 @@ just --list --unsorted # Run all build-related recipes in the justfile -run-all: install-deps format-python check-python check-spelling check-commits test +run-all: check-spelling check-commits test # Install the pre-commit hooks install-precommit: @@ -13,34 +13,21 @@ install-precommit: # Update versions of pre-commit hooks uvx pre-commit autoupdate -# Install Python package dependencies -install-deps: - uv sync --upgrade --dev --all-extras - -# Check Python code with the linter for any errors that need manual attention -check-python: - uv run ruff check . - -# Reformat Python code to match coding style and general structure -format-python: - uv run ruff check --fix . - uv run ruff format . - -# Run checks on commits with non-main branches +# Check the commit messages on the current branch that are not on the main branch check-commits: #!/bin/zsh branch_name=$(git rev-parse --abbrev-ref HEAD) - number_of_commits=$(git rev-list --count HEAD ^$branch_name) + number_of_commits=$(git rev-list --count HEAD ^main) if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]] then - uv run cz check --rev-range main..HEAD + uvx --from commitizen cz check --rev-range main..HEAD else - echo "Not on main or haven't committed yet." + echo "On `main` or current branch doesn't have any commits." fi # Check for spelling errors in files check-spelling: - uv run typos + uvx typos test: #!/bin/zsh