From fbb5e964ad0dd80ae49ee627724e7c8256c35893 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 25 Jun 2026 10:33:01 +0200 Subject: [PATCH 1/2] fix: make prek ignore .j2 files when running the shellcheck hook --- template/.pre-commit-config.yaml.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/template/.pre-commit-config.yaml.j2 b/template/.pre-commit-config.yaml.j2 index 259bae3d..5ab2c2fb 100644 --- a/template/.pre-commit-config.yaml.j2 +++ b/template/.pre-commit-config.yaml.j2 @@ -38,6 +38,9 @@ repos: hooks: - id: shellcheck args: ["--severity=info"] + # Needed to make prek ignore .j2 files when running this hook. + # pre-commit does this by default. + exclude: \.j2$ # WARNING (@NickLarsenNZ): Nix users need to install ruff first. # If you do not, you will need to delete the cached ruff binary shown in the From 4216c36f5efc5a1f7235ac0f4cde86aa356d8ea9 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Thu, 25 Jun 2026 10:59:21 +0200 Subject: [PATCH 2/2] better change --- template/.pre-commit-config.yaml.j2 | 5 +++-- template/scripts/docs_templating.sh | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/template/.pre-commit-config.yaml.j2 b/template/.pre-commit-config.yaml.j2 index 5ab2c2fb..f393cd03 100644 --- a/template/.pre-commit-config.yaml.j2 +++ b/template/.pre-commit-config.yaml.j2 @@ -38,8 +38,9 @@ repos: hooks: - id: shellcheck args: ["--severity=info"] - # Needed to make prek ignore .j2 files when running this hook. - # pre-commit does this by default. + # Temporarily needed until all getting_started.sh.j2 scripts are made non-executable. + # As long as they are, prek will treat them as shell scripts and so this hook will fail. + # pre-commit behaves differently apparently and doesn't pass .j2 files to this hook. exclude: \.j2$ # WARNING (@NickLarsenNZ): Nix users need to install ruff first. diff --git a/template/scripts/docs_templating.sh b/template/scripts/docs_templating.sh index e4b945da..8468a971 100755 --- a/template/scripts/docs_templating.sh +++ b/template/scripts/docs_templating.sh @@ -38,4 +38,7 @@ do jinja2 "$file" "$templating_vars_file" -o "$new_file_name" done +# Ensure this script is executable +chmod +x docs/modules/opensearch/examples/getting_started/getting_started.sh + echo "done"