Skip to content

Conversation

@ChinYikMing
Copy link
Collaborator

@ChinYikMing ChinYikMing commented Dec 13, 2025

  • 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.


Summary by cubic

Adopt dtsfmt as the standard formatter for DTS/DTSI files and enforce it in CI. This ensures consistent device tree formatting and makes misformatted files fail the build.

  • New Features

    • Add .dtsfmtrc.toml and run dtsfmt in .ci/check-format.sh (CI fails on misformatted .dts/.dtsi).
    • Install dtsfmt in the GitHub Actions workflow.
    • Document DTS/DTSI formatting in CONTRIBUTING and include dtsfmt in make format.
    • Reformat existing DTS files to match the rules.
  • Refactors

    • Remove unused REPO_ROOT from .ci/check-format.sh.

Written for commit 1048c2d. Summary will update automatically on new commits.

@jserv jserv added this to the release-2025.2 milestone Dec 13, 2025
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 5 files

Prompt for AI agents (all 3 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".ci/check-format.sh">

<violation number="1" location=".ci/check-format.sh:67">
P2: Array expansion should be quoted to handle filenames with spaces or special characters. This is inconsistent with the existing patterns in this file (e.g., `&quot;${C_SOURCES[@]}&quot;`).</violation>

<violation number="2" location=".ci/check-format.sh:68">
P2: Variable should be quoted to handle filenames with spaces or special characters.</violation>
</file>

<file name="CONTRIBUTING.md">

<violation number="1" location="CONTRIBUTING.md:67">
P3: Minor grammatical issues: &quot;Multi-line&quot; should be lowercase &quot;multi-line&quot; (not a proper noun), and &quot;comment&quot; should be plural &quot;comments&quot; for consistency with standard documentation style.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@ChinYikMing
Copy link
Collaborator Author

To show the diff when any DTS or DTSI files in --check mode of dtsfmt, a dump mechanism is introduced in PR. Not sure the patch will be accepted or not, but the mechanism eases and improves the debuggability when any mismatch happens during CI reporting.

- 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.
@jserv jserv merged commit 40fcbfe into sysprog21:master Dec 13, 2025
14 of 19 checks passed
@jserv
Copy link
Contributor

jserv commented Dec 13, 2025

Thank @ChinYikMing for contributing!

@ChinYikMing ChinYikMing deleted the dtsfmt branch December 13, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants