Question: Exclude Generated Header Files from clang-tidy Checks
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- testing-qa, tooling
Research direction
Start by reading the linked CMakeLists.txt and package.xml attachments, then inspect how the project configures its clang-tidy test and how generate_parameter_library() creates headers. The report identifies generated headers under the build directory, including scorpio_base_parameters.hpp, as the files triggering warnings. Done means clang-tidy still checks user source files but excludes generated headers.
Written by the indexing model from the issue text.
Description
When using the generate_parameter_library tool in a ROS2 project, the generated header files (e.g., those created by generate_parameter_library() in CMake) are being included in clang-tidy static analysis checks. This is problematic because these files are auto-generated and not part of the user's source code, leading to unnecessary warnings or errors that clutter the output and make it harder to focus on actual code quality issues in the developer's own files.
I would like to exclude these generated header files from clang-tidy checks while still allowing clang-tidy to analyze the rest of the codebase.
Has anyone attempted to solve this issue?
❯ colcon test-result --verbose
build/scorpio_base/Testing/20251220-0855/Test.xml: 2 tests, 0 errors, 1 failure, 0 skipped
- clang_tidy
<<< failure message
-- run_test.py: invoking following command in '/home/lihanchen/Downloads/tmp/src':
- /opt/ros/humble/bin/ament_clang_tidy --xunit-file /home/lihanchen/Downloads/tmp/build/scorpio_base/test_results/scorpio_base/clang_tidy.xunit.xml /home/lihanchen/Downloads/tmp/build/scorpio_base --config /home/lihanchen/Downloads/tmp/src/.clang-tidy
found compilation database for package "scorpio_base"...
/home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:108:15: warning: passing result of std::move() as a const reference argument; no move will actually happen [performance-move-const-arg]
logger_{std::move(logger)} {
^~~~~~~~~~ ~
/home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:120:12: warning: invalid case style for method 'get_params' [readability-identifier-naming]
Params get_params() const{
^~~~~~~~~~
getParams
/home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:131:10: warning: invalid case style for method 'try_update_params' [readability-identifier-naming]
bool try_update_params(Params & params_in) const {
^~~~~~~~~~~~~~~~~
tryUpdateParams
/home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:149:10: warning: invalid case style for method 'try_get_params' [readability-identifier-naming]
bool try_get_params(Params & params_in) const {
^~~~~~~~~~~~~~
tryGetParams
/home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:160:10: warning: invalid case style for method 'is_old' [readability-identifier-naming]
bool is_old(Params const& other) const {
^~~~~~
isOld
/home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:165:17: warning: invalid case style for method 'get_stack_params' [readability-identifier-naming]
StackParams get_stack_params() {
^~~~~~~~~~~~~~~~
getStackParams
/home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:177:10: warning: invalid case style for method 'refresh_dynamic_parameters' [readability-identifier-naming]
void refresh_dynamic_parameters() {
^~~~~~~~~~~~~~~~~~~~~~~~~~
refreshDynamicParameters
/home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:276:10: warning: invalid case style for method 'declare_params' [readability-identifier-naming]
void declare_params(){
^~~~~~~~~~~~~~
declareParams
/home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:439:12: warning: invalid case style for method 'update_internal_params' [readability-identifier-naming]
void update_internal_params(Params updated_params) {
^~~~~~~~~~~~~~~~~~~~~~
updateInternalParams
-- run_test.py: return code 0
-- run_test.py: verify result file '/home/lihanchen/Downloads/tmp/build/scorpio_base/test_results/scorpio_base/clang_tidy.xunit.xml'
>>>
build/scorpio_base/test_results/scorpio_base/clang_tidy.xunit.xml: 14 tests, 0 errors, 9 failures, 0 skipped
- scorpio_base.clang_tidy /home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:108:15
<<< failure message
ove() as a const reference argument; no move will actually happen [performance-move-const-arg]
>>>
- scorpio_base.clang_tidy /home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:120:12
<<< failure message
invalid case style for method 'get_params' [readability-identifier-naming]
>>>
- scorpio_base.clang_tidy /home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:131:10
<<< failure message
invalid case style for method 'try_update_params' [readability-identifier-naming]
>>>
- scorpio_base.clang_tidy /home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:149:10
<<< failure message
invalid case style for method 'try_get_params' [readability-identifier-naming]
>>>
- scorpio_base.clang_tidy /home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:160:10
<<< failure message
invalid case style for method 'is_old' [readability-identifier-naming]
>>>
- scorpio_base.clang_tidy /home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:165:17
<<< failure message
invalid case style for method 'get_stack_params' [readability-identifier-naming]
>>>
- scorpio_base.clang_tidy /home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:177:10
<<< failure message
invalid case style for method 'refresh_dynamic_parameters' [readability-identifier-naming]
>>>
- scorpio_base.clang_tidy /home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:276:10
<<< failure message
invalid case style for method 'declare_params' [readability-identifier-naming]
>>>
- scorpio_base.clang_tidy /home/lihanchen/Downloads/tmp/build/scorpio_base/include/scorpio_base/scorpio_base_parameters.hpp:439:12
<<< failure message
invalid case style for method 'update_internal_params' [readability-identifier-naming]
>>>
Summary: 23 tests, 0 errors, 10 failures, 0 skipped
Here is my source files:
---
Checks: '-*,
performance-*,
-performance-unnecessary-value-param,
llvm-namespace-comment,
modernize-redundant-void-arg,
modernize-use-nullptr,
modernize-use-default,
modernize-use-override,
modernize-loop-convert,
modernize-make-shared,
modernize-make-unique,
misc-unused-parameters,
readability-named-parameter,
readability-redundant-smartptr-get,
readability-redundant-string-cstr,
readability-simplify-boolean-expr,
readability-container-size-empty,
readability-identifier-naming,
'
HeaderFilterRegex: ''
CheckOptions:
- key: llvm-namespace-comment.ShortNamespaceLines
value: '10'
- key: llvm-namespace-comment.SpacesBeforeComments
value: '2'
- key: misc-unused-parameters.StrictMode
value: '1'
- key: readability-braces-around-statements.ShortStatementLines
value: '2'
# type names
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.UnionCase
value: CamelCase
# method names
- key: readability-identifier-naming.MethodCase
value: camelBack
# variable names
- key: readability-identifier-naming.VariableCase
value: lower_case
# class member names
- key: readability-identifier-naming.PrivateMemberCase
value: lower_case
- key: readability-identifier-naming.PrivateMemberSuffix
value: '_'
- key: readability-identifier-naming.ProtectedMemberCase
value: lower_case
- key: readability-identifier-naming.ProtectedMemberSuffix
value: '_'
# const static or global variables are UPPER_CASE
- key: readability-identifier-naming.EnumConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.StaticConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.ClassConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalVariableCase
value: UPPER_CASE
...
- Dominant language
- Python
- Stars
- 385
- Forks
- 81
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PickNikRobotics/generate_parameter_library
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
PickNikRobotics/generate_parameter_library#392 · 2 comments ·
-
GCC 15 emits -Wfree-nonheap-object for generated string one_of validationPossibly taken @tylerjw claimed this 18 days ago. Open
PickNikRobotics/generate_parameter_library#389 · 1 comment · 1 assignee ·
-
Feature request: math in the yamlPossibly taken @tylerjw claimed this 18 days ago. Open
PickNikRobotics/generate_parameter_library#381 · 2 comments · 1 reaction · 1 assignee ·
-
Validator reference (bounds<>/element_bounds<> etc.) is hard to find inside the READMEPossibly taken @tylerjw claimed this 18 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
PickNikRobotics/generate_parameter_library#377 · 1 comment ·
-
`.inf` not within floating point rangePossibly taken @christianrauch claimed this 68 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 30/100
PickNikRobotics/generate_parameter_library#376 · 3 comments ·
All issues in PickNikRobotics/generate_parameter_library
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
noontide-co/mainbranch#1211 · 1 comment ·
Maintainers usually reply within 1 day
-
[1.x Bug] run-operation --sql reports success but rolls back writes on transaction-capable adaptersOpentriage
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
dbt-labs/dbt#16784 · 1 comment ·
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug settings ui
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
DewaldOosthuizen/py-tray-command-launcher#162 ·
Maintainers usually reply within 1 day
-
run_all sleeps after the final job despite documenting delays between jobsPossibly taken @Gambit-Checkmate claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100