pre-commit: add hook to remove empty directories

Automatically finds and removes empty directories (excluding .git)
during pre-commit runs to keep the repo clean.
This commit is contained in:
Krzysztof kuhy Rudnicki 2025-12-04 20:37:16 +01:00
parent df38784035
commit d72209a77c

View File

@ -269,6 +269,18 @@ repos:
- id: shellcheck
args: [--severity=warning]
# ===========================================================================
# REMOVE EMPTY DIRECTORIES - Clean up empty folders in the repo
# ===========================================================================
- repo: local
hooks:
- id: remove-empty-dirs
name: remove empty directories
entry: find . -type d -empty -not -path './.git/*' -delete -print
language: system
pass_filenames: false
always_run: true
# ===========================================================================
# COMMITIZEN - Conventional commits (optional)
# ===========================================================================