This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Extend IdentifierNamingCheck per file config
ClosedPublic

Authored by njames93 on Nov 5 2020, 1:47 AM.

Details

Summary

Add IgnoreMainLikeFunctions to the per file config. This can be extended for new options added to the check easily.

Diff Detail

Event Timeline

njames93 created this revision.Nov 5 2020, 1:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 5 2020, 1:47 AM
njames93 requested review of this revision.Nov 5 2020, 1:47 AM

Is there a way to test this functionality out?

Is there a way to test this functionality out?

There's already tests for loading the individual styles from other files, I'm sure I could extend that

Is there a way to test this functionality out?

There's already tests for loading the individual styles from other files, I'm sure I could extend that

I'd appreciate that, otherwise the changes here all seem reasonable to me so far (though if you wanted to split the formatting changes out into an NFC, those don't even require a review).

Didn't mean for there to be any formatting changes. I'll remove those later too

njames93 updated this revision to Diff 303198.Nov 5 2020, 11:19 AM

Removed unnecessary formatting changes
Added test cases.

With the test cases I removed some cases that actually were never tested due to the order in which clang-tidy handles applying configurations. Right now there just isnt the infrastructure needed to fully test those cases.

aaron.ballman accepted this revision.Nov 5 2020, 11:32 AM

LGTM aside from some tiny nits!

clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
172

Don't use auto when the type isn't spelled out in the initialization.

clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-multiple-styles.cpp
63

Should end the newline back to the end of the file.

This revision is now accepted and ready to land.Nov 5 2020, 11:32 AM
This revision was landed with ongoing or failed builds.Nov 5 2020, 11:51 AM
This revision was automatically updated to reflect the committed changes.
clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp