Clarify include guard naming convention#12757
Conversation
1231374 to
ff981df
Compare
|
Concept ACK. Could run script in travis where |
|
@promag |
There was a problem hiding this comment.
Do you really need bitcoin-config.h and build.h in here? They're auto-generated so I would have thought git ls-files wouldn't have listed them.
There was a problem hiding this comment.
You should probably add a copyright notice to this file.
ff981df to
059641e
Compare
059641e to
3bcc005
Compare
|
@eklitzke Thanks for reviewing! Feedback addressed. Please re-review :-) |
|
utACK 3bcc005 |
| REGEXP_EXCLUDE_FILES_WITH_PREFIX="src/(crypto/ctaes/|leveldb/|secp256k1/|tinyformat.h|univalue/)" | ||
|
|
||
| EXIT_CODE=0 | ||
| for HEADER_FILE in $(git ls-files -- "*.h" | grep -vE "^${REGEXP_EXCLUDE_FILES_WITH_PREFIX}") |
There was a problem hiding this comment.
Could use git ls-files -x instead of | grep -vE?
There was a problem hiding this comment.
Never mind, -x skips untracked files.
There was a problem hiding this comment.
@promag No I don't think so (-x is for untracked files, right?) :-)
I'd be glad to be proven wrong so provide an equivalent using git ls-files -x and I'll switch :-)
There was a problem hiding this comment.
Yes I've come to that conclusion right after trying it.
|
Tested ACK 3bcc005 on mac. |
3bcc005 Add lint-include-guards.sh which checks include guard consistency (practicalswift) 8fd6af8 Fix missing or inconsistent include guards (practicalswift) 8af65d9 Document include guard convention (practicalswift) Pull request description: * **Documentation**: Document include guard convention * **Fix**: Fix missing or inconsistent include guards * **Regression test**: Add `lint-include-guards.sh` which checks include guard consistency Tree-SHA512: 8171878f60fd08ccbea943a11e835195750592abb9d7ab74eaa4265ae7fac523b1da9d31ca13d6ab73dd596e49986bfb7593c696e5f39567c93e610165bc2acc
Extracted from bitcoin/bitcoin#12757 - Commit 8fd6af8
Bech32 encoding support Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#8578 - bitcoin/bitcoin#11167 - Only the second and third commits (first is in #3228, fourth depends on #2390, later ones are SegWit-specific). - bitcoin/bitcoin#12757 - Only the change to `src/bech32.h` Part of #3058.
Bech32 encoding support Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#8578 - bitcoin/bitcoin#11167 - Only the second and third commits (first is in #3228, fourth depends on #2390, later ones are SegWit-specific). - bitcoin/bitcoin#12757 - Only the change to `src/bech32.h` Part of #3058.
3bcc005 Add lint-include-guards.sh which checks include guard consistency (practicalswift) 8fd6af8 Fix missing or inconsistent include guards (practicalswift) 8af65d9 Document include guard convention (practicalswift) Pull request description: * **Documentation**: Document include guard convention * **Fix**: Fix missing or inconsistent include guards * **Regression test**: Add `lint-include-guards.sh` which checks include guard consistency Tree-SHA512: 8171878f60fd08ccbea943a11e835195750592abb9d7ab74eaa4265ae7fac523b1da9d31ca13d6ab73dd596e49986bfb7593c696e5f39567c93e610165bc2acc Signed-off-by: pasta <[email protected]> # Conflicts: # src/bech32.h # src/consensus/merkle.h # src/key_io.h # src/policy/fees.h # src/rpc/server.h # src/script/bitcoinconsensus.h # src/wallet/coinselection.h
Backport useful lints from upstream Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6892 - bitcoin/bitcoin#11151 - bitcoin/bitcoin#11300 - bitcoin/bitcoin@96d91b7 - bitcoin/bitcoin#12097 - bitcoin/bitcoin#12098 - bitcoin/bitcoin#12442 - bitcoin/bitcoin#12572 - bitcoin/bitcoin#12757 - bitcoin/bitcoin#11878 - bitcoin/bitcoin#12933 - bitcoin/bitcoin#12871 - bitcoin/bitcoin#12972 - bitcoin/bitcoin#13281 - bitcoin/bitcoin#13385 - bitcoin/bitcoin#13041 - bitcoin/bitcoin#13454 - bitcoin/bitcoin#13448 - bitcoin/bitcoin#13510 - bitcoin/bitcoin#13851 - bitcoin/bitcoin#13863 - bitcoin/bitcoin#14115 - bitcoin/bitcoin#14831 - bitcoin/bitcoin#15164 - bitcoin/bitcoin#15170 - bitcoin/bitcoin#15166 - bitcoin/bitcoin#16036 - bitcoin/bitcoin#16768 Several of the lints fail for our current codebase; these will be addressed in a subsequent PR.
Backport useful lints from upstream Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6892 - bitcoin/bitcoin#11151 - bitcoin/bitcoin#11300 - bitcoin/bitcoin@96d91b7 - bitcoin/bitcoin#12097 - bitcoin/bitcoin#12098 - bitcoin/bitcoin#12442 - bitcoin/bitcoin#12572 - bitcoin/bitcoin#12757 - bitcoin/bitcoin#11878 - bitcoin/bitcoin#12933 - bitcoin/bitcoin#12871 - bitcoin/bitcoin#12972 - bitcoin/bitcoin#13281 - bitcoin/bitcoin#13385 - bitcoin/bitcoin#13041 - bitcoin/bitcoin#13454 - bitcoin/bitcoin#13448 - bitcoin/bitcoin#13510 - bitcoin/bitcoin#13851 - bitcoin/bitcoin#13863 - bitcoin/bitcoin#14115 - bitcoin/bitcoin#14831 - bitcoin/bitcoin#15164 - bitcoin/bitcoin#15170 - bitcoin/bitcoin#15166 - bitcoin/bitcoin#16036 - bitcoin/bitcoin#16768 - bitcoin/bitcoin#13494 Several of the lints fail for our current codebase; these will be addressed in a subsequent PR.
3bcc005 Add lint-include-guards.sh which checks include guard consistency (practicalswift) 8fd6af8 Fix missing or inconsistent include guards (practicalswift) 8af65d9 Document include guard convention (practicalswift) Pull request description: * **Documentation**: Document include guard convention * **Fix**: Fix missing or inconsistent include guards * **Regression test**: Add `lint-include-guards.sh` which checks include guard consistency Tree-SHA512: 8171878f60fd08ccbea943a11e835195750592abb9d7ab74eaa4265ae7fac523b1da9d31ca13d6ab73dd596e49986bfb7593c696e5f39567c93e610165bc2acc Signed-off-by: pasta <[email protected]>
lint-include-guards.shwhich checks include guard consistency