-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Simplify include analysis by enforcing the developer guide's include syntax #13230
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
Simplify include analysis by enforcing the developer guide's include syntax #13230
Conversation
0e57f8d to
9d8f70a
Compare
contrib/devtools/lint-includes.sh
Outdated
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.
leading / missing
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.
Thanks! Fixed!
9d8f70a to
1bf1635
Compare
1bf1635 to
1187503
Compare
src/test/blockchain_tests.cpp
Outdated
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.
Including a cpp file seems extremely wrong. (I know this is not your fault, just leaving a note)
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.
|
The developer guidelines say to use the If it's always possible, ACK on enforcing it. |
|
☝️then update developer notes? |
ed32311 to
5441186
Compare
|
Needs rebase |
5441186 to
04016bf
Compare
|
Thanks @MarcoFalke. Rebased! |
|
utACK 04016bf could squash |
|
utACK 04016bf0b78aed2a6c39dfa284478b39192e2ec2 |
04016bf to
186b010
Compare
|
Rebased! Please re-review :-) |
test/lint/lint-includes.sh
Outdated
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.
Why not use *.cpp and *.h? Isn't it compatible with other git versions?
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.
Yes, you're right that -- "*.cpp" "*.h" would be equivalent in this specific case (since we're only matching in src/), but my suggestions is that we keep this PR as is since it already has two utACK:s that would need re-reviewing in case of a change. Makes sense? :-)
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.
Fixed when rebasing :-)
|
utACK 186b0101854824bb2bed55a7674aa5d6979d9f66 |
|
utACK 186b010 |
src/bench/merkle_root.cpp
Outdated
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.
This doesn't compile locally here. Should be #include <bench/bench.h>
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.
Fixed!
|
Needs rebase |
186b010 to
a3ddab8
Compare
|
Rebased! Please re-review :-) |
a3ddab8 to
655d432
Compare
src/test/blockchain_tests.cpp
Outdated
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.
This seems incorrect
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.
In what way? :-)
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.
It includes blockchain.h previously, but you include blockchain.cpp. Might because of #13288 merged.
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.
Ouch, now fixed! Thanks for catching this. I missed the .cpp extension!
655d432 to
16e3cd3
Compare
ken2812221
left a comment
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.
utACK 16e3cd3
|
re-utACK 16e3cd3 |
|
utACK 16e3cd3. |
|
utACK 16e3cd3 |
…ide's include syntax 16e3cd3 Clarify include recommendation (practicalswift) 6d10f43 Enforce the use of bracket syntax includes ("#include <foo.h>") (practicalswift) 906bee8 Use bracket syntax includes ("#include <foo.h>") (practicalswift) Pull request description: When analysing includes in the project it is often assumed that the preferred bracket include syntax (`#include <foo.h>`) mentioned in `developer-docs.md` is used consistently. @sipa:s excellent circular dependencies script [`circular-dependencies.py`](https://github.com/sipa/bitcoin/blob/50c69b78011c1bc55885ebfd216db60ed490ebea/contrib/devtools/circular-dependencies.py) (#13228) is an example of a script making this reasonable assumption. This PR enables automatic Travis checking of the include syntax making sure that the bracket syntax includes (`#include <foo.h>`) is used consistently. Tree-SHA512: a414921aabe8e487ebed42f3f1cbd02fecd1add385065c1f2244cd602c31889e61fea5a801507ec501ef9bd309b05d3c999f915cec1c2b44f085bb0d2835c182
…oper guide's include syntax 16e3cd3 Clarify include recommendation (practicalswift) 6d10f43 Enforce the use of bracket syntax includes ("#include <foo.h>") (practicalswift) 906bee8 Use bracket syntax includes ("#include <foo.h>") (practicalswift) Pull request description: When analysing includes in the project it is often assumed that the preferred bracket include syntax (`#include <foo.h>`) mentioned in `developer-docs.md` is used consistently. @sipa:s excellent circular dependencies script [`circular-dependencies.py`](https://github.com/sipa/bitcoin/blob/50c69b78011c1bc55885ebfd216db60ed490ebea/contrib/devtools/circular-dependencies.py) (bitcoin#13228) is an example of a script making this reasonable assumption. This PR enables automatic Travis checking of the include syntax making sure that the bracket syntax includes (`#include <foo.h>`) is used consistently. Tree-SHA512: a414921aabe8e487ebed42f3f1cbd02fecd1add385065c1f2244cd602c31889e61fea5a801507ec501ef9bd309b05d3c999f915cec1c2b44f085bb0d2835c182 Signed-off-by: pasta <[email protected]>
ad5717d Lint: Add lint-includes.sh (Fuzzbawls) faba3f6 [tests] Use FastRandomContext in scheduler_tests.cpp (practicalswift) 2034bf6 Remove unused boost includes in reverselock_tests.cpp (Fuzzbawls) 3256d16 bench: Use non-throwing ParseDouble() (Fuzzbawls) 3c984d1 Remove duplicate includes (Fuzzbawls) b54e396 Declare TorReply parsing functions in torcontrol_tests (Fuzzbawls) Pull request description: This brings in the `lint-includes.sh` shell script from upstream (first introduced in bitcoin#11878) to automatically check for duplicate includes and expanded in bitcoin#13301 and bitcoin#13385 to check for the inclusion of `.cpp` files and the introduction of new boost includes, respectively. The check for enforcing bracket include syntax (bitcoin#13230) is also included, but currently disabled, as we have yet to systematically switch to that syntax preference. Three other upstream PRs are backported here as they are directly related to the removal of some boost dependencies and are very straight forward: - bitcoin#10547 - bitcoin#13291 - bitcoin#13383 **NOTE: #2711 removes the dependency on `boost/tuple/tuple.hpp`, so it makes sense to merge that first. submitting this now so the general concept/functionality can be reviewed prior to that PR being merged** ACKs for top commit: furszy: good ACK ad5717d random-zebra: utACK ad5717d and merging... Tree-SHA512: d9d32d6d5122dac52c9601cda75612d87c4e027c6f196a2382206b227fcfd2bb61d4f72df7cbf5e572d94150ad8ca6db6301bd99b0da647b9627fe342b66873f
…oper guide's include syntax 16e3cd3 Clarify include recommendation (practicalswift) 6d10f43 Enforce the use of bracket syntax includes ("#include <foo.h>") (practicalswift) 906bee8 Use bracket syntax includes ("#include <foo.h>") (practicalswift) Pull request description: When analysing includes in the project it is often assumed that the preferred bracket include syntax (`#include <foo.h>`) mentioned in `developer-docs.md` is used consistently. @sipa:s excellent circular dependencies script [`circular-dependencies.py`](https://github.com/sipa/bitcoin/blob/50c69b78011c1bc55885ebfd216db60ed490ebea/contrib/devtools/circular-dependencies.py) (bitcoin#13228) is an example of a script making this reasonable assumption. This PR enables automatic Travis checking of the include syntax making sure that the bracket syntax includes (`#include <foo.h>`) is used consistently. Tree-SHA512: a414921aabe8e487ebed42f3f1cbd02fecd1add385065c1f2244cd602c31889e61fea5a801507ec501ef9bd309b05d3c999f915cec1c2b44f085bb0d2835c182 Signed-off-by: pasta <[email protected]>
When analysing includes in the project it is often assumed that the preferred bracket include syntax (
#include <foo.h>) mentioned indeveloper-docs.mdis used consistently. @sipa:s excellent circular dependencies scriptcircular-dependencies.py(#13228) is an example of a script making this reasonable assumption.This PR enables automatic Travis checking of the include syntax making sure that the bracket syntax includes (
#include <foo.h>) is used consistently.