This is an archive of the discontinued LLVM Phabricator instance.

Add clang-tidy -line-filter option to filter findings by line ranges.
ClosedPublic

Authored by alexfh on May 22 2014, 6:08 AM.

Details

Summary

This is going to be used for a clang-tidy-diff script to display
warnings in changed lines only. The option uses JSON, as its value is not
intended to be entered manually.

Diff Detail

Event Timeline

alexfh updated this revision to Diff 9694.May 22 2014, 6:08 AM
alexfh retitled this revision from to Add clang-tidy -line-filter option to filter findings by line ranges..
alexfh updated this object.
alexfh edited the test plan for this revision. (Show Details)
alexfh added a reviewer: klimek.
alexfh added a subscriber: Unknown Object (MLST).
klimek added inline comments.May 22 2014, 7:05 AM
clang-tidy/ClangTidyDiagnosticConsumer.cpp
273

Debug output?

clang-tidy/ClangTidyDiagnosticConsumer.h
175

That's a strange interface. I assume you want to remove some duplication that way? If true, I'd rather pull out the common code into a 3rd helper function and use that from both places.

clang-tidy/ClangTidyOptions.h
23

// LineRange is a pair<start, end> (inclusive).
Or something like that.

alexfh updated this revision to Diff 9699.May 22 2014, 8:10 AM

Removed debug output, added a comment for LineRange, changed the interface of
ClangTidyDiagnosticConsumer::relatesToUserCodeAndPassesLineFilter (and renamed it).

klimek accepted this revision.May 22 2014, 8:58 AM
klimek edited edge metadata.

lg

This revision is now accepted and ready to land.May 22 2014, 8:58 AM
alexfh closed this revision.May 22 2014, 9:14 AM