My IDE is running clang-tidy (v20) on my C++ code. I have an enum where one of the identifiers is isnt_owning
. And - clang tidy complains about the typo. <sarcasm>Thanks a bunch! I'll go right ahead and fix it by calling my enum value isn't_owning
, I'm sure my compiler would be thrilled!</sarcasm>
So, how can I make clang tidy continue checking for typos, but not make this rather inane kind of complaint? Or - is it actually a clang-tidy bug I should report?
My IDE is running clang-tidy (v20) on my C++ code. I have an enum where one of the identifiers is isnt_owning
. And - clang tidy complains about the typo. <sarcasm>Thanks a bunch! I'll go right ahead and fix it by calling my enum value isn't_owning
, I'm sure my compiler would be thrilled!</sarcasm>
So, how can I make clang tidy continue checking for typos, but not make this rather inane kind of complaint? Or - is it actually a clang-tidy bug I should report?
Share Improve this question edited 18 hours ago einpoklum asked 19 hours ago einpoklumeinpoklum 132k76 gold badges412 silver badges844 bronze badges 12 | Show 7 more comments1 Answer
Reset to default 0Here are various ways to suppress linting in general, not just spelling.
auto isnt_1{0}; // NOLINT - just this line
// NOLINTNEXTLINE(???) can't find a warning ??? to suppress for spelling
auto isnt_2{0}; // shows error
// NOLINTBEGIN suppress lint on a block
auto isnt_3{0};
auto isnt_4{0};
// NOLINTEND
auto isnt_5{0}; // shows misspelling because line active
isnt
to the word list that clang-tidy is using? – Eljay Commented 19 hours agoisn`t_owning
. All better! – Botje Commented 19 hours agonot_working
or just turn off spell checking. Who spell checks code? – Geoduck Commented 19 hours agoowning
, notworking
. But that's a decent idea. Doesn't answer the question though, plus, sometimes,not_working
implies that the value is the same asnot (is_working)
- which may not be the case. – einpoklum Commented 18 hours ago