Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp | ||
---|---|---|
54 | A comma-separated list of regexes to match against suffix of a header, and disable analysis if matched. | |
139 | erroring out only after we performed all of our analysis and build a TU feels unfortunate. can we build these regexes and verify them at main and pass onto action instead? (in case the action is run on multiple files at once, we shouldn't compile/verify regexes over and over again) | |
160 | we actually want to perform filtering inside analyze. it's not enough to filter only when printing, we should also filter before applying fixes :D. but we should also be applying filtering to absolute paths in all cases, for missing includes this is being applied to spelling instead. |
clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp | ||
---|---|---|
160 | oops, good catch. Added an actual --edit test. |
clang-tools-extra/include-cleaner/include/clang-include-cleaner/Analysis.h | ||
---|---|---|
67 ↗ | (On Diff #533896) | can you add some comments about how header filter works? A predicate that receives absolute path or spelling without quotes/brackets, when a phyiscal file doesn't exist. No analysis will be performed for headers that satisfy the predicate. |
72 ↗ | (On Diff #533896) | rather than a default here, can we just do no filtering when HeaderFilter is null ? |
clang-tools-extra/include-cleaner/include/clang-include-cleaner/Types.h | ||
137 ↗ | (On Diff #533896) | again some comments here could be useful |
clang-tools-extra/include-cleaner/lib/Analysis.cpp | ||
65 ↗ | (On Diff #533896) | can you drop Path or put it in comments |
clang-tools-extra/include-cleaner/test/tool.cpp | ||
17 | can you ignore one but keep other? it'd be useful to also test the regex behaviour | |
clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp | ||
104 | same as above, can you either drop or comment out Path | |
106 | same here for Path | |
170–172 | nit: braces | |
230 | nit: might be better to extract this into a function like: std::function<bool(StringRef)> headerFilter() { /* parses flags, returns a null function on failure */ } | |
232 | s/KeepEmpty/KeepEmpty=/ |
clang-tools-extra/include-cleaner/test/tool.cpp | ||
---|---|---|
17 | this tests aims to test filtering logic for both missing-includes and unused-includes cases. added a new test. |
clang-tools-extra/include-cleaner/include/clang-include-cleaner/Types.h | ||
---|---|---|
138 ↗ | (On Diff #536998) | i think name and the comment are somewhat confusing, what about: /// Absolute path for the header, when it's a physical file. Otherwise just the spelling without surrounding quotes/brackets. |
clang-tools-extra/include-cleaner/lib/Analysis.cpp | ||
82 ↗ | (On Diff #536998) | nit: rather than checking this at every use, might be easier to have something like: if (!HeaderFilter) HeaderFilter = +[](llvm::StringRef) { return false; }; |
clang-tools-extra/include-cleaner/test/tool.cpp | ||
17 | we're still lacking a test for regex behaviour, maybe change next one to foob.*\.h ? | |
clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp | ||
225 | nit: Drop Path | |
244 | FilterRegs=std::move(FilterRegs) and drop the shared_ptr? | |
245 | looks like debugging artifact |
clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp | ||
---|---|---|
244 | This was my first attempt, it didn't work, we're returning a lamdba function, which invokes a delete constructor of llvm::Regex. |
can you ignore one but keep other?
it'd be useful to also test the regex behaviour