mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 16:23:04 +02:00
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:
parent
df38784035
commit
d72209a77c
@ -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)
|
||||
# ===========================================================================
|
||||
|
||||
Loading…
Reference in New Issue
Block a user