You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Leverage shfmt as the standard formatter for shell scripts in this repo.
- add `.editorconfig` with formatting rules and apply shfmt in
.ci/check-format.sh.
- update CONTRIBUTING.md with usage instructions (all contributors
should use it to ensure consistent shell script style).
The early exit behavior (set -e) in .ci/check-format.sh has been removed
to allow collecting all formatting mismatches in a single run. The
script’s exit code is now the sum of the line-level mismatch count from
clang-format-18 and the file-level mismatch count from shfmt, which
should be 0 if all files are properly formatted.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,10 +44,12 @@ However, participation requires adherence to fundamental ground rules:
44
44
This variant should be considered the standard for all documentation efforts.
45
45
For instance, opt for "initialize" over "initialise" and "color" rather than "colour".
46
46
47
-
Software requirement: [clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 18 or later.
47
+
Software requirement:
48
+
*[clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 18 or later.
49
+
*[shfmt](https://github.com/mvdan/sh).
48
50
49
-
This repository consistently contains an up-to-date `.clang-format` file with rules that match the explained ones.
50
-
For maintaining a uniform coding style, execute the command `clang-format -i *.{c,h}`.
51
+
This repository consistently contains an up-to-date `.clang-format` file with rules that match the explained ones and uses shell script formatting supported by `shfmt`.
52
+
For maintaining a uniform coding style, execute the command `clang-format -i *.{c,h}` and `shfmt -w $(find . -type f -name "*.sh")`.
0 commit comments