Add ShellCheck linter
to properly handle and lint shell scripts in IntelOwl https://github.com/koalaman/shellcheck
Hey @mlodic,
I'd like to work on this issue. After researching how to integrate ShellCheck with IntelOwl, I found that ShellCheck has some limitations—specifically, it does not automatically scan nested directories and only runs on shell scripts in the root directory.
To address this, one approach is to use the following command to recursively find and lint all shell scripts:
find . -type f -name "*.sh" -exec shellcheck {} +
Alternatively, we could implement a wrapper around ShellCheck to enhance its functionality. I came across this Medium article which explores a convenient way to run ShellCheck in GitHub Actions. It might provide useful insights for our implementation.
Looking forward to your thoughts!
Yep, you can try to integrate it! I would go with the "medium" article approach because it would allow to select folders and exclusions. In this way, we can select only the folders where the shell scripts are so we don't have to run that find command which can be computationally onerous
I assign you but remember that you still have to finish the other task! I appreciated your proactive approach!
Thank you! Also, how should I handle the errors that ShellCheck shows in already-written scripts (there are a lot of them)?
ideally fixing that because otherwise it makes no sense to integrate it :P That's the longest part
This issue has been marked as stale because it has had no activity for 10 days. If you are still working on this, please provide some updates.