ament / ament_lint

Apache License 2.0
37 stars 107 forks source link

Excessive indentation in wrapped `throw statement` #173

Open rotu opened 5 years ago

rotu commented 5 years ago

ament_uncrustify causes line continuations in throw statement to indent to 8 spaces instead of the 2 spaces recommended by the developer guide:

e.g.: https://github.com/ros2/rclcpp/blob/9be3e08cd4d04193fb76cb6dd8f5db11d7199e2f/rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp#L438-L441

  if (!result.successful) {
    throw rclcpp::exceptions::InvalidParameterValueException(
            "parameter '" + name + "' could not be set: " + result.reason);
  }
dirk-thomas commented 5 years ago

The package ament_uncrustify only provides the ability to invoke uncrustify in a convenient way. If this is not changable in the configuration you might want to report the problem in the upstream package instead: https://github.com/uncrustify/uncrustify

rotu commented 5 years ago

@dirk-thomas Please reopen. It doesn't seem to be a problem affecting uncrustify out of the box. I think it's a misconfiguration in ament_uncrustify.

dirk-thomas commented 5 years ago

Ok, please double check the currently used configuration then: https://github.com/ament/ament_lint/blob/21ffe80245cc23ca13faa575c420f915c0e316f3/ament_uncrustify/ament_uncrustify/configuration/ament_code_style.cfg

rotu commented 5 years ago

@dirk-thomas, I was very nearly convinced I was wrong about this, but I turned out to be mistaken :-)