actionlint icon indicating copy to clipboard operation
actionlint copied to clipboard

Enabling ShellCheck's optional rules

Open ericcornelissen opened this issue 2 years ago • 2 comments

I would like to have some of ShellCheck's optional rules enforced on GitHub Actions workflows.

However, ShellCheck is executed with the --norc option set, this seems to have been added in f5168ac1f445f754849efecd0e68eeaa8bc71dac with the explanation:

add --norc on running shellcheck process

since it should not be affected by external configuration

But, I'm interested in enabling some of ShellCheck's optional rules and the only scalable way of doing that I can think of is using the configuration file.

I can see why one wouldn't want to have the disable directives from the ShellCheck configuration file used by actionlint, but I think respecting the enable directives is sensible. What do you think?


The only other issue I could find that refers to the ShellCheck configuration file is #254, but that's for a different use case.

ericcornelissen avatar Jan 15 '23 12:01 ericcornelissen

I'd like to be able to configure ShellCheck rules (specifically ignore some of them) as used by actionlint. However at the same time I am using ShellCheck for other scripts in the same git repo and they already specify their own ignore rules.

Preferably we would be able to specify shellcheck config which is used only by actionlint and not by other shellcheck processes that may be running outside of actionlint.

atodorov avatar Mar 23 '23 14:03 atodorov

I'd like to be able to disable some shellcheck warning in my github scripts. Maybe a good solution would be add an option for actionlint that removes --norc from the arguments. Or maybe an option that would let me specify additional arguments for shellcheck - that way the external "side effect" configuration wouldn't take place.

syyyr avatar Apr 03 '23 20:04 syyyr

This is already possible by passing arguments to shellsheck via SHELLCHECK_OPTS environment variable.

SHELLCHECK_OPTS='-i CODE1,CODE2' actionlint

rhysd avatar Feb 21 '24 12:02 rhysd