Commit changes in the Saleor codebase with pre-commit hook error handling. Use when asked to "commit", "commit changes", "make a commit", or any git commit task in the Saleor project. Handles virtual env activation, staging, commit message writing, and automatic resolution of pre-commit hook failures (ruff, mypy, schema, migrations).
source .venv/bin/activate (look for .venv dir in project root)git status and git diff (staged + unstaged) to understand all changesgit add (specific files, not git add -A)git commitUse a HEREDOC for the message:
git commit -m "$(cat <<'EOF'
Short summary of changes
Detailed description of what was changed and why.
List specific modifications when multiple files are affected.
EOF
)"
The project runs these hooks: trailing-whitespace, end-of-file-fixer, ruff (lint + format), mypy, deptry, semgrep, uv-lock, migrations-check, gql-schema-check.
Ruff auto-fixes and auto-formats on commit. After a failure:
git add <files>Read the error output carefully. Fix the typing issues in the reported files. Stage and retry.
gql-schema-check)Regenerate the schema and stage it:
python manage.py get_graphql_schema > saleor/graphql/schema.graphql
git add saleor/graphql/schema.graphql
migrations-check)Create the missing migration:
python manage.py makemigrations
git add saleor/**/migrations/*.py
uv.lock file.