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
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}`.
52
+
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`.
53
+
For maintaining a uniform coding style, execute the command `clang-format -i *.{c,h}` and `shfmt -w $(find . -type f -name "*.sh")`.
54
+
55
+
## Coding Style for Shell Script
56
+
57
+
Shell scripts must be clean, consistent, and portable. The following `shfmt` rules(check `.editorconfig` file) are enforced project-wide:
58
+
* Use spaces for indentation.
59
+
* Indent with 4 spaces.
60
+
* Use Unix-style line endings (LF).
61
+
* Remove trailing whitespace at the end of lines.
62
+
* Ensure the file ends with a newline.
63
+
* Place the opening brace of a function on the next line.
64
+
* Indent `case` statements within `switch` blocks.
65
+
* Add spaces around redirection operators (e.g., `>`, `>>`).
66
+
* Place binary operators (e.g., `&&`, `|`) on the next line when breaking lines.
0 commit comments