Skip to content

Commit 9357c43

Browse files
committed
add pre-commit step
1 parent d3575cb commit 9357c43

6 files changed

Lines changed: 38 additions & 12 deletions

File tree

.github/workflows/pre-commit.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Pre-commit
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
pre-commit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.x'
19+
20+
- uses: pre-commit/action@v3.0.1

.github/workflows/ros-humble.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: ROS2 Humble
22

33
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
4+
workflow_run:
5+
workflows: ["Pre-commit"]
6+
types: [completed]
87
workflow_dispatch:
98

109
jobs:
1110
build:
1211
runs-on: ubuntu-22.04
12+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
1313
steps:
1414
# Set up ROS
1515
- uses: ros-tooling/setup-ros@v0.7

.github/workflows/ros-jazzy.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: ROS2 Jazzy
22

33
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
4+
workflow_run:
5+
workflows: ["Pre-commit"]
6+
types: [completed]
87
workflow_dispatch:
98

109
jobs:
1110
build:
1211
runs-on: ubuntu-24.04
12+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
1313
steps:
1414
# Set up ROS
1515
- uses: ros-tooling/setup-ros@v0.7

.github/workflows/ros-rolling.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: ROS2 Rolling
22

33
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
4+
workflow_run:
5+
workflows: ["Pre-commit"]
6+
types: [completed]
87
workflow_dispatch:
98

109
jobs:
1110
build:
1211
runs-on: ubuntu-24.04
12+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
1313
steps:
1414
# Set up ROS
1515
- uses: ros-tooling/setup-ros@v0.7

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@
3030
*.exe
3131
*.out
3232
*.app
33+
/.vscode/

src/TopicPublisherROS2/publisher_ros2.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ void TopicPublisherROS2::filterDialog()
146146
dialog->ui()->radioButtonClock->setHidden(true);
147147
dialog->ui()->radioButtonHeaderStamp->setHidden(true);
148148

149+
// Sort topics alphabetically by topic name
150+
std::vector<TopicInfo> sorted_topics = _topics_info;
151+
std::sort(sorted_topics.begin(), sorted_topics.end(),
152+
[](const TopicInfo& a, const TopicInfo& b) { return a.topic_name < b.topic_name; });
153+
149154
std::map<std::string, QCheckBox*> checkbox;
150155

151156
for (const TopicInfo& info : _topics_info)

0 commit comments

Comments
 (0)