diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd66db1..537666e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,14 +14,21 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.9.9 + rev: v0.11.8 hooks: # Run the linter. - id: ruff types_or: [ python, pyi ] args: [ --fix ] - repo: https://github.com/Riverside-Healthcare/djLint - rev: v1.32.0 + rev: v1.36.4 hooks: - id: djlint-reformat-django - id: djlint-django + - repo: local + hooks: + - id: check-untracked + name: "Check untracked and unignored files" + entry: ./scripts/check-untracked.sh + language: script + always_run: true diff --git a/scripts/check-untracked.sh b/scripts/check-untracked.sh new file mode 100755 index 0000000..4bf515c --- /dev/null +++ b/scripts/check-untracked.sh @@ -0,0 +1,9 @@ +#!/bin/bash +untracked=$(git ls-files --others --exclude-standard) + +if [ -n "$untracked" ]; then + echo "Error: The following files are untracked and not ignored:" + echo "$untracked" + echo "Please add them to Git or ignore them in .gitignore before committing." + exit 1 +fi