HighCommander4 wrote: > Given that this is a bigger design call, I’d like to pull in folks from the > clang-tools-extra maintainer list for a high-level decision (not on the > implementation details): should include-cleaner support an opt-in “fragment” > concept at all, and if so, what’s the right shape/API? @vbvictor @5chmidti > @HighCommander4 — would you mind weighing in on the direction?
I don't have a firm answer for you but I'm happy to share some thoughts: * It's a recurring challenge to define the scope of a tool like include-cleaner whose purpose is to enforce style rather than correctness, because there are a large variety of coding styles out there, and so there's practically no limit to how much complexity could be added to the tool in an effort to accomodate more coding styles. We have to draw a line somewhere. * For non-self-contained files in particular, my sense based on the discussion in the [clangd feature request](https://github.com/clangd/clangd/issues/45) for supporting them (if you try to open a `.inc` file in your clangd-based editor, you currently get a bunch of red squigglies and limited/no editor functionality) is that, however much we'd like to discourage their use, a fair number of real-world projects use them. I've [said](https://github.com/clangd/clangd/issues/45#issuecomment-1236431099) in that issue that I think clangd should accept thoughtfully designed contributions to improve support for non-self-contained files. * As another data point in this area, I was told by developers at JetBrains, who maintain a proprietary downstream of clangd used in their CLion IDE, that this was one of the first features they added to their downstream. * One practical consideration when evaluating whether a new feature should be in scope is the added complexity and maintenance effort. Looking at the [clang-tools-extra maintainer list](https://github.com/llvm/llvm-project/blob/ed8f080737dec39212cad72100670c3a21de7720/clang-tools-extra/Maintainers.rst), I don't see an active maintainer for `include-cleaner`, which worries me. I'd feel better about endorsing this change if someone were to step up to fill that role. On the topic of putting this feature (if we decide to move forward with it) into the include-cleaner library: yes please. "I get different diagnostics in clang-tidy vs. clangd" is a recurring source of clangd bug reports. https://github.com/llvm/llvm-project/pull/180282 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
