Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
300f848
Add pre-commit for linting locally
bmchalenv Jan 13, 2026
5ba1541
Beginning of linting journey
bmchalenv Jan 14, 2026
dfdf823
More config fixes
bmchalenv Jan 14, 2026
624776f
Match flake8 to ament_flake8
bmchalenv Jan 14, 2026
e42b1d6
Run lint again
bmchalenv Jan 14, 2026
1fa80bf
Only support python 3.10 features
bmchalenv Jan 14, 2026
900a432
Only support python 3.10 features
bmchalenv Jan 14, 2026
5c9e1cc
Fix line length issue
bmchalenv Jan 27, 2026
5898ef0
Reset to main
bmchalenv Jan 27, 2026
0489236
Fix lints
bmchalenv Jan 27, 2026
1ff3421
Update Contributing.md to reference installation steps
bmchalenv Jan 28, 2026
eb66360
Add lint tests as first step since it should fail fast
bmchalenv Jan 28, 2026
da401d0
Tests lint in CI
bmchalenv Jan 28, 2026
b09b7b9
Check sign off pre-commit
bmchalenv Jan 28, 2026
a016e5c
Check commit
bmchalenv Jan 28, 2026
d676849
Update md
bmchalenv Jan 28, 2026
e819d07
Use proper working directory
bmchalenv Jan 28, 2026
2f4721d
Test CI
bmchalenv Jan 28, 2026
c85bec4
Test CI
bmchalenv Jan 28, 2026
fb8bd6c
Test CI
bmchalenv Jan 28, 2026
0b771b3
Test CI
bmchalenv Jan 28, 2026
444730b
Test CI
bmchalenv Jan 28, 2026
1cfb152
Test CI
bmchalenv Jan 28, 2026
37f15a0
Test CI
bmchalenv Jan 28, 2026
38425d7
Test CI
bmchalenv Jan 28, 2026
2fac9da
Test CI
bmchalenv Jan 28, 2026
1d01220
Test CI
bmchalenv Jan 28, 2026
8714eb0
Test CI
bmchalenv Jan 28, 2026
387403b
Test CI
bmchalenv Jan 28, 2026
fd0a0aa
Test CI
bmchalenv Jan 28, 2026
7c23de9
Don't fix smoke tests
bmchalenv Jan 28, 2026
9841804
Add uninstall for pre-commit command
bmchalenv Jan 28, 2026
f2c75c4
Remove ros base
bmchalenv Jan 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/debian-packages.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -318,4 +318,4 @@ jobs:
sleep 2
kill -9 $(cat /tmp/gwm.pid) 2>/dev/null || true
ros2 daemon stop || true
shell: bash
shell: bash
15 changes: 13 additions & 2 deletions .github/workflows/ros-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,6 +27,17 @@ env:
ROS_AUTOMATIC_DISCOVERY_RANGE: LOCALHOST

jobs:
pre-commit:
name: Pre-commit checks (linting, copyright check, etc.)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y uncrustify git
- uses: pre-commit/action@v3.0.1

test:
name: Test ROS2 ${{ matrix.ros_distro }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -138,4 +149,4 @@ jobs:
with:
name: test-results-${{ matrix.ros_distro }}
path: build/*/test_results/**/*.xml
retention-days: 7
retention-days: 7
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ _deps

# Temporary files
*.tmp
*.temp
*.temp
58 changes: 58 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
exclude: ^(build|install)/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/hhatto/autopep8
rev: v2.3.1
hooks:
- id: autopep8
args: [--max-line-length=99, -i]
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
args: [--max-line-length=99, '--extend-ignore=B902,C816,D100,D101,D102,D103,D104,D105,D106,D107,D203,D212,D404,I202']
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.12.0-2
hooks:
- id: shfmt
- repo: https://github.com/sbrunner/hooks
rev: 1.6.1
hooks:
- id: copyright-required
exclude: '(^\.git/|(\.ini|\.json|\.service|__init__\.py|\.md|\.gitkeep|\.conf|LICENSE|\.toml|\.template|\.style\..*|\.gitattributes|\.gitignore|\.editorconfig|\.bash-completion|\.install|\.links|changelog|debian/source/format|.codespellrc|copyright|ament_code_style\.cfg|test_pep257\.py|test_flake8\.py|test_copyright\.py)$)'
- repo: local
hooks:
- id: uncrustify
name: uncrustify
entry: uncrustify -c ament_code_style.cfg --replace --no-backup
language: system
types_or: [c, c++]
- id: signed-off-by
name: check commit is signed off
entry: "bash -c 'grep -q \"^Signed-off-by: \" \"$1\"' --"
language: system
stages: [commit-msg]
pass_filenames: true
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
25 changes: 24 additions & 1 deletion Contributing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
We welcome PRs for new features or bugfixes, CI will automatically run automated tests on new PRs. You can also use the scripts/docker-test.sh to debug tests for a particular distribution locally.
# Contributing

We welcome PRs for new features or bugfixes, CI will automatically run automated tests on new PRs. You can also use the scripts/docker-test.sh to debug tests for a particular distribution locally.

## Sign Off

We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license.

Expand Down Expand Up @@ -52,3 +56,22 @@ By making a contribution to this project, I certify that:
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```

## Pre-commit hooks (linting, sign-off check, copyright check, etc.)

If you would like the linter and other checks to run on every commit use [pre-commit](https://pre-commit.com/):

```
sudo apt install uncrustify pipx
pipx install pre-commit
pre-commit install --hook-type pre-commit --hook-type commit-msg
pre-commit run --all-files # try it out, this will run every commit now
```

On every commit now a series of checks will be run to ensure the changes are meeting this repositories requirements.

Uninstall pre-commit with:

```
pre-commit uninstall --hook-type pre-commit --hook-type commit-msg
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ If you want to use it as a command line tool, you can do so with the following l

```bash
ros2 launch greenwave_monitor hz.launch.py gw_monitored_topics:='["/topic1", "/topic2"]'
```
```
2 changes: 1 addition & 1 deletion greenwave_monitor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion greenwave_monitor/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ Node(
),
```

To see the output with the r2s_gw dashboard, run `ros2 run r2s_gw r2s_gw` in a separate terminal.
To see the output with the r2s_gw dashboard, run `ros2 run r2s_gw r2s_gw` in a separate terminal.
2 changes: 1 addition & 1 deletion greenwave_monitor/greenwave_monitor/ncurses_frontend.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions greenwave_monitor/greenwave_monitor/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -176,7 +176,7 @@ def find_best_diagnostic(
diagnostics: List[DiagnosticStatus],
expected_frequency: float,
message_type: str
) -> Tuple[Optional[DiagnosticStatus], Optional[Tuple[float, float, float]]]:
) -> Tuple[Optional[DiagnosticStatus], Optional[Tuple[float, float, float]]]:
"""Find the diagnostic message with frequency closest to expected."""
best_status = None
best_values = None
Expand Down
2 changes: 1 addition & 1 deletion greenwave_monitor/greenwave_monitor/ui_adaptor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion greenwave_monitor/include/greenwave_diagnostics.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
// Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion greenwave_monitor/include/greenwave_monitor.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
// Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion greenwave_monitor/include/minimal_publisher_node.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
// Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion greenwave_monitor/launch/hz.launch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion greenwave_monitor/launch/test_publishers.launch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Loading