Remove redundant includes. Conform to header include guidelines. #12542

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:include-guidelines changing 3 files +0 −3
  1. practicalswift commented at 6:20 PM on February 26, 2018: contributor

    From the header include guidelines (developer-notes.md):

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

    Covered in this PR:

    • rpc/util.h includes pubkey.h + utilstrencodings.h. rpc/util.cpp includes rpc/util.h.
    • util.h includes fs.h. util.cpp includes util.h.
  2. randolf approved
  3. in src/rpc/util.cpp:11 in 62b04c422a outdated
       3 | @@ -4,11 +4,9 @@
       4 |  
       5 |  #include <base58.h>
       6 |  #include <keystore.h>
       7 | -#include <pubkey.h>
       8 |  #include <rpc/protocol.h>
       9 |  #include <rpc/util.h>
      10 |  #include <tinyformat.h>
      11 | -#include <utilstrencodings.h>
    


    sipa commented at 6:45 PM on February 27, 2018:

    utilstrencodings.h seems to be included in rpc/util.h for no reason. Maybe it's better to remove it there?

  4. Remove redundant includes. Conform to header include guidelines.
    From the header include guidelines (developer-notes.md):
    
    "One exception is that a `.cpp` file does not need to re-include the
     includes already included in its corresponding `.h` file."
    
    * rpc/util.h includes pubkey.h + utilstrencodings.h. rpc/util.cpp includes rpc/util.h.
    * util.h includes fs.h. util.cpp includes util.h.
    7ef46d063a
  5. practicalswift force-pushed on Feb 27, 2018
  6. practicalswift commented at 9:36 PM on February 27, 2018: contributor

    @sipa Thanks for reviewing! Feedback addressed. Please re-review :-)

  7. fanquake added the label Refactoring on Feb 28, 2018
  8. Empact commented at 12:57 AM on March 1, 2018: member

    utACK 7ef46d0

  9. eklitzke approved
  10. eklitzke commented at 8:00 AM on March 11, 2018: contributor

    utACK 7ef46d063aaeb3411047ef249adcfeab63a2d6e9

    Curious if you've tried using iwyu at all. There are so many header/forward include violations in the source code that it's hard to imagine the output would be comprehensible, but it can help with this kind of task.

  11. practicalswift commented at 9:34 AM on March 11, 2018: contributor

    @eklitzke No I haven't tried iwyu yet. These violations were found using my lint-includes.sh script which has been submitted as PR #11878 :-)

    When this PR is merged I can try iwyu and see if it finds something worth fixing :-)

  12. ryanofsky commented at 2:59 PM on March 12, 2018: member

    When this PR is merged I can try iwyu and see if it finds something worth fixing :-)

    I sometimes use IWYU. I posted steps to run it with bitcoin at #11878 (comment)

  13. sipa commented at 11:55 PM on March 16, 2018: member

    utACK 7ef46d063aaeb3411047ef249adcfeab63a2d6e9

  14. sipa merged this on Mar 17, 2018
  15. sipa closed this on Mar 17, 2018

  16. sipa referenced this in commit af20f9b1d4 on Mar 17, 2018
  17. jasonbcox referenced this in commit e97acbfcb5 on Oct 31, 2020
  18. practicalswift deleted the branch on Apr 10, 2021
  19. PastaPastaPasta referenced this in commit ee3d2ac624 on Jun 27, 2021
  20. PastaPastaPasta referenced this in commit 01a8ade28a on Jun 28, 2021
  21. PastaPastaPasta referenced this in commit 5574ba281c on Jun 29, 2021
  22. DrahtBot locked this on Aug 18, 2022

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-16 15:15 UTC

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