From 96cec560f48195e0d7ec34f29eead76b142fada5 Mon Sep 17 00:00:00 2001 From: JC Date: Wed, 9 Aug 2023 23:52:14 +0800 Subject: [PATCH] Check if lefthook works --- lefthook.yml | 14 +++++++++++--- templates/index.html | 9 +-------- templates/no-title.html | 8 +------- templates/page.html | 9 +-------- 4 files changed, 14 insertions(+), 26 deletions(-) diff --git a/lefthook.yml b/lefthook.yml index b72d39a..98d7897 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -25,13 +25,21 @@ pre-commit: run: npx markdownlint-cli {staged_files} --fix other: glob: '*.{yml,json,html}' - exclude: 'group_*.json' - run: npx prettier {staged_files} --write + exclude: 'group_*.json' # Exclude specific files + run: | + staged_files="$LEFTHOOK_STAGED_FILES" + for file in $staged_files + do + if [[ ! "$file" =~ ^templates/ ]]; then + npx prettier "$file" --write + fi + done stage_fixed: true + stage: pre-commit merge-conflict: run: echo "Resolve merge conflicts before committing" exit-status: run: echo "All pre-commit checks passed" templates-exclude: - glob: 'templates/**/*.php' + glob: 'templates/**' # Match all files and subdirectories within templates folder run: echo "Skipping templates folder" diff --git a/templates/index.html b/templates/index.html index 08028bf..d2c0969 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,14 +1,7 @@ -
+
diff --git a/templates/no-title.html b/templates/no-title.html index 861d4f6..1e7ab43 100644 --- a/templates/no-title.html +++ b/templates/no-title.html @@ -1,13 +1,7 @@ -
+
diff --git a/templates/page.html b/templates/page.html index 602283e..eee92da 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,14 +1,7 @@ -
+