--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CADjAqN588KQpysRo1pxYeOLjHxgxBwDu1sAudBrioVXrakKfKw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAGFX3sHP-y-FGVM8uohXHcQLRb3NsxURS1uJEyDJ2jg1XfU62g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CADjAqN5A6wZuH_P0pByKH3mO9jHRzymXbRi8Q1C1jDJmeypXqQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFDoaxm4Q%2Bi3x9EmLb%2BUhgG_9Hb3ZEhSnQ1TgCVmMaD05g%40mail.gmail.com.
It's probably not worth making an exception, but this isn't a style rule I see enforced much by reviewers anyway because we have no automatic enforcement and manual enforcement is extremely tedious.On Fri, May 27, 2022 at 11:35 AM 'Peter Kasting' via cxx <c...@chromium.org> wrote:When we last informally discussed this, the conclusion was to follow the style guide and make no exception for chromium. I have been guiding accordingly since that time.The public iwyu tool is kind of a red herring. It was forked from the internal tool long ago and is not maintained by googlers.I don't think there's a compile time argument here -- just scanning the lines of a header for the trailing end of an include guard don't cost a measurable amount afaik. It's parsing that's expensive.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CADjAqN4AnqRw01zNpTNn5EBqY5uWPBO2uAqJd%2BRTwbwNEtxgzg%40mail.gmail.com.
does google3 have IWYU tooling?
google3 has IWYU tooling, but there's a lot of duct tape holding it together, too. (Lots of headers with special case pragmas.) The IWYU rule itself needs to be simplified to make it more tractable.We originally discussed removal of the related header rule back in 2019:There wasn't much controversy at the time (I'll do some more archive trawling); I think there may have been more discussion later. It boils down to the principle of following the Google C++ style guide unless there's a really good reason not to, and in this case, there wasn't a good reason not to. Compliance is uneven because it's a hard rule to automate, but it's still the official rule.
On Fri, May 27, 2022 at 1:07 PM K. Moon <km...@chromium.org> wrote:google3 has IWYU tooling, but there's a lot of duct tape holding it together, too. (Lots of headers with special case pragmas.) The IWYU rule itself needs to be simplified to make it more tractable.We originally discussed removal of the related header rule back in 2019:There wasn't much controversy at the time (I'll do some more archive trawling); I think there may have been more discussion later. It boils down to the principle of following the Google C++ style guide unless there's a really good reason not to, and in this case, there wasn't a good reason not to. Compliance is uneven because it's a hard rule to automate, but it's still the official rule.IMO the failure case is this coming up in code review at all, and we now see that it is. The result on the readability of the code is none, the impact on IWYU is none, right? I think we should explicitly say reviewers should accept either.
PK
In no case should there be "back and forth". "But there was!" Yes, because Charlie didn't know the Google style rule. Now he does. Problem solved.
On Fri, May 27, 2022 at 11:33 AM <dan...@chromium.org> wrote:On Fri, May 27, 2022 at 2:29 PM Peter Kasting <pkas...@google.com> wrote:On Fri, May 27, 2022 at 11:26 AM <dan...@chromium.org> wrote:On Fri, May 27, 2022 at 1:07 PM K. Moon <km...@chromium.org> wrote:google3 has IWYU tooling, but there's a lot of duct tape holding it together, too. (Lots of headers with special case pragmas.) The IWYU rule itself needs to be simplified to make it more tractable.We originally discussed removal of the related header rule back in 2019:There wasn't much controversy at the time (I'll do some more archive trawling); I think there may have been more discussion later. It boils down to the principle of following the Google C++ style guide unless there's a really good reason not to, and in this case, there wasn't a good reason not to. Compliance is uneven because it's a hard rule to automate, but it's still the official rule.IMO the failure case is this coming up in code review at all, and we now see that it is. The result on the readability of the code is none, the impact on IWYU is none, right? I think we should explicitly say reviewers should accept either.The impact on the internal IWYU is not none, which is why the rule was adopted internally.Why do we need to carve out exceptions in our style guide when questions that the style guide answers come up? "The fact that the question came up" is not a good reason to add the cognitive load of Yet Another Chromium Style Rule, IMO.Because if you copy existing code, it no longer complies with the style guide and you get forced into making low-value changes, or having some back and forth about it. Our code all looks this way, so we should explicitly accept it until we have used tools to make it not.That's a general argument that we should never adopt a style rule until we can make it true across the codebase.
IMO the failure case is this coming up in code review at all, and we now see that it is. The result on the readability of the code is none, the impact on IWYU is none, right? I think we should explicitly say reviewers should accept either.
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/dd6b0001-936b-4913-9b77-23144118b23fn%40chromium.org.
I like this idea. What would a prototype look like?
On Tue, May 31, 2022 at 11:14 AM K. Moon <km...@chromium.org> wrote:I like this idea. What would a prototype look like?Kind of like PRESUBMIT.py, with an auto-apply option?i.e. just a list of [{"include": "base/foo.h", "include_if": "base::Foo", "exclude_if": "class Foo;"},...](need `exclude_if` from experience, e.g. in this case for fwd-decls)Force-applied on the codebase for new entries.Could probably get messy though (i.e. my scripts usually ignore base::Foo* pointers)... Alternatively, can we just restrain an existing IWYU tool to Chromium headers only (no system, no third-party by default)?
Wouldn't we want to extend cpplint to support Chromium header files, and then expand the coverage of cpplint?Potentially we should be expanding the coverage of cpplint first because right now if it is run on, say, all of base, it finds lots of iwyu issues even without any expansion of what is checked.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAJTZ7L%2BM9_kgr%2BPErDvXQTFo4NytrYNd8vsmV8mu-6Mig-87PA%40mail.gmail.com.
FWIW, what IWYU tool do people use when working on Chromium? Is there a doc/page on this to help Chromium contributors? Thanks!