Comments (12)
@esteve what lead you to notice this? @mikaelarguedas or @dirk-thomas are we running uncrustify on our generated code by default?
from ament_lint.
Yes, when being explicitly requested (https://github.com/ros2/rosidl/blob/69400938eef1f6886fd65951d18fae7d3780e47d/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake#L36-L38) the generators add linters e.g. (https://github.com/ros2/rosidl/blob/master/rosidl_generator_cpp/cmake/rosidl_generator_cpp_generate_interfaces.cmake#L121-L144).
from ament_lint.
@wjwwood this branch (https://github.com/esteve/rosidl/tree/linter-errors) adds a message like the one in the issue description and activates linters to show that the generated message does not pass ament_uncrustify
from ament_lint.
The current configuration file for uncrustify actually configures the style checked exactly in the way the code generator generates the code. It seems uncrustify has a problem with this specific example:
Various_()
: value_a({{1, 2}}),
value_b({{3, 4}})
{
}
Maybe you can try a similar example but with a different initialization / types. If that passes this may be a bug in uncrustify
which gets confused by the {{
and }}
from the initialization arguments. You might want to report this upstream with an example.
from ament_lint.
@dirk-thomas yeah, the uncrustify configuration seems to be fine, but it doesn't seem to work, at least on my workspace. Have you tried the branch I pushed? https://github.com/esteve/rosidl/tree/linter-errors
from ament_lint.
Have you tried the branch I pushed?
No, I haven't.
from ament_lint.
No, I haven't.
Will you then?
from ament_lint.
@dirk-thomas BTW, I took the time to back the claims of this issue with proof, so your statement doesn't seem to be entirely factual:
The current configuration file for uncrustify actually configures the style checked exactly in the way the code generator generates the code
from ament_lint.
Will you then?
I do believe your posted result. That uncrustify
complains about the generated code. But since we pass the "correct" configuration to uncrusitfy
(which works in similar examples as intended, please see plenty of existing code which uses the same style and passes the linter) there is not much we can do about it (except marking the lines in the code generation step to be ignored by uncustify or fixing the problem upstream in uncrustify).
Since I don't see what I would gain by testing your branch (I would expect to see exactly the result you posted) I am not sure why I should do that?
from ament_lint.
I do believe your posted result.
From your previous comment, where you pasted a snippet formatted according the style configuration, one could assume that it was generated by actually running uncrustify. So I wonder what was the point of posting that handcrafted snippet at all if I already had showed that it wasn't the expected result.
Anyway, we seem to agree that there may be an issue in uncrustify, so I filed a ticket detailing the issue: uncrustify/uncrustify#1142
from ament_lint.
waiting for the bug to be addressed upstream
from ament_lint.
I will close this since the issue is tracked upstream. Keeping this open doesn't seem to provide a significant "visibility" advantage.
from ament_lint.
Related Issues (20)
- ament_cmake_flake8 ignores value of AMENT_LINT_AUTO_FILE_EXCLUDE HOT 5
- `ament_clang_format` and `colcon test` HOT 4
- [ament_cppcheck] provide libraries
- Update humble ament_pep257 package HOT 5
- Please tag a new release of `ament_lint` for `foxy` HOT 2
- Ament-flake8 attributeError Humble HOT 4
- Support for other filetypes for ament_copyright HOT 2
- ament_uncrustify is incompatible with uncrustify >= 0.75 HOT 1
- ament_pep257 crashes during xunit generation when non-pep257 errors occur
- What is the general release strategy? HOT 1
- ament_xmllint stuck when no internet
- Feature Rquest: ament_cmake_clang_tidy, specify --header-filter and --jobs options to ament_clang_tidy
- (ament_xmllint) add extension argument
- ament_cmake_pep257, ament_cmake_lint_cmake, ament_cmake_xmllint ignores value of AMENT_LINT_AUTO_FILE_EXCLUDE HOT 1
- ament_flake8 fails with flake8>=6.0.0 HOT 5
- ament_lint_auto finds recursive test dependencies causing downstream packages to inherit conflicting linters
- ament_copyright does not recognize REUSE-compliant copyright headers
- TypeError on debian11 HOT 1
- EXCLUDE argument parsed differently in different linters HOT 2
- BSD 3 license (and maybe others) require a copyright notice at the top of the license file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ament_lint.