This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix lint warnings in clang-tidy source code (NFC)
ClosedPublic

Authored by salman-javed-nz on Oct 29 2021, 10:06 PM.

Details

Summary

Run clang-tidy on all source files under clang-tools-extra/clang-tidy
with -header-filter=clang-tidy.* and make suggested corrections.

Diff Detail

Event Timeline

salman-javed-nz requested review of this revision.Oct 29 2021, 10:06 PM

No functional change is intended.

The majority of clang-tidy check infractions were

  • readability-identifier-naming
  • llvm-qualified-auto
  • llvm-namespace-comment

I have also fixed obvious typos wherever I noticed them.

carlosgalvezp accepted this revision.Oct 30 2021, 1:20 AM

Looks great, thanks for fixing! I'm surprised we don't have a CI bot running these checks post-merge?

Since this is my first review it's probably good to wait for other reviewers before merging in case I missed something.

This revision is now accepted and ready to land.Oct 30 2021, 1:20 AM

Looks great, thanks for fixing! I'm surprised we don't have a CI bot running these checks post-merge?

You would think so, but it looks like automatic checking during CI was disabled in this commit:
https://github.com/google/llvm-premerge-checks/commit/b69eb6f3647ecb67ff85e551323b3445acde684b

Anyway, even if you run clang-tidy manually, you could miss many issues. A number of warnings are in the header files, and they only get revealed if you set --header-filter properly to look at them.

I will leave this review open for a few days in case other people have comments to add. This patch isn't urgent.