Skip to content

dist/tools/vera++: allow comments to be overlong#21671

Merged
crasbe merged 1 commit intoRIOT-OS:masterfrom
maribu:dist/tools/vera++/no-length-limit-in-comments
Nov 3, 2025
Merged

dist/tools/vera++: allow comments to be overlong#21671
crasbe merged 1 commit intoRIOT-OS:masterfrom
maribu:dist/tools/vera++/no-length-limit-in-comments

Conversation

@maribu
Copy link
Copy Markdown
Member

@maribu maribu commented Aug 20, 2025

Contribution description

The line length check is very noisy, especially in the Github web view with annotations added to every overlong line. Reducing the number of false positives there for is very valuable.

In comments, we often have overlong lines e.g. because an URL is longer than 100 chars, because we add a larger markdown table, we add ASCII art to visualize data structures, or because we add dot syntax that may just need overlong lines.

Since vera++ does not support annotations with magic comments to disable the length check just for a table / URL / graphic, this just disables the length checks for all comments outright.

Testing procedure

  • There should still be complaints about overlong lines if they are in the code
  • There should be no complaints about overlong lines if they are in comments

Issues/PRs references

None

@maribu maribu added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: CI Area: Continuous Integration of RIOT components labels Aug 20, 2025
@github-actions github-actions bot added Area: tools Area: Supplementary tools and removed Area: CI Area: Continuous Integration of RIOT components labels Aug 20, 2025
The line length check is very noisy, especially in the Github web view
with annotations added to every overlong line. Reducing the number of
false positives there for is very valuable.

In comments, we often have overlong lines e.g. because an URL is longer
than 100 chars, because we add a larger markdown table, we add ASCII
art to visualize data structures, or because we add dot syntax that may
just need overlong lines.

Since vera++ does not support annotations with magic comments to disable
the length check just for a table / URL / graphic, this just disables
the length checks for all comments outright.
@maribu maribu force-pushed the dist/tools/vera++/no-length-limit-in-comments branch from d73e9b5 to 164918b Compare August 20, 2025 09:03
@riot-ci
Copy link
Copy Markdown

riot-ci commented Aug 20, 2025

Murdock results

✔️ PASSED

164918b dist/tools/vera++: allow comments to be overlong

Success Failures Total Runtime
1 0 1 02m:07s

Artifacts

@crasbe
Copy link
Copy Markdown
Contributor

crasbe commented Aug 20, 2025

I understand the reason but I don't like the solution. Especially comments are typically too long and this might create a false negative when there is a long code line with a comment behind it that makes it even longer, which should be shortened.

@maribu
Copy link
Copy Markdown
Member Author

maribu commented Aug 20, 2025

The oversimplified script only excludes lines that start with " * " or with "// ". A comment behind code would not be excluded.

To be honest, I believe that vera++ is just not a suitable tool for style checking and should be dropped entirely in favor of clang-format for this task. The development of vera++ has been on hold for the last 6 years, which gives me some concern.

@crasbe
Copy link
Copy Markdown
Contributor

crasbe commented Aug 20, 2025

Can we somehow integrate clang-format into the static tests? It's a bit annoying when the review is done and then the build fails because of something that should've been caught by the static test 🤔

@crasbe
Copy link
Copy Markdown
Contributor

crasbe commented Oct 30, 2025

Similar PR to #21364.

Copy link
Copy Markdown
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

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

I think I can live with disabling the check for comments, although we should still enforce line breaks where it's possible (as in: normal text).

But yeah, vera++ just doesn't seem to be up to the task 🤷

@crasbe crasbe added this pull request to the merge queue Nov 3, 2025
Merged via the queue into RIOT-OS:master with commit b8f96e7 Nov 3, 2025
26 checks passed
@leandrolanzieri leandrolanzieri added this to the Release 2026.01 milestone Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants