-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Add clang-tidy check for nested namespace definitions #3084
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3084 +/- ##
=======================================
Coverage 49.02% 49.02%
=======================================
Files 494 494
Lines 29058 29058
Branches 13797 13797
=======================================
Hits 14246 14246
Misses 4929 4929
Partials 9883 9883 ☔ View full report in Codecov by Sentry. |
📊: Physics performance monitoring for 99f9ce8physmon summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I took a quick look at all files. No objections from my side.
I think the nested namespace syntax is more compact.
🔴 Athena integration test results [6883f31]🔴 Some tests have failed!Please investigate the pipeline! |
…ct#3084) New language feature in C++17: Nested namespace definitions, e.g., `namespace X::Y { … }` instead of `namespace X { namespace Y { … } }` We had a good mix between them, but clang-tidy has with `modernize-concat-nested-namespaces` an option, to automatically check for them. I stumbled over this, when reading through the cpp-standard-updates and I think this improves readability. Hits will be reported similar to this one: ``` ╭─ /builds/acts/ci-bridge/src/Tests/UnitTests/Plugins/TGeo/TGeoParserTests.cpp─╮ │ 🟡 │ │ /builds/acts/ci-bridge/src/Tests/UnitTests/Plugins/TGeo/TGeoParserTests.cpp: │ │ 27:1 WARNING [modernize-concat-nested-namespaces] │ │ ╭──────────────────────────────────────────────────────────────────────────╮ │ │ │ nested namespaces can be concatenated │ │ │ │ 27 | namespace Acts { │ │ │ │ | ^~~~~~~~~~~~~~~~ │ │ │ │ 28 | │ │ │ │ 29 | namespace Test { │ │ │ │ | ~~~~~~~~~~~~~~ │ │ │ │ | namespace Acts::Test │ │ │ │ │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ ──────────────────────────────────────────────────────────────────────────── │ ╰──────────────────────────────────────────────────────────────────────────────╯ ```
…ct#3084) New language feature in C++17: Nested namespace definitions, e.g., `namespace X::Y { … }` instead of `namespace X { namespace Y { … } }` We had a good mix between them, but clang-tidy has with `modernize-concat-nested-namespaces` an option, to automatically check for them. I stumbled over this, when reading through the cpp-standard-updates and I think this improves readability. Hits will be reported similar to this one: ``` ╭─ /builds/acts/ci-bridge/src/Tests/UnitTests/Plugins/TGeo/TGeoParserTests.cpp─╮ │ 🟡 │ │ /builds/acts/ci-bridge/src/Tests/UnitTests/Plugins/TGeo/TGeoParserTests.cpp: │ │ 27:1 WARNING [modernize-concat-nested-namespaces] │ │ ╭──────────────────────────────────────────────────────────────────────────╮ │ │ │ nested namespaces can be concatenated │ │ │ │ 27 | namespace Acts { │ │ │ │ | ^~~~~~~~~~~~~~~~ │ │ │ │ 28 | │ │ │ │ 29 | namespace Test { │ │ │ │ | ~~~~~~~~~~~~~~ │ │ │ │ | namespace Acts::Test │ │ │ │ │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ ──────────────────────────────────────────────────────────────────────────── │ ╰──────────────────────────────────────────────────────────────────────────────╯ ```
…ct#3084) New language feature in C++17: Nested namespace definitions, e.g., `namespace X::Y { … }` instead of `namespace X { namespace Y { … } }` We had a good mix between them, but clang-tidy has with `modernize-concat-nested-namespaces` an option, to automatically check for them. I stumbled over this, when reading through the cpp-standard-updates and I think this improves readability. Hits will be reported similar to this one: ``` ╭─ /builds/acts/ci-bridge/src/Tests/UnitTests/Plugins/TGeo/TGeoParserTests.cpp─╮ │ 🟡 │ │ /builds/acts/ci-bridge/src/Tests/UnitTests/Plugins/TGeo/TGeoParserTests.cpp: │ │ 27:1 WARNING [modernize-concat-nested-namespaces] │ │ ╭──────────────────────────────────────────────────────────────────────────╮ │ │ │ nested namespaces can be concatenated │ │ │ │ 27 | namespace Acts { │ │ │ │ | ^~~~~~~~~~~~~~~~ │ │ │ │ 28 | │ │ │ │ 29 | namespace Test { │ │ │ │ | ~~~~~~~~~~~~~~ │ │ │ │ | namespace Acts::Test │ │ │ │ │ │ │ ╰──────────────────────────────────────────────────────────────────────────╯ │ │ ──────────────────────────────────────────────────────────────────────────── │ ╰──────────────────────────────────────────────────────────────────────────────╯ ```
New language feature in C++17:
Nested namespace definitions, e.g.,
namespace X::Y { … }
instead ofnamespace X { namespace Y { … } }
We had a good mix between them, but clang-tidy has with
modernize-concat-nested-namespaces
an option, to automatically check for them.I stumbled over this, when reading through the cpp-standard-updates and I think this improves readability.
Hits will be reported similar to this one: