This furtherly improves r295303: [clang-tidy] Ignore spaces between globs in the Checks option.
Trims all whitespaces and not only spaces and correctly computes the offset of the checks list (taking the size before trimming).
Details
Diff Detail
- Build Status
Buildable 4475 Build 4475: arc lint + arc unit
Event Timeline
Hi Alex and sorry for the late reply.
The main use case is a more readable .clang-tidy configuration checks.
Before this correction one can use something like this:
--- Checks: ' ,*, ,-cert-dcl03-c, ' ...
It works, but is hardly comprehensible to a newbie (the strange use of addtional commas).
Since the spaces are ignored (since a recent commit of yours) we can add spaces after the leading comma and hope that no user uses a tab...
After applying this patch, we can just write (with tabs or spaces and as many newlines as we want - used for grouping for instance):
--- Checks: ' *, -cert-dcl03-c, ' ...
Additionaly, you can sometimes accidentally issue a tabulator on the command line and that's just nice to ignore it.
Currently, one can use YAML folded strings to split the list of checks to multiple lines:
Checks: > -*, cert-dcl03-c
So it's not necessary to trim newlines. And tabs are forbidden in YAML: http://www.yaml.org/faq.html. So I'd suggest to leave .trim(' '). The rest of the change looks good - thanks for catching the bug ;)
There's one more trim() you missed. And the test needs to be updated (s/\\n/ /).
clang-tidy/ClangTidyDiagnosticConsumer.cpp | ||
---|---|---|
133 | s/trim()/trim(' ')/ |
s/trim()/trim(' ')/