Skip to content

Clarify compact C++ formatting guidance - #5874

Open
softhack007 with Copilot wants to merge 6 commits into
mainfrom
copilot/add-formatting-clarification
Open

softhack007 with Copilot wants to merge 6 commits into
mainfrom
copilot/add-formatting-clarification

Conversation

Copilot AI commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

This is a clarification for contributors, to explain that we prefer "all parameters on the same line" for source code readability.
(based on some extreme examples in #5833)

  • Guidance: Prefer compact function parameter lists and if conditions; allow multiline parameters when lists are very long.
  • Examples: Add bad/good examples to CONTRIBUTING.md, positioned immediately before the Comments guidelines.
  • Agent instructions: Add the matching preference to AGENTS.md.
// Preferred
void setColor(uint8_t red, uint8_t green, uint8_t blue);

if (enabled && segment.isActive() && color != 0) {
  setColor(red, green, blue);
}

AI assistance: yes. for writing up everything into concise statements.

Copilot AI and others added 3 commits September 29, 2026 11:08
Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: wled/WLED/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 3cecd8bb-4267-480b-aded-1fc177c9745d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@softhack007 softhack007 added documentation documentation should be updated to explain behaviour AI Partly generated by an AI. Make sure that the contributor fully understands the code! labels Sep 29, 2026
@softhack007
softhack007 marked this pull request as ready for review September 29, 2026 11:28
@softhack007

softhack007 commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

@coderabbitai full review

@softhack007

Copy link
Copy Markdown
Member

@coderabbitai review

* bad: each parameter on a separate line
* good: avoid re-phrasing the source code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The documentation-only changes are consistent, clear, and aligned with the stated purpose.

Review effort: Balanced
Findings: None

What changed in this PR

Clarifies WLED’s preferred compact C++ formatting for function parameters and conditional expressions.

Changes:

  • Documents compact formatting with good and bad examples.
  • Aligns contributor, C++ review, and agent guidance.
File Description
CONTRIBUTING.md Adds formatting guidance and examples.
docs/​cpp.instructions.md Adds the C++ formatting rule.
AGENTS.md Aligns agent instructions with contributor guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@softhack007 softhack007 reopened this Sep 29, 2026
@softhack007

Copy link
Copy Markdown
Member

PR closed by accident 😅

@softhack007

softhack007 commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

@coderabbitai are you there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Partly generated by an AI. Make sure that the contributor fully understands the code! documentation documentation should be updated to explain behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants