dist/tools/vera++: improve C/C++ support and optimize CI call#15709
dist/tools/vera++: improve C/C++ support and optimize CI call#15709miri64 merged 3 commits intoRIOT-OS:masterfrom
Conversation
| proc isCPPKeyword {s} { | ||
| global cpp_keywords | ||
| return [expr [lsearch $cpp_keywords $s] != -1] | ||
| } |
There was a problem hiding this comment.
Shouldn't this also check for C keywords?
There was a problem hiding this comment.
I manually defined the CPP keywords above. The trick is in the if below: if the keyword is a pure C kw or the file is C++ and the keywords is a C++ kw_, then the token is marked
There was a problem hiding this comment.
I understood that as much. But C keywords are also C++ keywords, so I would have expected something like
| proc isCPPKeyword {s} { | |
| global cpp_keywords | |
| return [expr [lsearch $cpp_keywords $s] != -1] | |
| } | |
| proc isCPPKeyword {s} { | |
| global cpp_keywords | |
| return [expr [lsearch $cpp_keywords $s] != -1] || [isCKeyword $s] | |
| } |
| # Check if it's a C++ file | ||
| regexp {\.[ch]pp} $f m | ||
| # C keywords are valid in C++ but not the other way around | ||
| if {[isCKeyword $tokenName] || ([info exists m] && [isCPPKeyword $tokenName])} { |
There was a problem hiding this comment.
But I guess this || has the same effect?
There was a problem hiding this comment.
yes, that's what I did. It's just the semantics of the isCPPkeyword function :)
|
For reference: Here is the output of the static tests in current master: https://github.com/RIOT-OS/RIOT/runs/1656061171 |
Signed-off-by: Jose Alamos <[email protected]>
Signed-off-by: Jose Alamos <[email protected]>
Signed-off-by: Jose Alamos <[email protected]>
a7d764f to
541d21d
Compare
Perfect! Thanks! |
miri64
left a comment
There was a problem hiding this comment.
Yepp and there are still valid errors, so ACK!
|
thanks for the review! |
Contribution description
This commit solves some issues and optimizes the check script in order to run Vera++ only once (instead of twice, one for warnings and one for errors).
In concrete, this PR:
riot_params.txt. Note that this warning is only a "puts" command, so it won't make Vera++ return error codeTesting procedure
Issues/PRs references
Fixes #15626
I hope I don't have to touch TCL files again in my whole life