Add auto-formatting script and shellcheck static analysis with workflows.#293
Add auto-formatting script and shellcheck static analysis with workflows.#293ZeroEcks wants to merge 5 commits intomylinuxforwork:mainfrom
Conversation
|
I can also revert the I also did not mention, I recommend using a shellcheck editor extension as it can help avoid a lot of issues, even if you don't adopt it as part of the CI or anything.
|
|
@ZeroEcks Thank you so much for highlighting this topic up. It is super interesting and valuable for the whole project. Is it OK to keep you posted about my learning progress and not merging it right now? |
|
Totally fine! the shellcheck wiki can be good for learning about the common mistakes in shell scripts. Feel free to email me any questions. |
|
@ZeroEcks Thank you so much for your help. |
Hi, as we briefly discussed in #289, I think that it could be beneficial to the repository to have two things
rm -rf "$STEAMROOT/"*which would delete/*in the event of an undefined variable). IMO ShellCheck is essential for all shell scripts as it can really save you from a footgun.shfmt. This adds the ability to quickly auto format all the shell files in the repository to follow a common standard. This would be helpful for me particularly, as I would be able to ensure I don't have minor whitespace differences between my fork and upstream.I have included two things
./fmt.shwhich provides some simple utilities for formatting, checking and auto applicationTwo Github Actions workflows
Please note, there is still a bunch of shellcheck issues I did not autofix, mostly because I would like to know if these are welcome changes before I spend time resolving them :)