-
Notifications
You must be signed in to change notification settings - Fork 37.7k
lint: Add linter for circular dependencies #13695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Neato! :) Tested ACK on bash 3.2.57(1)-release (macOS). |
Fixed inconsistent trailing space between cases. |
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
# | ||
# Make sure only lowercase alphanumerics (a-z0-9), underscores (_), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description should be updated :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated description. Thanks!
"wallet/fees -> wallet/wallet -> wallet/fees" | ||
"wallet/rpcwallet -> wallet/wallet -> wallet/rpcwallet" | ||
"wallet/wallet -> wallet/walletdb -> wallet/wallet" | ||
"policy/fees -> policy/policy -> validation -> policy/fees" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Please sort these entries to make it easy to find a specific circular dependency in the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are sorted consistent with the output of contrib/devtools/circular-dependencies.py
, which is deterministic. #13228 (comment)
Very very nice! This will help us get rid of circular dependencies permanently! Thanks for doing this. ACK 54f16f23e886f6c37189aa53c86cdb0cefa809ea modulo nits |
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
ACK 5c613aa |
utACK 5c613aa |
5c613aa lint: Add linter for circular dependencies (Ben Woosley) Pull request description: 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: ``` $ test/lint/lint-circular-dependencies.sh A new circular dependency in the form of "qt/paymentserver -> qt/walletmodel -> qt/paymentserver" appears to have been introduced. $ echo $? 1 $ test/lint/lint-circular-dependencies.sh Good job! The circular dependency "Fake" is no longer present. Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in test/lint/lint-circular-dependencies.sh to make sure this circular dependency is not accidentally reintroduced. $ echo $? 1 $ test/lint/lint-circular-dependencies.sh $ echo $? 0 ``` Tree-SHA512: 4519434de29f6d50859daed1480e531c01c1cdbc3f0a5f093251daf62ae2b5b9073fb274b86f541a985e06837aa1165b76558c5f35fb51a759d72e83f1b61e44
Summary: 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 --- This is a backport of Core [[bitcoin/bitcoin#13695 | PR13695]] Test Plan: run ./test/lint/lint-circular-dependencies.py see output that points existing unexpected dependencies, expected dependencies that aren't present and unexpected dependencies that are. Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D5962
Summary: 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 --- This is a backport of Core [[bitcoin/bitcoin#13695 | PR13695]] Test Plan: run ./test/lint/lint-circular-dependencies.py see output that points existing unexpected dependencies, expected dependencies that aren't present and unexpected dependencies that are. Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D5962
5c613aa lint: Add linter for circular dependencies (Ben Woosley) Pull request description: 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: ``` $ test/lint/lint-circular-dependencies.sh A new circular dependency in the form of "qt/paymentserver -> qt/walletmodel -> qt/paymentserver" appears to have been introduced. $ echo $? 1 $ test/lint/lint-circular-dependencies.sh Good job! The circular dependency "Fake" is no longer present. Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in test/lint/lint-circular-dependencies.sh to make sure this circular dependency is not accidentally reintroduced. $ echo $? 1 $ test/lint/lint-circular-dependencies.sh $ echo $? 0 ``` Tree-SHA512: 4519434de29f6d50859daed1480e531c01c1cdbc3f0a5f093251daf62ae2b5b9073fb274b86f541a985e06837aa1165b76558c5f35fb51a759d72e83f1b61e44
5c613aa lint: Add linter for circular dependencies (Ben Woosley) Pull request description: 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: ``` $ test/lint/lint-circular-dependencies.sh A new circular dependency in the form of "qt/paymentserver -> qt/walletmodel -> qt/paymentserver" appears to have been introduced. $ echo $? 1 $ test/lint/lint-circular-dependencies.sh Good job! The circular dependency "Fake" is no longer present. Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in test/lint/lint-circular-dependencies.sh to make sure this circular dependency is not accidentally reintroduced. $ echo $? 1 $ test/lint/lint-circular-dependencies.sh $ echo $? 0 ``` Tree-SHA512: 4519434de29f6d50859daed1480e531c01c1cdbc3f0a5f093251daf62ae2b5b9073fb274b86f541a985e06837aa1165b76558c5f35fb51a759d72e83f1b61e44
5c613aa lint: Add linter for circular dependencies (Ben Woosley) Pull request description: 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: ``` $ test/lint/lint-circular-dependencies.sh A new circular dependency in the form of "qt/paymentserver -> qt/walletmodel -> qt/paymentserver" appears to have been introduced. $ echo $? 1 $ test/lint/lint-circular-dependencies.sh Good job! The circular dependency "Fake" is no longer present. Please remove it from EXPECTED_CIRCULAR_DEPENDENCIES in test/lint/lint-circular-dependencies.sh to make sure this circular dependency is not accidentally reintroduced. $ echo $? 1 $ test/lint/lint-circular-dependencies.sh $ echo $? 0 ``` Tree-SHA512: 4519434de29f6d50859daed1480e531c01c1cdbc3f0a5f093251daf62ae2b5b9073fb274b86f541a985e06837aa1165b76558c5f35fb51a759d72e83f1b61e44
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: