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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+23-7Lines changed: 23 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,16 +38,32 @@ However, participation requires adherence to fundamental ground rules:
38
38
* Code must strictly adhere to the established C coding style (refer to the guidelines below).
39
39
While there is some flexibility in basic style, it is crucial to stick to the current coding standards.
40
40
Complex algorithmic constructs without proper comments will not be accepted.
41
+
* Shell scripts must be formatted before submission. Use consistent flags across the project to ensure uniform formatting.
41
42
* External pull requests should include thorough documentation in the pull request comments for consideration.
42
43
* When composing documentation, code comments, and other materials in English,
43
44
please adhere to the American English (`en_US`) dialect.
44
45
This variant should be considered the standard for all documentation efforts.
45
46
For instance, opt for "initialize" over "initialise" and "color" rather than "colour".
46
47
47
-
Software requirement: [clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 18 or later.
48
+
Software requirement:
49
+
*[clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 18 or later.
50
+
*[shfmt](https://github.com/mvdan/sh).
48
51
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}`.
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