ShellCheck has started failing in CI. My guess is that the ubuntu-latest runner
now uses a `/bin/sh` that is actually Bash.
- excludes checksec.sh, as it’s not our code
- fixes lints in other files
And ci script output.
Identified via test/lint/lint-spelling
(cherry picked from commit bitcoin/bitcoin@9b0e16226e)
Zcash: Only the change to `test/lint/lint-shell.sh`
Enabled ShellCheck rules:
SC1087
SC2001
SC2004
SC2005
SC2006
SC2016
SC2028
SC2048
SC2066 (note that IFS already contains only a line feed)
SC2116
SC2166
SC2181
SC2206
SC2207
SC2230
SC2236
(cherry picked from commit bitcoin/bitcoin@1ac454a384)
Zcash: Applies more of this commit. It was partially backported in
zcash/zcash#4827, and is also partially backported here for the scripts
we actually have.
(cherry picked from commit bitcoin/bitcoin@3a037d0067)
Zcash:
- Excludes linters and scripts we don't have.
- Re-adds leveldb to lint-includes.sh because of a false positive.
Commit 1.
This code was written by @TheBlueMatt in the following branch:
* https://github.com/TheBlueMatt/bitcoin/commits/2017-08-test-10923
This commit message was written by me (@practicalswift) who also squashed
@TheBlueMatt's commits into one and tried to summarize the changes made.
Commit 2.
Remove boost include. Remove boost mentions in comments.
(cherry picked from commit bitcoin/bitcoin@7e319d6393)
We canonicalize git URLs when linting Cargo patches, because Cargo
treats `path/to/repo` and `path/to/repo.git` identically (and similarly
it strips a trailing slash), so we allow `.cargo/config.offline` and
`Cargo.toml` to mismatch in this way to minimise lints.
After 4.5.2, all wallets will be populated with an emergency
recovery phrase, and all future addresses will be derived from
the associated seed. To prevent potential loss of funds, we
require that the user explicitly invoke the `walletconfirmbackup`
RPC method to verify that they have backed up this seed.
These are external libraries, and it does not make sense to maintain an
otherwise-meaningless diff from upstream.
This partially reverts commit 1e6d1837a0.
git-subtree-check fails if the directory is given with a trailing slash,
eg:
```
> test/lint/git-subtree-check.sh src/univalue/
ERROR: src/univalue/ is not a subtree
```
Shell autocompletes will add the trailing slash when autofilling the
path name, which will therefore cause the script to fail.
Just ignore any trailing slash.
We have several pieces of information about subtrees:
1) What their current directory contents is
2) What their directory contents was at the time of the last subtree merge
3) What the directory contents of the upstream project is in the commit referred to by the subtree merge.
Normally, all 3 should be identical. git-subtree-check.sh so far only compared (1) with (3) however.
Fix this by comparing all three, and give some more useful diff output in the case of mismatch.
The added benefit is that (1) and (2) can be compared without needing to see the upstream repository.
The description reads:
```
# This script runs all contrib/devtools/lint-*.sh files, and fails if any exit
# with a non-zero status code.
```
This runs all scripts and returns with a non-zero exit code if any failed.