Skip to content

Conversation

@szymon-czapracki
Copy link
Contributor

This PR adds a GitHub Actions workflow that runs clang-tidy checks on changed lines only. It sets up the build environment, cleans compile_commands.json to avoid known clang errors, and uses clang-tidy-diff.py to efficiently lint code changes, helping maintain code quality on PRs and pushes.

Add clang-tidy configuration file to enforce code quality and style
Set up build environment with necessary dependencies including clang-tidy, jq, and newt
Configure Apache Mynewt NimBLE project with CMake and generate compile_commands.json
Clean compile_commands.json by removing unsupported '-mthumb-interwork' flag to avoid clang errors
Download and run clang-tidy-diff.py to analyze only changed lines based on git diff from origin/master
Fail the workflow if clang-tidy reports warnings or errors in the diff, ensuring code quality on PRs and pushes
@github-actions github-actions bot added CI size/M Medium PR labels Jun 6, 2025
shell: bash
run: |
COMPILE_COMMANDS="compile_commands.json"
if command -v jq >/dev/null 2>&1; then
Copy link
Contributor

Choose a reason for hiding this comment

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

this check shouldn't be needed, all required tools shall be installed in previous steps

@szymon-czapracki szymon-czapracki deleted the clang_work branch June 9, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI size/M Medium PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants