Skip to content

Conversation

rolandreichweinbmw
Copy link
Contributor

@rolandreichweinbmw rolandreichweinbmw commented Sep 1, 2025

With this change, the tests are successful after clang-format reformatting the whole ETL.

Summary by CodeRabbit

  • Style

    • Updated formatting rules to prioritize a specific platform header group and preserve grouping of include blocks.
    • Added directives to keep the order of certain internal headers during automatic formatting.
  • Chores

    • Re-enabled include-sorting to maintain consistent automated formatting across the codebase.
    • No functional or API changes; end-user behavior unchanged.

Copy link

coderabbitai bot commented Sep 1, 2025

Walkthrough

Adds a prioritized include-category for platform.h and re-enables include sorting in .clang-format. Adds // clang-format off/on comments around a private chrono include block in include/etl/chrono.h. No functional or API changes.

Changes

Cohort / File(s) Summary
Clang-format configuration
\.clang-format
Adds IncludeBlocks: Preserve, defines two IncludeCategories (regex for platform.h with Priority: 1, and .* with Priority: 2), and sets SortIncludes: true.
Chrono include formatting guards
include/etl/chrono.h
Inserts // clang-format off (with comment "Keeping the order is important here") before private chrono includes and // clang-format on after to preserve their ordering.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
include/etl/chrono.h (1)

70-71: Add a brief rationale to deter “cleanup” removals later

A one-liner helps future maintainers understand why this block must stay unsorted.

-// clang-format off
+// clang-format off
+// Intentional: preserve exact order of private chrono includes.
.clang-format (1)

13-16: Harden platform.h category regex to cover <...> and subpaths

Catches angle-bracket includes and nested paths, and anchors the match.

-  - Regex:    '("|/)platform\.h"$'
+  - Regex:    '^(<|")(.*/)?platform\.h(>|")$'
     Priority: 1
   - Regex:    '.*'
     Priority: 2
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c93440d and ef2aa26.

📒 Files selected for processing (2)
  • .clang-format (1 hunks)
  • include/etl/chrono.h (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: Windows - No STL - Force C++03
  • GitHub Check: Windows - STL - Force C++03
  • GitHub Check: Clang C++20 OSX - No STL (macos-13)
  • GitHub Check: Clang C++20 OSX - STL - Force C++03 (macos-13)
  • GitHub Check: Syntax Check - Clang C++14 Linux No STL (ubuntu-22.04)
  • GitHub Check: Clang C++20 OSX - STL (macos-13)
  • GitHub Check: Windows - No STL
  • GitHub Check: GCC C++11 Linux - No STL (ubuntu-22.04)
  • GitHub Check: Clang C++14 Linux - No STL (ubuntu-22.04)
  • GitHub Check: GCC C++23 Linux - No STL - Force C++03 (ubuntu-22.04)
  • GitHub Check: GCC C++23 Linux - STL (ubuntu-22.04)
  • GitHub Check: GCC C++11 Linux - STL (ubuntu-22.04)
  • GitHub Check: Clang C++23 OSX - STL (macos-13)
  • GitHub Check: Clang C++23 OSX - No STL (macos-13)
  • GitHub Check: Clang C++20 Linux - No STL (ubuntu-22.04)
  • GitHub Check: Clang C++11 Linux - No STL (ubuntu-22.04)
  • GitHub Check: Clang C++11 Linux - STL (ubuntu-22.04)
  • GitHub Check: Clang C++23 Linux - STL - Force C++03 (ubuntu-22.04)
  • GitHub Check: Clang C++17 Linux - STL (ubuntu-22.04)
  • GitHub Check: Clang C++17 Linux - No STL (ubuntu-22.04)
🔇 Additional comments (2)
include/etl/chrono.h (1)

70-87: Correct use of clang-format region guards to preserve include order

The // clang-format off/on markers are valid for clang-format v12 and will keep this include block untouched. (releases.llvm.org)

.clang-format (1)

10-12: Re-enabling include sorting with preserved blocks aligns with v12 behavior

IncludeBlocks: Preserve + SortIncludes: true is the right combo to sort within blocks while keeping block boundaries. (releases.llvm.org)

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.clang-format (2)

12-16: Avoid flattening system vs project groups—add explicit categories.

Defining only two categories (platform.h, then catch‑all) overrides Chromium defaults and can intermix and "project" headers within the same block. If you want classic grouping while still prioritizing platform.h, extend the categories as below.

 IncludeCategories:
-  - Regex:    '^(<|")(.*/)?platform\.h(>|")$'
-    Priority: 1
-  - Regex:    '.*'
-    Priority: 2
+  - Regex:    '^(<|")(.*/)?platform\.h(>|")$'
+    Priority: 1        # project-wide platform gate first
+  - Regex:    '^<.*>$'
+    Priority: 2        # system/STL headers
+  - Regex:    '^".*"$'
+    Priority: 3        # project/third-party quoted headers
+  - Regex:    '.*'
+    Priority: 4        # anything unexpected

13-14: Narrow the platform.h regex if third‑party headers share that name.

Current pattern matches any path ending in platform.h. If dependencies also provide a platform.h, they’ll be hoisted too. If the intent is only ETL’s header, narrow the path.

-  - Regex:    '^(<|")(.*/)?platform\.h(>|")$'
+  - Regex:    '^(<|")(.*/)?etl/platform\.h(>|")$'
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ef2aa26 and 71ee192.

📒 Files selected for processing (2)
  • .clang-format (1 hunks)
  • include/etl/chrono.h (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • include/etl/chrono.h
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: Clang C++20 Linux - STL - Force C++03 (ubuntu-22.04)
  • GitHub Check: Clang C++20 Linux - No STL - Force C++03 (ubuntu-22.04)
  • GitHub Check: Clang C++20 Linux - No STL (ubuntu-22.04)
  • GitHub Check: Clang C++23 Linux - No STL - Force C++03 (ubuntu-22.04)
  • GitHub Check: GCC C++17 Linux - No STL (ubuntu-22.04)
  • GitHub Check: GCC C++20 Linux - No STL (ubuntu-22.04)
  • GitHub Check: GCC C++20 Linux - No STL - Force C++03 (ubuntu-22.04)
  • GitHub Check: GCC C++17 Linux - STL (ubuntu-22.04)
  • GitHub Check: Clang C++17 Linux - No STL (ubuntu-22.04)
  • GitHub Check: GCC C++20 Linux - STL (ubuntu-22.04)
  • GitHub Check: Clang C++17 Linux - STL (ubuntu-22.04)
  • GitHub Check: GCC C++20 Linux - STL - Force C++03 (ubuntu-22.04)
  • GitHub Check: Clang C++11 Linux - No STL (ubuntu-22.04)
  • GitHub Check: Clang C++23 Linux - STL - Force C++03 (ubuntu-22.04)
  • GitHub Check: Windows - STL
  • GitHub Check: GCC C++23 Linux - STL (ubuntu-22.04)
  • GitHub Check: Clang C++23 Linux - No STL (ubuntu-22.04)
  • GitHub Check: Clang C++11 Linux - STL (ubuntu-22.04)
  • GitHub Check: GCC C++11 Linux - No STL (ubuntu-22.04)
  • GitHub Check: GCC C++11 Linux - STL (ubuntu-22.04)
🔇 Additional comments (2)
.clang-format (2)

10-11: Re-enabling include sorting while preserving blocks looks good.

SortIncludes: true with IncludeBlocks: Preserve restores deterministic ordering without merging developer-defined blocks.


10-16: Ensure clang-format v12+ is installed and configured
CI and developer environments currently lack clang-format, so the new IncludeCategories can’t be validated. Install clang-format v12 or later, then run:

  • clang-format --version to confirm the version
  • clang-format -style=file -dump-config to verify the IncludeCategories settings
  • a dry-run (clang-format -n --Werror --style=file) across your code to ensure no sensitive include sequences are reordered.

@jwellbelove jwellbelove changed the base branch from master to development September 6, 2025 13:11
@jwellbelove jwellbelove merged commit 92f07a6 into ETLCPP:development Sep 6, 2025
1 check passed
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