Skip to content

Add CI lint workflow (clang-format)#362

Open
rsasaki0109 wants to merge 1 commit intodevelop-ros2from
feature/ci-lint
Open

Add CI lint workflow (clang-format)#362
rsasaki0109 wants to merge 1 commit 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

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