diff options
author | Salman Javed <mail@salmanjaved.org> | 2021-09-28 07:52:12 -0400 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2021-09-28 07:53:23 -0400 |
commit | c0687e1984a82925918c874b7bb68ad34c32aed0 (patch) | |
tree | 8c72d06c90aa9c9ec96098674f607e7497ab83ee /lldb/source/Commands/CommandObjectThread.cpp | |
parent | e2f6290e06be63149af770197b772248369ac038 (diff) | |
download | llvm-c0687e1984a82925918c874b7bb68ad34c32aed0.zip llvm-c0687e1984a82925918c874b7bb68ad34c32aed0.tar.gz llvm-c0687e1984a82925918c874b7bb68ad34c32aed0.tar.bz2 |
Add support for `NOLINTBEGIN` ... `NOLINTEND` comments
Add support for NOLINTBEGIN ... NOLINTEND comments to suppress
clang-tidy warnings over multiple lines. All lines between the "begin"
and "end" markers are suppressed.
Example:
// NOLINTBEGIN(some-check)
<Code with warnings to be suppressed, line 1>
<Code with warnings to be suppressed, line 2>
<Code with warnings to be suppressed, line 3>
// NOLINTEND(some-check)
Follows similar syntax as the NOLINT and NOLINTNEXTLINE comments
that are already implemented, i.e. allows multiple checks to be provided
in parentheses; suppresses all checks if the parentheses are omitted,
etc.
If the comments are misused, e.g. using a NOLINTBEGIN but not
terminating it with a NOLINTEND, a clang-tidy-nolint diagnostic
message pointing to the misuse is generated.
As part of implementing this feature, the following bugs were fixed in
existing code:
IsNOLINTFound(): IsNOLINTFound("NOLINT", Str) returns true when Str is
"NOLINTNEXTLINE". This is because the textual search finds NOLINT as
the stem of NOLINTNEXTLINE.
LineIsMarkedWithNOLINT(): NOLINTNEXTLINEs on the very first line of a
file are ignored. This is due to rsplit('\n\').second returning a blank
string when there are no more newline chars to split on.
Diffstat (limited to 'lldb/source/Commands/CommandObjectThread.cpp')
0 files changed, 0 insertions, 0 deletions