Commit Graph

46 Commits

Author SHA1 Message Date
Homu dea50714f9 Auto merge of #4892 - str4d:boosted, r=str4d
Replace boost::variant and boost::optional with standard library

Includes a commit cherry-picked from https://github.com/bitcoin/bitcoin/pull/20419.

Closes #4821. Closes #4822.
2020-12-17 02:42:55 +00:00
Jack Grigg 8a1803b21a lint: Remove boost::variant and boost::optional from allowed includes 2020-12-16 22:59:35 +00:00
Dimitris Apostolou f459e43dc9
Update links 2020-12-13 11:24:44 +02:00
Jack Grigg e03667b608 lint: Remove boost/foreach.hpp from allowed includes 2020-11-23 23:24:05 +00:00
MarcoFalke 1ffd2d5fad util: Replace boost::signals2 with std::function
Zcash: Added missing imports that were being implicitly included.
2020-11-23 23:07:15 +00:00
Jack Grigg e6b1d44170 lint: Re-exclude subtrees from lint-include-guards.sh
These are external libraries, and it does not make sense to maintain an
otherwise-meaningless diff from upstream.

This partially reverts commit 1e6d1837a0.
2020-11-09 23:06:21 +00:00
Sjors Provoost c0c05ebb34 doc: improve subtree check instructions 2020-11-09 23:06:21 +00:00
John Newbery 9069364e56 [linter] Strip trailing / in path for git-subtree-check
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.
2020-11-09 23:06:21 +00:00
MarcoFalke cff7e776bf Revert "Remove unused variable in shell script"
This partially reverts commit ab8e8b97a359e1c4f1bca8e1769021c95019f2c4
2020-11-09 23:06:21 +00:00
Pieter Wuille eb074fdb24 Improve git-subtree-check.sh
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.
2020-11-09 23:06:21 +00:00
practicalswift 52d9854034 Remove unused variables in shell scripts.
Zcash: Only the script we have.
2020-11-09 23:06:21 +00:00
isle2983 ccf31edf62 [copyright] add MIT license headers to .sh scripts where missing
Years are set according to 'git log' history

Zcash: Only the scripts we have that are missing the header.
2020-11-09 22:59:04 +00:00
str4d 1e6d1837a0
lint: Remove some subtrees from exclusion
Either they don't violate the lints, or can be easily fixed.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-11-09 20:06:45 +00:00
str4d 5b543b15eb
lint: Allow stoi in src/rpc/blockchain.cpp
This instance is ok because it's guarded by a strict regex.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-11-09 20:03:22 +00:00
str4d 9dbf535441
lints: Add a missing copyright header
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-11-09 17:17:08 +00:00
str4d 4b69b94bba
Small documentation fixes
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-11-09 17:15:46 +00:00
Jack Grigg 7c42009ddd lints: Match `export LC_ALL="C"` in lint-shell-locale
checksec.sh uses this format.
2020-10-28 13:19:27 +00:00
practicalswift 69d3d38445 Follow-up to #13454: Fix broken build by exporting LC_ALL=C 2020-10-28 13:14:39 +00:00
Jack Grigg 32fe88362b lints: Update expected Boost imports 2020-10-27 23:14:08 +00:00
Jack Grigg f318ab3776 lints: Use Zcash-specific include guards for new files 2020-10-27 23:05:19 +00:00
Kristaps Kaupe d89f31dc43 Make lint-includes.sh work from any directory 2020-10-27 23:05:19 +00:00
Julian Fleischer bdaccd0f06 Run all lint scripts
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.
2020-10-27 23:05:19 +00:00
practicalswift 1be9fa9aeb Remove no longer needed shellcheck suppressions 2020-10-27 23:05:19 +00:00
practicalswift 68393a4b73 Fix warnings introduced in shellcheck v0.6.0
Zcash: Only for shell scripts we have backported.
2020-10-27 23:05:19 +00:00
practicalswift 8ed37f5f40 Remove repeated suppression. Fix indentation. 2020-10-27 23:05:19 +00:00
Vidar Holen 37604a1990 refactor/lint: Add ignored suggestions to an array
This avoids duplicating the codes between command and comments.
2020-10-27 23:05:19 +00:00
João Barbosa 653f6dc7e7 qa: Ignore shellcheck warning SC2236
With shellcheck 0.6.0 the warning `SC2236 -  Use -n instead of ! -z` is raised.
This change adds that warning to the ignored list.
2020-10-27 23:05:19 +00:00
vim88 27f924108c Scripts and tools & Docs: Used #!/usr/bin/env bash instead of obsolete #!/bin/bash, added linting for .sh files shebang and updated the Developer Notes. 2020-10-27 23:05:19 +00:00
practicalswift 5b11b94d27 macOS fix: Add excludes for checks added in the newer shellcheck version installed by brew 2020-10-27 23:05:19 +00:00
practicalswift 73a6c29bcd macOS fix: Work around empty (sub)expression error when using BSD grep 2020-10-27 23:05:19 +00:00
Julian Fleischer 52f45ad9a4 use export LC_ALL=C.UTF-8 2020-10-27 23:05:19 +00:00
Julian Fleischer b90433afd3 fix locale for lint-shell 2020-10-27 23:05:19 +00:00
DesWurstes be186b8112 Obsolete #!/bin/bash shebang 2020-10-27 23:05:18 +00:00
practicalswift f98ced2aba Add linter: Make sure we explicitly open all text files using UTF-8 or ASCII encoding in Python 2020-10-27 23:05:02 +00:00
practicalswift 1b32acdd52 Add linter: Make sure all shell scripts opt out of locale dependence using "export LC_ALL=C" 2020-10-27 23:05:02 +00:00
practicalswift 745ac0ae6d Add "export LC_ALL=C" to all shell scripts
Zcash: Only for lint-* scripts we have backported from upstream.
2020-10-27 23:05:02 +00:00
practicalswift 40316e9359 build: Add linter for checking accidental locale dependence 2020-10-27 23:05:02 +00:00
practicalswift 9174ccaf0d build: Guard against accidental introduction of new Boost dependencies 2020-10-27 23:05:02 +00:00
MarcoFalke c2848070b4 test: Move linters to test/lint, add readme
Zcash: Only the lint-* scripts we have backported.
2020-10-27 23:05:02 +00:00
str4d 8aadc745c2
Use HTTPS in script license headers
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-10-26 18:04:19 +00:00
Jack Grigg 1b01bd942b test/lint: Check for working changes before checking scripted diffs 2020-10-26 17:57:26 +00:00
Wladimir J. van der Laan 001e803b92 test: Mention commit id in scripted diff error 2020-10-26 17:36:26 +00:00
Hennadii Stepanov 1d3af17140 Enable ShellCheck rules
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

Zcash: Only the changes that applied to the versions of the scripts we have.
2020-10-26 17:36:26 +00:00
Carl Dong ccd074a59b scripted-diff: Run scripted-diff in subshell
-BEGIN VERIFY SCRIPT-
sed -i 's/\bi\b/commit/g' test/lint/commit-script-check.sh
sed -i '34s/eval "$SCRIPT"/(eval "$SCRIPT")/' test/lint/commit-script-check.sh
-END VERIFY SCRIPT-
2020-10-26 17:36:26 +00:00
practicalswift 3b1bf4b4af Add "export LC_ALL=C" to all shell scripts
Zcash: Only for shell scripts we have from upstream.
2020-10-26 17:36:26 +00:00
MarcoFalke 6506fbacf1 test: Move linters to test/lint, add readme 2020-10-26 17:36:26 +00:00