Skip to content

Conversation

@bmchalenv
Copy link
Contributor

No description provided.

Signed-off-by: Blake McHale <[email protected]>
Signed-off-by: Blake McHale <[email protected]>
@greptile-apps
Copy link

greptile-apps bot commented Jan 14, 2026

Greptile Summary

This PR introduces pre-commit hooks for automated code formatting and linting, applying yapf (Python), shfmt (shell scripts), copyright checks, uncrustify (C/C++), and codespell across the codebase.

  • Added .pre-commit-config.yaml with 5 linting tools for consistent code formatting
  • Reformatted all Python files with yapf (line wrapping, import organization)
  • Reformatted all shell scripts with shfmt (tabs instead of spaces, case statement formatting)
  • Updated copyright years from 2025 to 2025-2026 across all files
  • Fixed trailing whitespace and missing newlines at end of files
  • Added copyright headers to previously unlicensed files

The changes are purely cosmetic except for one issue: greenwave_monitor_interfaces/package.xml has a duplicate XML declaration that makes it invalid XML.

Confidence Score: 4/5

  • This PR is mostly safe to merge after fixing the XML syntax error
  • The PR consists almost entirely of automated formatting changes with no logic modifications. However, the duplicate XML declaration in package.xml will cause XML parsing errors and must be fixed before merge. All other changes are cosmetic and safe.
  • Pay close attention to greenwave_monitor_interfaces/package.xml which has a critical syntax error

Important Files Changed

Filename Overview
.pre-commit-config.yaml Added pre-commit configuration with yapf, shfmt, copyright checks, uncrustify, and codespell hooks
greenwave_monitor_interfaces/package.xml Added copyright header but has duplicate XML declaration causing invalid XML structure
greenwave_monitor/greenwave_monitor/ncurses_frontend.py Reformatted with yapf - line wrapping and whitespace changes only, no logic changes
greenwave_monitor/test/test_greenwave_monitor.py Reformatted imports and function calls with yapf, no logic changes
scripts/build_debian_packages.sh Reformatted with shfmt - tabs instead of spaces, different indentation style, no logic changes

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Git as Git
    participant PreCommit as Pre-commit Hooks
    participant Yapf as yapf (Python)
    participant Shfmt as shfmt (Shell)
    participant Copyright as Copyright Check
    participant Uncrustify as uncrustify (C/C++)
    participant Codespell as codespell

    Dev->>Git: git commit
    Git->>PreCommit: Trigger pre-commit hooks
    
    PreCommit->>PreCommit: Check YAML files
    PreCommit->>PreCommit: Fix end-of-file
    PreCommit->>PreCommit: Remove trailing whitespace
    
    PreCommit->>Yapf: Format Python files
    Yapf-->>PreCommit: Reformatted files
    
    PreCommit->>Shfmt: Format shell scripts
    Shfmt-->>PreCommit: Reformatted files
    
    PreCommit->>Copyright: Verify copyright headers
    Copyright-->>PreCommit: Check passed
    
    PreCommit->>Uncrustify: Format C/C++ files
    Uncrustify-->>PreCommit: Formatted files
    
    PreCommit->>Codespell: Check spelling
    Codespell-->>PreCommit: Check passed
    
    PreCommit-->>Git: All checks passed
    Git-->>Dev: Commit created
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

23 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines 1 to 21
<?xml version="1.0"?>

<!--
SPDX-FileCopyrightText: 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.
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.
SPDX-License-Identifier: Apache-2.0
-->

<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: Duplicate XML declaration on line 21. The file has two <?xml declarations (line 1 and line 21), which creates invalid XML.

Suggested change
<?xml version="1.0"?>
<!--
SPDX-FileCopyrightText: 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.
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.
SPDX-License-Identifier: Apache-2.0
-->
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<?xml version="1.0"?>
<!--
SPDX-FileCopyrightText: 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.
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.
SPDX-License-Identifier: Apache-2.0
-->
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant