Skip to content

Commit 987c507

Browse files
authored
fix: make prek ignore .j2 files when running the shellcheck hook (#599)
* fix: make prek ignore .j2 files when running the shellcheck hook * better change
1 parent de90875 commit 987c507

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

template/.pre-commit-config.yaml.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ repos:
3838
hooks:
3939
- id: shellcheck
4040
args: ["--severity=info"]
41+
# Temporarily needed until all getting_started.sh.j2 scripts are made non-executable.
42+
# As long as they are, prek will treat them as shell scripts and so this hook will fail.
43+
# pre-commit behaves differently apparently and doesn't pass .j2 files to this hook.
44+
exclude: \.j2$
4145

4246
# WARNING (@NickLarsenNZ): Nix users need to install ruff first.
4347
# If you do not, you will need to delete the cached ruff binary shown in the

template/scripts/docs_templating.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,7 @@ do
3838
jinja2 "$file" "$templating_vars_file" -o "$new_file_name"
3939
done
4040

41+
# Ensure this script is executable
42+
chmod +x docs/modules/opensearch/examples/getting_started/getting_started.sh
43+
4144
echo "done"

0 commit comments

Comments
 (0)