-
Notifications
You must be signed in to change notification settings - Fork 11
Add pre-commit for better linting #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Blake McHale <[email protected]>
Signed-off-by: Blake McHale <[email protected]>
Signed-off-by: Blake McHale <[email protected]>
Greptile SummaryThis 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.
The changes are purely cosmetic except for one issue: Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
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
|
There was a problem hiding this 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
| <?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"?> |
There was a problem hiding this comment.
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.
| <?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"?> |
No description provided.