Skip to content
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

fix: avoid skipping pre commit when deleted files staged #925

Conversation

mrexox
Copy link
Member

@mrexox mrexox commented Jan 13, 2025

Closes #919

🔧 Summary

For pre-commit we use git diff --diff-filter=ACMR and this avoids checking for deleted files. But sometimes user wants a pre-commit hook to run on any change to the files (even when deleting files). For that cases (when {staged_files} template is not used) we should not force skipping the command/job.

  • Implement special check for implicit pre-commit skip logic to also count deleted files
  • Add a test

@mrexox mrexox marked this pull request as ready for review January 13, 2025 11:34
@mrexox mrexox merged commit 59b9e4d into evilmartians:master Jan 13, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pre-commit is skipped when commit contains only deleted files
1 participant