Skip to content

Commit c5f37bb

Browse files
Module1 - Revert clang changes (#23)
* Revert changes from clang-format * Add direct link in the guide to the code --------- Co-authored-by: JesusSilvaUtrera <jesus.silva@ekumenlabs.com>
1 parent c4f0fe2 commit c5f37bb

2 files changed

Lines changed: 17 additions & 20 deletions

File tree

modules/module_1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ And then run the tests:
163163
colcon test --packages-select module_1 --event-handlers console_direct+
164164
```
165165

166-
The task for this exercise is to analyze the inconsistencies in the current code, fix them, and see how the linter tests pass afterwards.
166+
The task for this exercise is to analyze the inconsistencies in the current [bad_example](./src/bad_example.cpp) code, fix them, and see how the linter tests pass afterwards.
167167

168168
#### Definition of success
169169

modules/module_1/src/bad_example.cpp

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,25 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include <rclcpp/rclcpp.hpp>
16-
#include <std_msgs/msg/string.hpp>
1715
#include <string>
16+
#include <std_msgs/msg/string.hpp>
17+
#include <rclcpp/rclcpp.hpp>
1818

1919
int an_unused_variable = (int)3.14;
2020

21-
int main(int argc, char** argv) {
22-
rclcpp::init(argc, argv);
23-
auto node = rclcpp::Node::make_shared("bad_node");
24-
auto publisher = node->create_publisher<std_msgs::msg::String>("topic", 10);
25-
rclcpp::Rate loop_rate(1);
26-
27-
while (rclcpp::ok()) {
28-
std_msgs::msg::String msg;
29-
msg.data =
30-
"This is a very long string designed specifically to make this line exceed the typical "
31-
"80-character limit that linters check for.";
32-
publisher->publish(msg);
33-
rclcpp::spin_some(node);
34-
loop_rate.sleep();
35-
}
21+
int main(int argc,char ** argv){
22+
rclcpp::init(argc,argv);
23+
auto node = rclcpp::Node::make_shared("bad_node");
24+
auto publisher=node->create_publisher<std_msgs::msg::String>("topic",10);
25+
rclcpp::Rate loop_rate(1);
3626

37-
rclcpp::shutdown();
38-
return 0;
27+
while(rclcpp::ok()){
28+
std_msgs::msg::String msg;
29+
msg.data="hello world";
30+
msg.data = "This is a very long string designed specifically to make this line exceed the typical 80-character limit that linters check for.";
31+
publisher->publish(msg);
32+
rclcpp::spin_some(node);
33+
loop_rate.sleep();
3934
}
35+
rclcpp::shutdown();
36+
return 0;}

0 commit comments

Comments
 (0)