bluerobotics / bluerobotics/ping-protocol

template: |sort in template creates enum sorted by name and not by value

Open
#131 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
27
Forks
26
PR merge metrics
No merged PRs in 30d

Description

From: https://github.com/bluerobotics/ping-protocol/issues/108

We are sorting the template in alphabetic order and not with #id number.
For a better code reading, we should move it somehow to sort the template by #id.

What is happening with `|sort`:
```cpp
enum msg_CommonMessage_id {
Ack = 1,
Ascii_text = 3,
Nack = 2,
Protocol_version = 5,
Request = 4,
};
```
without `|sort`:
```
enum msg_CommonMessage_id {
Ack = 1,
Nack = 2,
Ascii_text = 3,
Request = 4,
Protocol_version = 5,
};
```

Originally this was an attempt do create the same output with python2 and python3.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.