-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Backport useful lints from upstream #4829
Conversation
Once I've checked for any further relevant backports, I'll apply the following patch (so that GitHub doesn't get confused about commit ordering) EDIT: Done. |
I'll rebase this once #4831 is merged (which conflicts with this). |
☔ The latest upstream changes (presumably #4831) made this pull request unmergeable. Please resolve the merge conflicts. |
- ensure header namespaces and end comments are correct - add missing header end comments - ensure minimal formatting (add newlines etc.)
Identifiers beginning with an underscore followed immediately by an uppercase letter are reserved.
This adds a new CHECK_DOC check that looks for newly introduced trailing whitespace. Existing trailing whitespace (of which there is plenty!) will not trigger an error. This is written in a generic way so that new lint-*.sh scripts can be added to contrib/devtools/, as I'd like to contribute additional lint checks in the future.
Lint checks should not test these, they are historical documents, and we don't want to encourage silly changes to them to satisfy a checker. Hopefully makes travis pass again on master. Tree-SHA512: 37e6716c4fd5e8a4e579f9b84042e6b0ac224836b6c851cd1ca3f7d46611ffd3003bed0ae08dd0457f69d6eaa485a0d21c631e7ef16b14bdb0f2f78ea700332d
MacOS does not support 'grep -P' out of the box. This change makes it easier for developers to check for whitespace problems locally.
Get usage instructions: .lint-whitespace.sh -?
Before this PR, the linenumber infomaition is output if trailing-space or tab code was found, but the output occurence is only per a file. This PR separates the output timing of file name and line number. As a result, users will find where they need to fix more easily.
This enforces parts of the project header include guidelines (added by @sipa in #10575).
This partially reverts commit c36b720.
Zcash: Only the lint-* scripts we have backported.
Zcash: Only for lint-* scripts we have backported from upstream.
…using "export LC_ALL=C"
Rebased. |
@zkbot try |
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.
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.
Flushing comments.
checksec.sh uses this format.
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.
Tested ACK with suggestions.
|
||
EXIT_CODE=0 | ||
for LOCALE_DEPENDENT_FUNCTION in "${LOCALE_DEPENDENT_FUNCTIONS[@]}"; do | ||
MATCHES=$(grep -E "[^a-zA-Z0-9_\`'\"<>]${LOCALE_DEPENDENT_FUNCTION}(_r|_s)?[^a-zA-Z0-9_\`'\"<>]" <<< "${GIT_GREP_OUTPUT}" | \ |
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 check for a call, so it gives false positives when the name of a library function is shadowed by a local variable name. This only happens in one case: trim
in src/crypto/equihash.h
, so it might be just as easy to rename that variable.
Not sure why Homu didn't report back, but the |
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
This instance is ok because it's guarded by a strict regex. Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Either they don't violate the lints, or can be easily fixed. Co-authored-by: Daira Hopwood <daira@jacaranda.org>
@zkbot r+ |
📌 Commit 1e6d183 has been approved by |
Cherry-picked from the following upstream PRs:
.travis/
subject to shellcheck bitcoin/bitcoin#13863Several of the lints fail for our current codebase; these will be addressed in a
subsequent PR.