Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shellcheck config not used #486

Open
altendky opened this issue Dec 3, 2024 · 2 comments
Open

shellcheck config not used #486

altendky opened this issue Dec 3, 2024 · 2 comments

Comments

@altendky
Copy link

altendky commented Dec 3, 2024

When actionlint is extracting a run: string from a workflow file the shellcheck config is not respected. I'm guessing that either the string is piped directly into shellcheck or located in a tmp directory outside of the project structure. Normally I would consider this good but since shellcheck (afaik) looks for the config based on the location of the script being analyzed, this could be making it not find the project config.

@rhysd
Copy link
Owner

rhysd commented Dec 19, 2024

Yes. The config file is intentionally not referred (--norc option passed to shellcheck). Instead you can use SHELLCHECK_OPT to pass options to shellcheck process.

https://github.com/rhysd/actionlint/blob/main/docs/checks.md#check-shellcheck-integ

@altendky
Copy link
Author

I am interested in using the same config for all shell scripts, inside a workflow or as a standalone file. Certainly, in some cases different configurations would be wanted, but defaulting to the same seems useful.

As far as any potential implementation, I could imagine an argument that shellcheck should first grow a feature like --search-for-rc-from and you can pass a file or directory to use for the config search instead of the file passed for checking. I don't know if they would argue against this or not.

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

No branches or pull requests

2 participants