This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Allow disabling support for NOLINTBEGIN/NOLINTEND blocks.
ClosedPublic

Authored by ymandel on Dec 2 2021, 11:59 AM.

Details

Summary

This patch parameterizes the clang-tidy diagnostic consumer with a boolean that controls whether to honor NOLINTBEGIN/NOLINTEND blocks. The current support for scanning these blocks is very costly -- O(n*m) in the size of files (n) and number of diagnostics found (m), with a large constant factor. So, the patch allows clients to disable it.

Future patches should make the feature more efficient, but this will mitigate in the interim.

Diff Detail

Event Timeline

ymandel created this revision.Dec 2 2021, 11:59 AM
ymandel requested review of this revision.Dec 2 2021, 11:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2021, 11:59 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
ymandel updated this revision to Diff 391450.Dec 2 2021, 1:48 PM

change to "enabled-by-default"

ymandel retitled this revision from [clang-tidy] Disable support for NOLINTBEGIN/NOLINTEND blocks by default. to [clang-tidy] Allow disabling support for NOLINTBEGIN/NOLINTEND blocks..Dec 2 2021, 1:50 PM
ymandel edited the summary of this revision. (Show Details)
gribozavr2 accepted this revision.Dec 2 2021, 2:04 PM

Thank you for a quick workaround!

This revision is now accepted and ready to land.Dec 2 2021, 2:04 PM
ymandel updated this revision to Diff 391455.Dec 2 2021, 2:07 PM

remove incorrect line in comment

This revision was landed with ongoing or failed builds.Dec 2 2021, 2:19 PM
This revision was automatically updated to reflect the committed changes.