Skip to content

[CI] Enable clang-tidy in precommit#21234

Merged
KornevNikita merged 2 commits intointel:syclfrom
KornevNikita:clang-tidy
Feb 10, 2026
Merged

[CI] Enable clang-tidy in precommit#21234
KornevNikita merged 2 commits intointel:syclfrom
KornevNikita:clang-tidy

Conversation

@KornevNikita
Copy link
Contributor

I'm not sure if clang-tidy passes on all PRs, so for now introducing with continue-on-error (meaning it will be green even in case of failure).

I'm not sure if clang-tidy passes on all PRs, so for now introducing
with continue-on-error (meaning it will be green even in case of
failure).
@KornevNikita KornevNikita requested a review from a team as a code owner February 6, 2026 17:40
Copy link
Contributor

@sarnex sarnex left a comment

Choose a reason for hiding this comment

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

cool change, just a few comments

if: steps.should_run_tidy.outputs.run == 'true'
run: |
# Remove commands containing "-D__INTEL_PREVIEW_BREAKING_CHANGES" to avoid running on the same file twice.
jq '[ .[] | select(.command | contains("-D__INTEL_PREVIEW_BREAKING_CHANGES") | not) ]' $GITHUB_WORKSPACE/build/compile_commands.json > $GITHUB_WORKSPACE/build/compile_commands.temp.json
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we just pass -DSYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB=Off instead of doing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We might, but it looks like it requires some cmake file changes:

CMake Error at /home/sycl/llvm/sycl/cmake/modules/AddSYCLUnitTest.cmake:49 (get_target_property):
  get_target_property() called with non-existent target "sycl-preview".
Call Stack (most recent call first):
  /home/sycl/llvm/sycl/cmake/modules/AddSYCLUnitTest.cmake:166 (add_sycl_unittest_internal)
  /home/sycl/llvm/sycl/unittests/ur/CMakeLists.txt:3 (add_sycl_unittest)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suggest we investigate this and apply as a follow-up. Left a TODO 088ab4f.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah seems like an existing cmake bug, this workaround is fine for now

Copy link
Contributor

Choose a reason for hiding this comment

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

if you arent planning on investing the cmake bug yourself pls make a gh issue and assign it to me, thx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll try to investigate this

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks, i expect we just need to check if the option is enabled before creating the cmake target or something

Copy link
Contributor

@sarnex sarnex left a comment

Choose a reason for hiding this comment

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

lgtm thx

continue
# Check if any non-comment string was added.
for line in lines[4:]:
if line.startswith("+") and not line[1:].lstrip().startswith("//"):
Copy link
Contributor

Choose a reason for hiding this comment

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

in theory we also could consider block comments /* */ but those arent widely used and it's not like it's that bad if we run the job anyway

@KornevNikita
Copy link
Contributor Author

Failures are unrelated.

@KornevNikita KornevNikita merged commit 8100152 into intel:sycl Feb 10, 2026
26 of 34 checks passed
@KornevNikita KornevNikita deleted the clang-tidy branch February 10, 2026 11:20
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.

2 participants

Comments