Skip to content

Commit 11dcce3

Browse files
committed
Enable autofix in pre-commit hooks when possible
1 parent c8770ab commit 11dcce3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

base.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ pre-commit:
1717
prettier:
1818
tags: style glue
1919
glob: "*.{json,md,yaml,yml}"
20-
run: prettier --check {staged_files}
20+
stage_fixed: true
21+
run: prettier --write {staged_files}
2122
shellcheck:
2223
tags: lint shell
2324
glob: "*.{bash,sh}"
2425
run: shellcheck {staged_files}
2526
shfmt:
2627
tags: style shell
2728
glob: "*.{bash,sh}"
28-
run: shfmt -d {staged_files}
29+
stage_fixed: true
30+
run: shfmt -w {staged_files}
2931
yamllint:
3032
tags: lint yaml
3133
glob: "*.{yaml,yml}"

terraform.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ pre-commit:
77
terraform-fmt:
88
tags: style terraform
99
glob: "*.{tf,tfvars}"
10-
run: terraform fmt -check -diff {staged_files}
10+
stage_fixed: true
11+
run: terraform fmt -write {staged_files}
1112
tflint:
1213
tags: lint terraform
1314
glob: "*.{tf,tfvars}"
15+
stage_fixed: true
1416
run: |
15-
for file in {staged_files}; do tflint --recursive --filter=$(basename "$file"); done
17+
for file in {staged_files}; do tflint --fix --recursive --filter=$(basename "$file"); done

0 commit comments

Comments
 (0)