Skip to content

style: put attributes on their own line above the declaration - #35

Merged
XavierBeheydt merged 1 commit into
devfrom
style/attributes-own-line
Nov 9, 2026
Merged

XavierBeheydt merged 1 commit into
devfrom
style/attributes-own-line

Conversation

@XavierBeheydt

Copy link
Copy Markdown
Member

Summary

.clang-format inherited BreakAfterAttributes: Leave, so [[nodiscard]] Result<T> f(); and the two-line form could both appear. It is now Always:

[[nodiscard]]
Result<Texture> loadTexture(const std::filesystem::path &path);

A signature always starts with its return type, which reads better in a diff. The option also applies to attributes on variables ([[maybe_unused]] goes on its own line too). cpp.md states the rule.

Verification

🤖 Generated with Claude Code

https://claude.ai/code/session_01JfRmXnowFEecvNmG9b9szy

clang-format left the attribute placement to the author (BreakAfterAttributes:
Leave), so both forms could mix. Always puts [[nodiscard]] and the other
attributes on their own line, so a signature always starts with its return
type. It also applies to attributes on variables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JfRmXnowFEecvNmG9b9szy
@XavierBeheydt XavierBeheydt added scope: config Editor and tooling configs scope: agents AGENTS.md and .agents/ agent: claude-code Handled by Claude Code model: opus Claude Opus (Claude Code) labels Nov 9, 2026
@XavierBeheydt
XavierBeheydt merged commit f620551 into dev Nov 9, 2026
3 of 5 checks passed
@XavierBeheydt
XavierBeheydt deleted the style/attributes-own-line branch November 9, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent: claude-code Handled by Claude Code model: opus Claude Opus (Claude Code) scope: agents AGENTS.md and .agents/ scope: config Editor and tooling configs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant