ClangBuiltLinux / continuous-integration

Continuous integration of latest Linux kernel with daily build of Clang & LLVM tools
https://travis-ci.com/ClangBuiltLinux/continuous-integration
Apache License 2.0
44 stars 18 forks source link

Reformat shell scripts with shfmt and validate in CI #267

Closed msfjarvis closed 4 years ago

msfjarvis commented 4 years ago

Uses mvdan/sh to enable formatting checks in CI, and correctly fails when the codestyle is incorrect, outputting a diff with fixes.

I chose the set of options that made the most sense to me, all available switches are listed here.

nathanchance commented 4 years ago

Yes, the README has installation instructions it seems (or I guess you could either apply the diff or do it manually but that seems like a lot of effort :P)

msfjarvis commented 4 years ago

neat, so looks like we'll need to grab the diff from the github action when the presubmit check fails? Is it possible to run shfmt locally to be proactive?

I personally install shfmt through Linuxbrew but it appears the maintainer also makes binaries available in the Releases tab.