lint: Add linter for circular dependencies #13695

pull Empact wants to merge 1 commits into bitcoin:master from Empact:circ-lint changing 1 files +84 −0
  1. Empact commented at 9:30 pm on July 17, 2018: member

    Protects against added circular depencies, makes it explicit in the code when circular dependencies have been removed.

    Modeled after EXPECTED_BOOST_INCLUDES in lint-includes.sh

    Example output:

     0$ test/lint/lint-circular-dependencies.sh 
     1A new circular dependency in the form of "qt/paymentserver -> qt/walletmodel -> qt/paymentserver" appears to have been introduced.
     2
     3$ echo $?
     41
     5$ test/lint/lint-circular-dependencies.sh 
     6Good job! The circular dependency "Fake" is no longer present.
     7Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in test/lint/lint-circular-dependencies.sh
     8to make sure this circular dependency is not accidentally reintroduced.
     9
    10$ echo $?
    111
    12$ test/lint/lint-circular-dependencies.sh 
    13$ echo $?
    140
    
  2. fanquake added the label Scripts and tools on Jul 17, 2018
  3. l2a5b1 commented at 0:37 am on July 18, 2018: contributor
    Neato! :) Tested ACK on bash 3.2.57(1)-release (macOS).
  4. Empact force-pushed on Jul 18, 2018
  5. Empact commented at 3:24 am on July 18, 2018: member
    Fixed inconsistent trailing space between cases.
  6. in test/lint/lint-circular-dependencies.sh:7 in 54f16f23e8 outdated
    0@@ -0,0 +1,85 @@
    1+#!/usr/bin/env bash
    2+#
    3+# Copyright (c) 2018 The Bitcoin Core developers
    4+# Distributed under the MIT software license, see the accompanying
    5+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
    6+#
    7+# Make sure only lowercase alphanumerics (a-z0-9), underscores (_),
    


    practicalswift commented at 7:27 am on July 18, 2018:
    Description should be updated :-)

    Empact commented at 1:14 pm on July 18, 2018:
    Updated description. Thanks!
  7. in test/lint/lint-circular-dependencies.sh:35 in 54f16f23e8 outdated
    31+    "validation -> validationinterface -> validation"
    32+    "wallet/coincontrol -> wallet/wallet -> wallet/coincontrol"
    33+    "wallet/fees -> wallet/wallet -> wallet/fees"
    34+    "wallet/rpcwallet -> wallet/wallet -> wallet/rpcwallet"
    35+    "wallet/wallet -> wallet/walletdb -> wallet/wallet"
    36+    "policy/fees -> policy/policy -> validation -> policy/fees"
    


    practicalswift commented at 7:28 am on July 18, 2018:
    Nit: Please sort these entries to make it easy to find a specific circular dependency in the list.

    Empact commented at 1:14 pm on July 18, 2018:
    These are sorted consistent with the output of contrib/devtools/circular-dependencies.py, which is deterministic. #13228 (comment)
  8. practicalswift commented at 7:51 am on July 18, 2018: contributor

    Very very nice! This will help us get rid of circular dependencies permanently! Thanks for doing this.

    ACK 54f16f23e886f6c37189aa53c86cdb0cefa809ea modulo nits

  9. lint: Add linter for circular dependencies
    Protects against added circular depencies, makes it explicit in the
    code when circular dependencies have been removed.
    
    Modeled after EXPECTED_BOOST_INCLUDES in lint-includes.sh
    5c613aadd6
  10. Empact force-pushed on Jul 18, 2018
  11. practicalswift commented at 2:45 pm on July 18, 2018: contributor
    ACK 5c613aadd64453c75cb2373c6fcc1326c3cf0b7a
  12. laanwj commented at 2:22 pm on July 20, 2018: member
    utACK 5c613aadd64453c75cb2373c6fcc1326c3cf0b7a
  13. laanwj merged this on Jul 20, 2018
  14. laanwj closed this on Jul 20, 2018

  15. laanwj referenced this in commit dcc0cffbcf on Jul 20, 2018
  16. deadalnix referenced this in commit 40951742d8 on May 5, 2020
  17. ftrader referenced this in commit 76834ac811 on Aug 17, 2020
  18. PastaPastaPasta referenced this in commit d8926630a5 on Feb 2, 2021
  19. PastaPastaPasta referenced this in commit cd59867e7b on Feb 4, 2021
  20. gades referenced this in commit 212c834cb4 on Jul 1, 2021
  21. 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: 2024-11-17 09:12 UTC

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