This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy][include-cleaner] Add option to control deduplication of findings per symbol
ClosedPublic

Authored by kadircet on Aug 8 2023, 5:55 AM.
Tokens
"Like" token, awarded by PiotrZSL.

Details

Summary

We received some user feedback around this being disruptful rather than
useful in certain workflows so add an option to control the output behaviour.

Diff Detail

Event Timeline

kadircet created this revision.Aug 8 2023, 5:55 AM
Herald added a project: Restricted Project. · View Herald Transcript
kadircet requested review of this revision.Aug 8 2023, 5:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 5:55 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
VitaNuo accepted this revision.Aug 8 2023, 6:26 AM

Thanks.

clang-tools-extra/clang-tidy/misc/IncludeCleanerCheck.h
48

Nit: let's name this similar or same to the option, i.e., const bool DeduplicateFindings. It might be easier to digest.

clang-tools-extra/unittests/clang-tidy/IncludeCleanerTest.cpp
150

Nit: check that these are actually different findings (i.e., stemming from different symbol refs).

This revision is now accepted and ready to land.Aug 8 2023, 6:26 AM
kadircet updated this revision to Diff 548190.Aug 8 2023, 6:29 AM
kadircet marked 2 inline comments as done.

Address comments

This revision was landed with ongoing or failed builds.Aug 8 2023, 7:02 AM
This revision was automatically updated to reflect the committed changes.
PiotrZSL added inline comments.Aug 8 2023, 7:08 AM
clang-tools-extra/docs/ReleaseNotes.rst
195

invalid release note should be something like:

Improved :doc:`misc-include-cleaner <clang-tidy/checks/misc/include-cleaner>` check by adding option `DeduplicateFindings` to output one finding per symbol occurence.

Also this list is sorted per check, so it should be before modernize-loop-convert.

clang-tools-extra/docs/clang-tidy/checks/misc/include-cleaner.rst
40

true -> true