Skip to content

feat(shellcheck): add SC_SKIP_JINJA option to skip Jinja2 templates#225

Merged
sfowl merged 1 commit into
mainfrom
shellcheck-skip-jinja
May 28, 2026
Merged

feat(shellcheck): add SC_SKIP_JINJA option to skip Jinja2 templates#225
sfowl merged 1 commit into
mainfrom
shellcheck-skip-jinja

Conversation

@sfowl
Copy link
Copy Markdown
Contributor

@sfowl sfowl commented May 27, 2026

ShellCheck cannot parse Jinja2 template syntax ({{ }}, {% %}, {# #}). Any file containing these constructs breaks the parser entirely, producing unreliable findings (SC1054, SC1073, SC1083). Setting SC_SKIP_JINJA=1 causes filter_shell_scripts() to exclude these files before they reach shellcheck. Disabled by default so existing behavior is unchanged.

Tested against https://github.com/openshift/cac-content-fork where findings dropped from 11,776 to 43 (99.6% noise reduction).

Resolves: PSSECAUT-1577

@sfowl sfowl requested a review from kdudka May 27, 2026 06:48
Comment thread scripts/run-shellcheck.sh Fixed
Comment thread scripts/run-shellcheck.sh Outdated
ShellCheck cannot parse Jinja2 template syntax ({{ }}, {% %}, {# #}).
Any file containing these constructs breaks the parser entirely,
producing unreliable findings (SC1054, SC1073, SC1083). Setting
SC_SKIP_JINJA=1 causes filter_shell_scripts() to exclude these files
before they reach shellcheck. Disabled by default so existing behavior
is unchanged.

Tested against https://github.com/openshift/cac-content-fork where
findings dropped from 11,776 to 43 (99.6% noise reduction).

Resolves: PSSECAUT-1577
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sfowl sfowl force-pushed the shellcheck-skip-jinja branch from 39faaca to 1522f07 Compare May 27, 2026 10:35
Copy link
Copy Markdown
Member

@kdudka kdudka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@sfowl sfowl merged commit f3007a6 into main May 28, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants