Skip to content

Add CI lint workflow (clang-format)#362

Merged
rsasaki0109 merged 3 commits intodevelop-ros2from
feature/ci-lint
Apr 6, 2026
Merged

Add CI lint workflow (clang-format)#362
rsasaki0109 merged 3 commits intodevelop-ros2from
feature/ci-lint

Conversation

@rsasaki0109
Copy link
Copy Markdown
Collaborator

Summary

  • Add .github/workflows/lint.yml that runs clang-format-17 --dry-run --Werror on all .cpp/.hpp/.h files on every PR

Depends on #361 (.clang-format config) being merged first.

Copy link
Copy Markdown

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

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

💡 To request another review, post a new comment with "/windsurf-review".

Comment on lines +20 to +22
find . \( -name "*.cpp" -o -name "*.hpp" -o -name "*.h" \) \
! -path "./build/*" ! -path "./install/*" \
| xargs clang-format-17 --dry-run --Werror
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The current xargs implementation doesn't handle filenames with spaces correctly. Consider using the null delimiter approach:

Suggested change
find . \( -name "*.cpp" -o -name "*.hpp" -o -name "*.h" \) \
! -path "./build/*" ! -path "./install/*" \
| xargs clang-format-17 --dry-run --Werror
find . \( -name "*.cpp" -o -name "*.hpp" -o -name "*.h" \) \
! -path "./build/*" ! -path "./install/*" -print0 \
| xargs -0 clang-format-17 --dry-run --Werror

clang-format-17 is not in the standard Ubuntu 22.04 apt repos,
causing the install step to fail.
@rsasaki0109 rsasaki0109 merged commit 0a09e0f into develop-ros2 Apr 6, 2026
3 checks passed
@rsasaki0109 rsasaki0109 deleted the feature/ci-lint branch April 6, 2026 06:32
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