Coder Social home page Coder Social logo

Comments (12)

wjwwood avatar wjwwood commented on August 28, 2024

@esteve what lead you to notice this? @mikaelarguedas or @dirk-thomas are we running uncrustify on our generated code by default?

from ament_lint.

dirk-thomas avatar dirk-thomas commented on August 28, 2024

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.

esteve avatar esteve commented on August 28, 2024

@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.

dirk-thomas avatar dirk-thomas commented on August 28, 2024

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.

esteve avatar esteve commented on August 28, 2024

@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.

dirk-thomas avatar dirk-thomas commented on August 28, 2024

Have you tried the branch I pushed?

No, I haven't.

from ament_lint.

esteve avatar esteve commented on August 28, 2024

No, I haven't.

Will you then?

from ament_lint.

esteve avatar esteve commented on August 28, 2024

@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.

dirk-thomas avatar dirk-thomas commented on August 28, 2024

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.

esteve avatar esteve commented on August 28, 2024

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.

mikaelarguedas avatar mikaelarguedas commented on August 28, 2024

waiting for the bug to be addressed upstream

from ament_lint.

dirk-thomas avatar dirk-thomas commented on August 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.