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 dtsfmt as the standard formatter for DTS and DTSI files
- Add `.dtsfmtrc.toml` with formatting rules and apply dtsfmt in
.ci/check-format.sh. The formatting rules are as follows:
* Use spaces for indentation.
* Indent with 4 spaces.
* Use Multi-line comment.
* Use Unix-style line endings (LF).
* Remove trailing whitespace at the end of lines.
* Ensure the file ends with a newline.
- Update CONTRIBUTING.md with formatting rules and usage instructions.
Contributors must ensure consistent DST and DTSI style before code
submission.
- The .ci/check-format.sh’s exit code includes dtsfmt's exit code, which
should be 0 if all DTS and DTSI files are properly formatted.
- The make format integrates the dtsfmt.
- All existing DTS and DTSI are reformatted with the aforementioned
formatting rules.
- Remove non-used REPO_ROOT variable in .ci/check-format.sh.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,12 +50,24 @@ Software requirement:
50
50
*[clang-format](https://clang.llvm.org/docs/ClangFormat.html) version 18.
51
51
*[shfmt](https://github.com/mvdan/sh).
52
52
*[black](https://github.com/psf/black) version 25.1.0.
53
+
*[dtsfmt](https://github.com/mskelton/dtsfmt).
53
54
54
55
To maintain a uniform style across languages, run:
55
56
*`clang-format -i *.{c,h}` to apply the project’s C/C++ formatting rules from the up-to-date .clang-format file.
56
57
*`shfmt -w $(find . -type f -name "*.sh")` to clean and standardize all shell scripts.
57
58
*`black .` to enforce a consistent, idiomatic layout for Python code.
58
-
*`make format` to automatically run all three formatters.
59
+
*`dtsfmt ./src/devices/` to enforce a consistent layout for device tree source (and include).
60
+
*`make format` to automatically run all four formatters.
61
+
62
+
## Coding Style for Device Tree Source and Device Tree Source Include
63
+
64
+
Device Tree Source (and Include) must be clean, consistent, and portable. The following `dtsfmt` rules(check `.dtsfmtrc.toml` file) are enforced project-wide:
0 commit comments