Question: Exclude Generated Header Files from clang-tidy Checks
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- testing-qa, tooling
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
...
- Lingua principale
- Python
- Stelle
- 385
- Fork
- 81
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PickNikRobotics/generate_parameter_library
-
Feature: Enum supportAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
PickNikRobotics/generate_parameter_library#392 · 2 commenti ·
-
GCC 15 emits -Wfree-nonheap-object for generated string one_of validationForse di nuovo libera @tylerjw l’ha presa 39 giorni fa e non c’è nessuna pull request aperta. Aperta
PickNikRobotics/generate_parameter_library#389 · 1 commento · 1 assegnatario ·
-
Feature request: math in the yamlForse già presa @tylerjw l’ha presa 39 giorni fa. Aperta
PickNikRobotics/generate_parameter_library#381 · 2 commenti · 1 reazione · 1 assegnatario ·
-
Validator reference (bounds<>/element_bounds<> etc.) is hard to find inside the READMEForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
PickNikRobotics/generate_parameter_library#377 · 1 commento ·
-
`.inf` not within floating point rangeForse già presa @christianrauch l’ha presa 89 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
PickNikRobotics/generate_parameter_library#376 · 3 commenti ·
Tutte le issue di PickNikRobotics/generate_parameter_library
Issue simili
-
[BUG]: Compliance rules never see Unity Catalog views as viewsForse già presa @wagnercsantos l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
databrickslabs/ontos#1348 ·
I maintainer di solito rispondono entro 3 giorni
-
`forum_pr_poster` action will always return `none` when checking for pre-existing feedback threads, even if a feedback thread already exists.Forse già presa @pgmzeta l’ha presa oggi. ApertaE-Verified P-Major
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
goonstation/goonstation#28259 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
woonstadrotterdam/monumenten#70 ·
I maintainer di solito rispondono entro 15 giorni
-
binding:python bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
The Browser tab fails with a Wayland error when Open Terminal runs from a Wayland desktop sessionAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
open-webui/open-terminal#210 ·