kbobyrev added a comment.

In D123488#3444900 <https://reviews.llvm.org/D123488#3444900>, @dsanders11 
wrote:

> Cool stuff! Chiming in randomly here, but I've been keeping a loose eye on 
> the progress of IncludeCleaner.
>
> I've been using IncludeCleaner to power include cleanup in the Chromium code 
> base for the past few months, and have built Python scripts around it so I 
> can more efficiently use it at a code base level. You can find all that fun 
> stuff on my repo: https://github.com/dsanders11/chromium-include-cleanup
>
> In my usages, I've found there are three categories of ignores I need (you 
> can see my ongoing list of them in the config file: 
> https://github.com/dsanders11/chromium-include-cleanup/blob/main/configs/chromium.json):
>
> - Skip over a file entirely and don't provide any diagnostics for it. This is 
> useful to ignore umbrella headers, without needing to ignore the headers 
> included in that umbrella header.
> - Ignore diagnostics for a particular header, which is what is implemented 
> here so far.
> - Ignore an include edge (filename, header). This is useful for cases where 
> it's a spurious diagnostic, like when the usage is inside of a macro 
> definition, so IncludeCleaner thinks it is unused but it is not.
>
> This isn't entirely applicable here, but could be insightful: I initially I 
> had my filtering mechanism in the script which ran clangd over the source 
> files, but I found that it was better for my needs to decouple the filtering 
> from the generating the diagnostics. Main reason being that generating the 
> diagnostics for all 80k files in the Chromium code base takes hours to run, 
> so if I found some new ignores I wanted to add, I'd have to do another 7 hour 
> run (on the hardware I'm using), which wasn't efficient. So I let the many 
> script output all diagnostics, and then I filter after the fact, letting me 
> tweak the filtering without needing to re-run the whole thing. So for my own 
> needs I'll probably stick with doing the filtering after the fact, even if 
> it's built-in. Not too applicable for IncludeCleaner usage through say VS 
> Code, but there are different challenges when doing it at code base level.

Hi David! This is really interesting, thank you very much for sharing! This is 
a really exciting use case and I'll look into the code that you have!

I think you might be interested in a more generic effort we're currently 
investing into: we want to make Include Cleaner a library and make it possible 
for the users to run it from Clang-Tidy and standalone tools 
(https://reviews.llvm.org/D121593). Is that something that would be potentially 
interesting to you?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123488/new/

https://reviews.llvm.org/D123488

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to