Skip to content

Conversation

@nettle
Copy link
Collaborator

@nettle nettle commented Jan 6, 2026

Why:
Bazel rules for clang-tidy and clang --analyze
were never updated and never tested on real projects.

What:

  • Collect sources and headers in transitive dependencies
  • Support platform transitions (for multi platform projects)
  • Simplify launcher scripts, bazelify parameters
  • Fix plist generation for clang --analyze
  • Support config file to accept input from a file_group
  • Remove clang-tidy aspect since it is not actually used
  • Minor cosmetic changes
  • Test on some of real Ericsson projects
  • Updated README

@nettle nettle marked this pull request as draft January 6, 2026 21:40
@nettle nettle force-pushed the 0005R-clang-tidy-analyze branch from 178240f to d6b4caa Compare January 7, 2026 23:16
@nettle nettle marked this pull request as ready for review January 9, 2026 21:35
@nettle nettle requested a review from Szelethus January 9, 2026 21:35
@Szelethus Szelethus requested a review from furtib January 10, 2026 11:24
Copy link
Contributor

@Szelethus Szelethus left a comment

Choose a reason for hiding this comment

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

There are plenty of things happening in this patch. Both the changes and the summary feels like "spring cleaning", sweeping the floors and hammering some nails flush if they wiggled themselves out, and also fixing that wall plug that hasn't worked for years.

Can you give me a bulletpoint list that stated what happens and why? From what I gather

  • Bash script paramaters have been bazelized,
  • Fixing a minor issue with config file inputs when they are from a file group,
  • Changing the parameters of the clang call,
  • Some code cosmetic update,
  • Refactoring the tidy aspect,
  • Removing two tests...

And many others. Which parts are NFC, and change for the sake of making the code more readable? Which parts are NFC, but prepare for a later coming feature (like newer bazel versions)? Which parts are functional, as some seem to be functional, and how are they tested?

I approve of most the changes, but the patch in its current state feels like a proof of concept.

self.grep_file(compile_commands, r"pass\.cc")
self.grep_file(compile_commands, r"\/gcc")

def test_bazel_aspect_clang_tidy_pass(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the context behind deleting these tests?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's because, the aspect used in these tests has been removed, but I'm not sure why it was removed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Separate implementation of aspect for clang-tidy is excessive, and we basically do not use it - it is confusing, a bit difficult to use (complex command line) and most importantly it does not support dependencies which makes it useless in some projects.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved?

self.grep_file(compile_commands, r"pass\.cc")
self.grep_file(compile_commands, r"\/gcc")

def test_bazel_aspect_clang_tidy_pass(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's because, the aspect used in these tests has been removed, but I'm not sure why it was removed.

@furtib
Copy link
Contributor

furtib commented Jan 11, 2026

I forgot to add a big summary.
I think this patch is good. I don't understand the removal of the aspect. Was it unused?

(Also, we should keep in mind that the README should be updated to reflect the removal of the aspect)

@nettle nettle closed this Jan 14, 2026
@nettle nettle deleted the 0005R-clang-tidy-analyze branch January 14, 2026 02:21
@nettle nettle restored the 0005R-clang-tidy-analyze branch January 14, 2026 02:25
@nettle nettle reopened this Jan 14, 2026
@nettle nettle force-pushed the 0005R-clang-tidy-analyze branch from d6b4caa to eff03d0 Compare January 14, 2026 02:32
Why:
Bazel rules for clang-tidy and clang --analyze
were never updated and never tested on real projects.

What:
Update rules after testing on some Ericsson projects
@nettle nettle force-pushed the 0005R-clang-tidy-analyze branch from eff03d0 to cc7d347 Compare January 17, 2026 19:13
@nettle
Copy link
Collaborator Author

nettle commented Jan 17, 2026

There are plenty of things happening in this patch. Both the changes and the summary feels like "spring cleaning", sweeping the floors and hammering some nails flush if they wiggled themselves out, and also fixing that wall plug that hasn't worked for years.

Can you give me a bulletpoint list that stated what happens and why? From what I gather

  • Bash script paramaters have been bazelized,
  • Fixing a minor issue with config file inputs when they are from a file group,
  • Changing the parameters of the clang call,
  • Some code cosmetic update,
  • Refactoring the tidy aspect,
  • Removing two tests...

And many others. Which parts are NFC, and change for the sake of making the code more readable? Which parts are NFC, but prepare for a later coming feature (like newer bazel versions)? Which parts are functional, as some seem to be functional, and how are they tested?

I approve of most the changes, but the patch in its current state feels like a proof of concept.

Done

@nettle
Copy link
Collaborator Author

nettle commented Jan 17, 2026

I forgot to add a big summary. I think this patch is good. I don't understand the removal of the aspect. Was it unused?

(Also, we should keep in mind that the README should be updated to reflect the removal of the aspect)

Done

Copy link
Contributor

@Szelethus Szelethus left a comment

Choose a reason for hiding this comment

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

Thanks for the summary update! As a preface, I agree with the direction and, as much as I understand, with the way you implemented it as well.

I've spent some time with the patch, but I admit that for me, it is simply too big and too complicated to decipher which line changes are attributed to which point in the bulletpoint list. That means I can't do anything beyond a "looks about right" review.

With that said, I'm actually fine with landing the patch as-is, since you are the main maintainer of these rules and I take your word that it satisfies real-world usage needs.

The only issue that remains for me is testing. For the following points:

  • Support platform transitions (for multi-platform projects)

I suppose this is borderline impossible to write tests for here.

  • Fix plist generation for clang --analyze

What was the specific issue you were experiencing? Can you add tests for it?

  • Support config file to accept input from a file_group

Can we add a test for this?

  • Collect sources and headers in transitive dependencies
  • Simplify launcher scripts, bazelify parameters
  • Minor cosmetic changes
  • Updated README

Do I understand correctly that all of these are NFC changes?

With tests added and the NFC changes clarified, the patch is ready to land.

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.

3 participants