Skip to content

Commit

Permalink
Check if lefthook works
Browse files Browse the repository at this point in the history
  • Loading branch information
khleomix committed Aug 9, 2023
1 parent 4480c7a commit 96cec56
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 26 deletions.
14 changes: 11 additions & 3 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
9 changes: 1 addition & 8 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<!-- wp:template-part {"slug":"header","theme":"wd_f"} /-->

<!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"0"},"padding":{"top":"var:preset|spacing|70","bottom":"var:preset|spacing|70"}}},"layout":{"type":"constrained"}} -->
<main
class="wp-block-group"
style="
margin-top: 0;
padding-top: var( --wp--preset--spacing--70 );
padding-bottom: var( --wp--preset--spacing--70 );
"
>
<main class="wp-block-group" style="margin-top:0;padding-top:var(--wp--preset--spacing--70);padding-bottom:var(--wp--preset--spacing--70);">
<!-- wp:pattern {"slug":"wds/query", "layout":"constrained"} /-->
</main>
<!-- /wp:group -->
Expand Down
8 changes: 1 addition & 7 deletions templates/no-title.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
<!-- wp:template-part {"slug":"header","theme":"wd_f","tagName":"header","className":"site-header"} /-->

<!-- wp:group {"tagName":"main","style":{"spacing":{"padding":{"top":"var:preset|spacing|70","bottom":"var:preset|spacing|70"}}}} -->
<main
class="wp-block-group"
style="
padding-top: var( --wp--preset--spacing--70 );
padding-bottom: var( --wp--preset--spacing--70 );
"
>
<main class="wp-block-group" style="padding-top:var(--wp--preset--spacing--70);padding-bottom:var(--wp--preset--spacing--70);">
<!-- wp:post-content {"layout":{"type":"constrained"}} /-->
</main>
<!-- /wp:group -->
Expand Down
9 changes: 1 addition & 8 deletions templates/page.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<!-- wp:template-part {"slug":"header","theme":"wd_f","tagName":"header","className":"site-header"} /-->

<!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"0"},"padding":{"top":"var:preset|spacing|70","bottom":"var:preset|spacing|70"}}}} -->
<main
class="wp-block-group"
style="
margin-top: 0;
padding-top: var( --wp--preset--spacing--70 );
padding-bottom: var( --wp--preset--spacing--70 );
"
>
<main class="wp-block-group" style="margin-top:0;padding-top:var(--wp--preset--spacing--70);padding-bottom:var(--wp--preset--spacing--70);">
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:post-title {"level":1} /--></div>
<!-- /wp:group -->
Expand Down

0 comments on commit 96cec56

Please sign in to comment.