doc: Revert to previous header include policy #12960

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1804-docIncludes changing 1 files +2 −1
  1. MarcoFalke commented at 1:32 AM on April 12, 2018: member

    It was noted in #12933 that the change to the header include policy was controversial and not agreed upon.

    This reverts the guideline to its initial state.

  2. doc: Revert to previous header include policy
    This partially reverts commit fad0fc3c9a9759dfb2bb1bdf1aaa5e1d08c0ab9c.
    fa548e72c0
  3. MarcoFalke added the label Docs on Apr 12, 2018
  4. MarcoFalke commented at 1:35 AM on April 12, 2018: member

    Can be reviewed by checking out the commit and running:

    $ git diff HEAD~2 HEAD ./doc/ | wc
          0       0       0
    
  5. practicalswift commented at 1:53 AM on April 12, 2018: contributor

    ACK fa548e72c04110f058dfe3a11578dcf629d6906f

  6. sipa commented at 1:56 AM on April 12, 2018: member

    @ryanofsky (responding to your comment in #12933) As I mentioned, the ability to use iwyu seems like a good argument in favor of changing the policy. But then we should:

    • Actually discuss changing the policy, independently from the issue with the linter annoyance
    • Provide instructions/scripts/... on how to use iwyu
  7. ryanofsky commented at 2:36 AM on April 12, 2018: member

    To get specific, I guess the immediate question is whether to keep the sentence:

    One exception is that a .cpp file does not need to re-include the includes already included in its corresponding .h file.

    As Marco pointed out, since it says "does not need to" instead of "shouldn't", this isn't actually incompatible with iwyu like I originally thought in the other issue, so I wouldn't object to it anymore.

    If there is going to be a bigger rewrite, I would like to see something like:

    Every .cpp and .h file should directly #include header files it needs definitions from, without relying on transitive includes from unrelated headers. See WhyIWYU for various considerations and rationale, and consider running the IWYU tool to automatically remove unneeded includes and add/remove forward declarations.

    Admittedly, it is a little awkward right now to use iwyu with bitcoin, though I regularly do, and I previously posted instructions at #11878 (comment). It might be possible to add some build system support that would make iwyu easier to run, but I'd have to look into that.

  8. laanwj commented at 3:32 AM on April 12, 2018: member

    Can we please not spend so much time on this :/

    The back and forth on this, merging and reverting, why is this (which is pretty much just a style issue) suddenly such a contended topic.

  9. MarcoFalke closed this on Apr 13, 2018

  10. MarcoFalke deleted the branch on Apr 13, 2018
  11. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me