Commit graph

271 commits

Author SHA1 Message Date
Steven Roose
a352d2ae5f
Don't GPG sign intermediate commits with github-merge tool 2019-05-31 19:22:02 +01:00
MarcoFalke
faf666f814
Remove Windows 32 bit build 2019-05-03 13:41:27 -04:00
nkostoulas
942ff2054b
contrib: gh-merge: Use pagination to fetch all review comments 2019-04-17 20:21:45 +01:00
MarcoFalke
fa1c073154
contrib: gh-merge: Include review comments in merge commit 2019-03-22 12:03:04 -04:00
MarcoFalke
b83c6f7940
Merge #15444: [docs] Additional productivity tips
ff7f31e07d [doc] productivity: more advanced git range-diff (Sjors Provoost)
3a21905a4e [doc] devtools: mention clang-format dependency (Sjors Provoost)
bf12093191 [doc] productivity: fix broken link (Sjors Provoost)

Pull request description:

  Fixes a broken link to `devtools/README.md`, points out the `clang-format` dependency and adds a `git range-diff` incantation that works even with rebases and squashes.

Tree-SHA512: 36e46282f1e28d1bf3f48ada995fbac548f61b7747091eb032b60919cf76c7bdad0fa8aecb0c47adbdaa9ef986d3ec7752b0bb94c63191401856e2ddeec48f3e
2019-03-14 17:02:28 -04:00
Wladimir J. van der Laan
12408d33c6
Merge #15549: gitian: Improve error handling
32da92bdf6 gitian: Improve error handling (Wladimir J. van der Laan)

Pull request description:

  Improve error handling in gitian builds:

  - Set fail-on-error and pipefail flag, this causes a command to fail when either of the pipe stages fails, not only when the last of the stages fails, so this improves error detection.
  - Also use `xargs` instead of `find -exec`, because `find` will not propagate errors in the executed command, but `xargs` will.

  This will avoid some issues like #15541 where non-determinism is silently introduced due to errors caused by environment conditions (such as lack of disk space in that case).

Tree-SHA512: d5d3f22ce2d04a75e5c25e935744327c3adc704c2d303133f2918113573a564dff3d3243d5569a2b93ee7eb0e97f8e1b1ba81767e966af9015ea711a14091035
2019-03-09 06:45:19 +01:00
Wladimir J. van der Laan
32da92bdf6 gitian: Improve error handling 2019-03-07 17:21:46 +01:00
MarcoFalke
a74d588f21
Merge #14954: build: Require python 3.5
fa2797808e test: Remove python3.4 workaround in feature_dbcrash (MarcoFalke)
dddd1d05d3 .python-version: Specify full version 3.5.6 (MarcoFalke)
faa7cdf764 scripted-diff: Update copyright in ./test (MarcoFalke)
fa0e65b772 scripted-diff: test: Remove brackets after assert (MarcoFalke)
fab5a1e0f4 build: Require python 3.5 (MarcoFalke)
fa6bf21f5e scripted-diff: test: Use py3.5 bytes::hex() method (MarcoFalke)

Pull request description:

  Python 3.4 is EOL after March 2019, so switch to 3.5. See https://devguide.python.org/#status-of-python-branches

  This pull does the following in a bunch of commits:
  * scripted diff to use the `bytes::hex()` method in place of previous wrappers (`b2x`, `bytes_to_hex_str`, `hexlify`, ...)
  * Update the build system (gitian and travis) to remove python2.7 and replace it with python3.5
  * Another scripted-diff to remove brackets after `assert`. This is unrelated to the python3.5 switch, but a stylistic commit, so probably not worth to split up. The motivation behind it is to avoid asserting on data structures (such as tuples of length one), which never fails:
  ```py
  >>> assert(False,)   # with brackets
  >>> assert False,    # without brackets
  SyntaxError: invalid syntax
  >>> assert False     # proper assertion
  AssertionError
  ```
  * And then a final scripted diff to update the copyright headers in the `test` subfolder, since I touched most of the files anyway and it wouldn't make sense to split this commit out into a separate pull.

  For reference (contributed by luke-jr):

  Ubuntu LTS (bionic): 3.6.5
  Debian stable (stretch): 3.5.3
  RHEL 8 (expected before v0.19): 3.6.x
  Gentoo stable: 3.6.5
  Arch: 3.7.1

Tree-SHA512: 643c28cd2d5b9543ce4bf8ad2a8b282bc79b37dc5b25c9c8358e6ce201e2a67a546463e5f3430b16652eb2489d7c3ed4b0772cd2e2bf790fe68a5e3cc8a25029
2019-03-05 09:13:13 -05:00
MarcoFalke
45f434f44d
Merge #15288: Remove wallet -> node global function calls
f7efd87c8f Change brace formatting (Russell Yanofsky)
a1df1b48a8 Remove use of IsInitialBlockDownload in wallet code (Russell Yanofsky)
1106a6fde4 Remove use of uiInterface.LoadWallet in wallet code (Russell Yanofsky)
318f41fb2c circular-dependencies: Avoid treating some .h/.cpp files as a unit (Russell Yanofsky)
d02b34c8a8 Remove use of AcceptToMemoryPool in wallet code (Russell Yanofsky)
e2c8ba9f6e Remove uses of InitMessage/Warning/Error in wallet code (Russell Yanofsky)
c5e59a96a8 Remove uses of GetAdjustedTime in wallet code (Russell Yanofsky)
6d6bcc77c0 Remove use of g_connman / PushInventory in wallet code (Russell Yanofsky)
00dfb2a440 Remove uses of g_connman in wallet code (Russell Yanofsky)
cc3836e8f9 Remove uses of fPruneMode in wallet code (Russell Yanofsky)
cc02c796d3 Remove uses of fee globals in wallet code (Russell Yanofsky)
1fb0a4a04e Remove use of CalculateMemPoolAncestors in wallet code (Russell Yanofsky)
cd32160af0 Remove use of GetTransactionAncestry in wallet code (Russell Yanofsky)
291276f7f4 Remove use of GetCountWithDescendants in wallet code (Russell Yanofsky)
bdc6628683 Remove use of IsRBFOptIn in wallet code (Russell Yanofsky)
80f52a2267 Remove uses of CheckFinalTx in wallet code (Russell Yanofsky)

Pull request description:

  This change removes wallet calls to node functions that access global chain and mempool state.

  This is the next step in the larger #10973 refactoring change, which removes all other accesses to node global variables from wallet code. Doing this is useful to provide a better defined interface between the wallet and node, and necessary to allow wallet and node code to run in separate processes in #10102.

Tree-SHA512: 40dbaf1f59fb22b32e70b054b30ba5638d638aa3240fa30e0f721d53c721cd6138a7ab4d423a24d7d2fda0b956e68d44c733abc2c9259c3d6c9fd6d4be89aa23
2019-03-04 13:13:36 -05:00
MarcoFalke
fab5a1e0f4
build: Require python 3.5 2019-03-02 10:40:23 -05:00
Russell Yanofsky
318f41fb2c circular-dependencies: Avoid treating some .h/.cpp files as a unit
This avoids a bogus circular dependency error in the next commit:

interfaces/chain -> interfaces/wallet -> wallet/wallet -> interfaces/chain

Which is incorrect, because interfaces/chain.cpp depends only on the
interfaces/wallet.h file, not the interfaces/wallet.cpp file, and it is
wrong to treat these as a unit. Inside the interfaces directory, .h files
contain abstract class definitions and .cpp files contain implementations of
those classes, so you don't need to link against .cpp files if you're only
using the abstract class definition in the .h file.

An alternative fix might be to rename all the cpp files in the interfaces
directory like: chain.cpp->chain_impl.cpp, node.cpp->node_impl.cpp. But just
getting the linter to treat these files as independent dependencies seemed
like it would allow keeping code organization straightforward and avoiding
the need to rename things.
2019-02-22 15:43:02 -04:00
Sjors Provoost
3a21905a4e
[doc] devtools: mention clang-format dependency 2019-02-19 17:08:01 +01:00
practicalswift
43206239a8 tests: Add script checking for deterministic line coverage 2019-02-15 09:38:07 +01:00
MarcoFalke
fa0fe3b8a4
contrib: Add missing wallet tool to gen-manpages.sh 2019-02-06 10:03:12 -05:00
Ben Woosley
ad5e5a105e
Scripts and tools: Drop no-longer-relevant copyright holder names
Now that leveldb, secp256k1, etc. are reliably excluded, these
names will not show up in the searched files.
2019-01-24 23:46:12 -08:00
Ben Woosley
2434ab5c2a
Scripts and tools: Fix devtools/copyright_header.py to always honor exclusions
This script compared paths relative to the report directory to test for exclusion,
meaning the directory exclusions did not work properly, as they were relative to
the project root.

Fix this by creating absolute paths through the combination of:
'git ls-files --full-name' and 'git rev-parse --show-toplevel'
2019-01-24 23:46:06 -08:00
Wladimir J. van der Laan
f1bd219a5b contrib: Allow use of github API authentication in github-merge
The API request limit for unauthenticated requests is quite low.
I started running into rate limiting errors. The limit
for authenticated requests is much higher.

This patch adds an optional configuration setting `user.ghtoken`
that, when set, is used to authenticate requests to the API.
2019-01-14 16:48:23 +01:00
Wladimir J. van der Laan
a4c5bbfcd3 contrib: Add support for http[s] URLs in github-merge
Sometimes it can be useful to use github-merge with read-only access
(say, for reviewing and testing).
2019-01-14 16:33:13 +01:00
Wladimir J. van der Laan
059a3cffdf contrib: Detailed reporting for http errors in github-merge
Print detailed error, this makes it easier to diagnose github API issues.
2019-01-14 16:32:05 +01:00
practicalswift
4de11a3682 Remove Python 2 import workarounds 2018-12-13 16:46:31 +01:00
Daniel Ingram
17b55202da Compare to None with is/is not 2018-12-10 15:11:37 -05:00
Daniel Ingram
1b89074ae2 Change '== None' to 'is None' 2018-12-09 15:55:13 -05:00
Daniel Ingram
16d2937723 Handle exception as ImportError 2018-12-09 15:49:34 -05:00
Craig Younkins
af1ed206f8 Fix broken Gmane URLs 2018-11-30 13:51:55 +00:00
Cornelius Schumacher
af9a9918b2 Fix detection of copyright holders
* There is a copyright notice in `src/crypto/sha256_sse4.cpp` in the
  middle of the file which contains a comma before the copyright
  holder name. Correctly detect this so it's added to the report.
* Add missing copyright holders so that `copyright_header.py report`
  doesn't show any unexpected copyright holder names anymore.
* Exclude files from git subtrees because they are maintained at the
  original source.
2018-11-23 17:22:50 +01:00
Chun Kuan Lee
5d62dcf9cf lint: Make sure we read the command line inputs using utf-8 decoding in python 2018-09-02 21:40:51 +08:00
Chun Kuan Lee
c516c3a770 [contrib] Support ARM and RISC-V symbol check 2018-08-25 21:08:16 +08:00
Wladimir J. van der Laan
78dae8cacc
Merge #13780: 0.17: Pre-branch maintenance
3fc20632a3 qt: Set BLOCK_CHAIN_SIZE = 220 (DrahtBot)
2b6a2f4a28 Regenerate manpages (DrahtBot)
eb7daf4d60 Update copyright headers to 2018 (DrahtBot)

Pull request description:

  Some trivial maintenance to avoid having to do it again after the 0.17 branch off.

  (The scripts to do this are in `./contrib/`)

Tree-SHA512: 16b2af45e0351b1c691c5311d48025dc6828079e98c2aa2e600dc5910ee8aa01858ca6c356538150dc46fe14c8819ed8ec8e4ec9a0f682b9950dd41bc50518fa
2018-08-08 13:55:27 +02:00
DrahtBot
eb7daf4d60 Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
Chun Kuan Lee
1e60713a68 contrib: Fix test-security-check fail in Ubuntu 18.04 2018-07-26 17:10:13 +08:00
Conrado Gouvea
37d363dd4a
Tools: fix BIND_NOW check in security-check.py
Previously, the BIND_NOW check would work only if it was the first value in FLAGS.
2018-07-12 13:16:01 -03:00
Wladimir J. van der Laan
dcb154e5aa
Merge #13177: GCC-7 and glibc-2.27 back compat code
253f592909 Add stdin, stdout, stderr to ignored export list (Chun Kuan Lee)
fc6a9f2ab1 Use IN6ADDR_ANY_INIT instead of in6addr_any (Cory Fields)
908c1d7745 GCC-7 and glibc-2.27 compat code (Chun Kuan Lee)

Pull request description:

  The `__divmoddi4` code was modified from https://github.com/gcc-mirror/gcc/blob/master/libgcc/libgcc2.c . I manually find the older glibc version of log2f by objdump, use `.symver` to specify the certain version.

Tree-SHA512: e8d875652003618c73e019ccc420e7a25d46f4eaff1c7a1a6bfc1770b3b46f074b368b2cb14df541b5ab124cca41dede4e28fe863a670589b834ef6b8713f9c4
2018-07-12 17:46:29 +02:00
DesWurstes
000000035b Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
Wladimir J. van der Laan
45c00f8416
Merge #13454: Make sure LC_ALL=C is set in all shell scripts
47776a958b Add linter: Make sure all shell scripts opt out of locale dependence using "export LC_ALL=C" (practicalswift)
3352da8da1 Add "export LC_ALL=C" to all shell scripts (practicalswift)

Pull request description:

  ~~Make sure `LC_ALL=C` is set when using `grep` range expressions.~~

  Make sure `LC_ALL=C` is set in all shell scripts.

  From the `grep(1)` documentation:

  > Within a bracket expression, a range expression consists of two characters separated by a hyphen. It matches any single character that sorts between the two characters, inclusive, using the locale's collating sequence and character set. For example, in the default C locale, `[a-d]` is equivalent to `[abcd]`. Many  locales sort characters in dictionary order, and in these locales `[a-d]` is typically not equivalent to `[abcd]`; it might be equivalent to `[aBbCcDd]`, for example. To obtain the traditional interpretation of bracket expressions, you can use the C locale by setting the `LC_ALL` environment variable to the value C.

  Context: [Locale issue found when reviewing #13450](https://github.com/bitcoin/bitcoin/pull/13450/files#r194877736)

Tree-SHA512: fd74d2612998f9b49ef9be24410e505d8c842716f84d085157fc7f9799d40e8a7b4969de783afcf99b7fae4f91bbb4559651f7dd6578a6a081a50bdea29f0909
2018-06-18 13:18:12 +02:00
practicalswift
3352da8da1 Add "export LC_ALL=C" to all shell scripts 2018-06-14 15:27:52 +02:00
practicalswift
634bd97001 Explicitly specify encoding when opening text files in Python code 2018-06-12 21:34:52 +02:00
Max Kaplan
85f0135eae
utils: checking for bitcoin addresses in translations
Checking for and removing any bitcoin addresses in translations
2018-06-05 07:49:21 -04:00
Chun Kuan Lee
253f592909 Add stdin, stdout, stderr to ignored export list 2018-06-02 19:44:33 +00:00
fanquake
93843f6891
doc: remove leftover check-doc documentation 2018-05-29 21:49:34 +08:00
Wladimir J. van der Laan
2ac6315f44
Merge #13281: test: Move linters to test/lint, add readme
fa3c910bfe test: Move linters to test/lint, add readme (MarcoFalke)

Pull request description:

  This moves the checks and linters from `devtools` to a subfolder in `test`. (Motivated by my opinion that the dev tools are mostly for generating code and updating the repo whereas the linters are read-only checks.)

  Also, adds a readme to clarify that checks and linters are only meant to prevent bugs and user facing issues, not merely stylistic preference or inconsistencies. (This is motivated by the diversity in developers and work flows as well as existing code styles. It would be too disruptive to change all existing code to a single style or too burdensome to force all developers to adhere to a single style. Also note that our style guide is changing, so locking in at the wrong style "too early" would only waste resources.)

Tree-SHA512: 9b10e89f2aeaf0c8a9ae248aa891d74e0abf0569f8e5dfd266446efa8bfaf19f0ea0980abf0b0b22f0d8416ee90d7435d21a9f9285b66df43f370b7979173406
2018-05-29 15:45:48 +02:00
MarcoFalke
fa3c910bfe
test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00
MarcoFalke
d792e47421
Merge #13228: Add script to detect circular dependencies between source modules
a7b295e91e Add circular dependencies script (Pieter Wuille)

Pull request description:

  This script finds dependencies between source code modules, treating the `.cpp` and `.h` file as one unit (so it will detect `A.cpp` depending on `B.h` where `B.cpp` depends on `A.h`). This can be used to find out which modules cannot be used independently from each other.

  It is very simplistic at this point, and assumes that a `.cpp` file's corresponding header has the exact same name, with `.cpp` replaced by `.h`. Furthermore, it assumes all `#include`s are relative to the `src/` directory.

  This is not a linter, and is not enforced through Travis or otherwise.

  This is the current output:

  ```
  $ ../contrib/devtools/circular-dependencies.py {*,*/*,*/*/*}.{h,cpp}
  Circular dependency: chain -> pow -> chain
  Circular dependency: chainparamsbase -> util -> chainparamsbase
  Circular dependency: checkpoints -> validation -> checkpoints
  Circular dependency: init -> index/txindex -> init
  Circular dependency: init -> validation -> init
  Circular dependency: init -> net_processing -> init
  Circular dependency: init -> rpc/server -> init
  Circular dependency: init -> txdb -> init
  Circular dependency: init -> validationinterface -> init
  Circular dependency: random -> util -> random
  Circular dependency: sync -> util -> sync
  Circular dependency: txmempool -> validation -> txmempool
  Circular dependency: txmempool -> policy/fees -> txmempool
  Circular dependency: validation -> index/txindex -> validation
  Circular dependency: validation -> policy/policy -> validation
  Circular dependency: validation -> validationinterface -> validation
  Circular dependency: qt/addresstablemodel -> qt/walletmodel -> qt/addresstablemodel
  Circular dependency: qt/bantablemodel -> qt/clientmodel -> qt/bantablemodel
  Circular dependency: qt/bitcoingui -> qt/walletview -> qt/bitcoingui
  Circular dependency: qt/bitcoingui -> qt/walletframe -> qt/bitcoingui
  Circular dependency: qt/bitcoingui -> qt/utilitydialog -> qt/bitcoingui
  Circular dependency: qt/clientmodel -> qt/peertablemodel -> qt/clientmodel
  Circular dependency: qt/paymentserver -> qt/walletmodel -> qt/paymentserver
  Circular dependency: qt/recentrequeststablemodel -> qt/walletmodel -> qt/recentrequeststablemodel
  Circular dependency: qt/sendcoinsdialog -> qt/walletmodel -> qt/sendcoinsdialog
  Circular dependency: qt/transactiontablemodel -> qt/walletmodel -> qt/transactiontablemodel
  Circular dependency: qt/walletmodel -> qt/walletmodeltransaction -> qt/walletmodel
  Circular dependency: rpc/rawtransaction -> wallet/rpcwallet -> rpc/rawtransaction
  Circular dependency: wallet/coincontrol -> wallet/wallet -> wallet/coincontrol
  Circular dependency: wallet/fees -> wallet/wallet -> wallet/fees
  Circular dependency: wallet/rpcwallet -> wallet/wallet -> wallet/rpcwallet
  Circular dependency: wallet/walletdb -> wallet/wallet -> wallet/walletdb
  Circular dependency: txmempool -> validation -> policy/rbf -> txmempool
  Circular dependency: txmempool -> validation -> validationinterface -> txmempool
  Circular dependency: qt/addressbookpage -> qt/bitcoingui -> qt/walletview -> qt/addressbookpage
  Circular dependency: qt/guiutil -> qt/walletmodel -> qt/optionsmodel -> qt/guiutil
  Circular dependency: qt/addressbookpage -> qt/bitcoingui -> qt/walletview -> qt/signverifymessagedialog -> qt/addressbookpage
  Circular dependency: qt/addressbookpage -> qt/bitcoingui -> qt/walletview -> qt/receivecoinsdialog -> qt/addressbookpage
  Circular dependency: qt/guiutil -> qt/walletmodel -> qt/optionsmodel -> qt/intro -> qt/guiutil
  Circular dependency: qt/addressbookpage -> qt/bitcoingui -> qt/walletview -> qt/sendcoinsdialog -> qt/sendcoinsentry -> qt/addressbookpage
  ```

Tree-SHA512: 29bc985b7a41699f4666b0aaa785ca63c2145e84c37458536f4dcf8e3de8f1312cf0323fe09cb8f348a9d363583f76eac2d5bee574bc6a9f9cc97a9b0aad406f
2018-05-18 12:52:20 -04:00
Pieter Wuille
a7b295e91e Add circular dependencies script 2018-05-16 16:55:47 -07:00
practicalswift
506c5785fb Enable Travis checking for two Python linting rules we are currently not violating 2018-05-11 09:18:19 +02:00
John Bampton
0d31ef4762 Enable W191 and W291 flake8 checks.
Remove trailing whitespace from Python files.
Convert tabs to spaces.
2018-05-11 07:59:05 +10:00
Andrew Chow
4d4185a4f0 Make gArgs aware of the arguments
gArgs knows what the available arguments are and their help. Getting
the help message is moved to gArgs and HelpMessage() is removed
2018-05-09 12:21:05 -04:00
Wladimir J. van der Laan
bf9b03ddcc
Merge #13094: tests: Add test for 64-bit Windows PE, modify 32-bit test results
ab3f4dd tests: Add test for 64-bit PE, modify 32-bit test results (Chun Kuan Lee)

Pull request description:

  9a75d29b6f change the error result from `PIE` to `DYNAMIC_BASE`. And there are no test for 64-bit, so I made one

Tree-SHA512: 9d5643dadf4d9fc34ea32d94655bfb98eec2f7bc2820b4b0f525d5acf1cd22f3acf38bf8904dda4f50fd9ca5a5e56d566a392e6f804eea6e50e03cba40048621
2018-05-07 15:14:43 +02:00
MarcoFalke
4b75dcf0ec devtools: Make linter check LogPrint calls 2018-05-02 15:14:37 +02:00
Chun Kuan Lee
ab3f4dd27f tests: Add test for 64-bit PE, modify 32-bit test results
9a75d29b6f change the error result from `PIE` to `DYNAMIC_BASE`. And there are no test for 64-bit, so I made one
2018-04-27 01:34:05 +08:00
MarcoFalke
07825088f9
Merge #12972: Add python3 script shebang lint
2bff472992 [contrib] convert test-security-check to python3 (John Newbery)
958bf40489 add lint tool to check python3 shebang (practicalswift)

Pull request description:

  base58.py can executed by python3

Tree-SHA512: 30511204feefd4ccd5b4bf698fb88e516633e692dc95d31fe957b1c0c4879de25906355b28a5a0522171887315c8464a611e601ff00540db172d5bd463ee13d9
2018-04-16 16:03:22 -04:00
practicalswift
643aad17fa Enable additional flake8 rules 2018-04-16 17:25:11 +02:00
practicalswift
f020aca297 Minor Python cleanups to make flake8 pass with the new rules enabled 2018-04-16 17:25:11 +02:00
John Newbery
2bff472992 [contrib] convert test-security-check to python3 2018-04-14 02:13:42 +08:00
practicalswift
958bf40489 add lint tool to check python3 shebang 2018-04-14 02:13:24 +08:00
MarcoFalke
3cf76c23fb
Merge #12933: doc: Refine header include policy
fad0fc3c9a Refine travis check for duplicate includes (MarcoFalke)

Pull request description:

  Since there is no harm in having "duplicate" includes and it makes it obvious what are the dependencies of each file, without having to do static analysis or jumping between files, I'd suggest to revert the travis check for duplicate includes.

  Generally, I think that enforcing minor style preferences should not be done via travis. The cost of maintaining and the burden on other developers is too high. C.f discussion in https://github.com/bitcoin/bitcoin/pull/10973#discussion_r180142594

Tree-SHA512: 97ab0e769d457ccfb873fff6c99613f8b944cd7ef95bfdccb0e1bbe8f5df1f16548c658fa03af42516f806546e75646d338a061e7b057619490235d311ca21f1
2018-04-11 10:45:47 -04:00
practicalswift
1499fdc350 Add shell script linting: Check for shellcheck warnings in shell scripts 2018-04-11 15:41:18 +02:00
MarcoFalke
fad0fc3c9a
Refine travis check for duplicate includes
This partially reverts commit c36b720d00.
2018-04-10 15:12:42 -04:00
Wladimir J. van der Laan
ebd786b72a
Merge #12852: [doc] devtools: Setup ots git integration
fa385c3 [doc] devtools: Setup ots git integration (MarcoFalke)

Pull request description:

  Document the simple steps on how to set up ots git integration.

Tree-SHA512: 1b9f99bfaa6cd9dc581243d3a3584301645e95450acc3b5898dcdb53849569de16bb8ef2676b18f6b8dd402de10aee80119e15c1b28cef36f17ad121cbba2ba3
2018-04-10 15:29:10 +02:00
MarcoFalke
fa385c3a8b
[doc] devtools: Setup ots git integration 2018-04-09 08:23:24 -04:00
practicalswift
c36b720d00 Add Travis check for duplicate includes
This enforces parts of the project header include guidelines (added by @sipa in #10575).
2018-04-09 09:18:49 +02:00
Wladimir J. van der Laan
3190785c11
Merge #12891: [logging] add lint-logs.sh to check for newline termination.
d207207 [logging] add lint-logs.sh to check for newline termination. (John Newbery)
5c21e6c [logging] Comment all continuing logs. (John Newbery)

Pull request description:

  Check that all calls to LogPrintf() are terminated by a newline,
  except those that are explicitly marked as 'continued' logs.

Tree-SHA512: fe5162b2b2df1e8a4c807da87584fa9af97a6b8377e4090fe0caa136d90bf29a487a123cde94569bdce7101fee3478196d99aa13f1212e24bfe5f41c773604fc
2018-04-08 11:04:49 +02:00
John Newbery
d207207fd3 [logging] add lint-logs.sh to check for newline termination.
Check that all calls to LogPrintf() are terminated by a newline,
except those that are explicitly marked as 'continued' logs.
2018-04-07 12:29:52 -04:00
practicalswift
d1b622b5a2 tests: Add check for test suite name uniqueness in lint-tests.sh 2018-04-06 16:29:14 +02:00
MarcoFalke
0c5f67b8e5
Merge #12757: Clarify include guard naming convention
3bcc0059b8 Add lint-include-guards.sh which checks include guard consistency (practicalswift)
8fd6af89a0 Fix missing or inconsistent include guards (practicalswift)
8af65d96f4 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
2018-04-01 18:30:21 -04:00
MarcoFalke
9beded5860
Merge #12719: tests: Add note about test suite naming convention in developer-notes.md
db983beba6 tests: Add lint-tests.sh which checks the test suite naming convention (practicalswift)
5fd864fe8a tests: Rename test suits not following the test suite naming convention (practicalswift)
7b4a296a71 tests: Add note about test suite naming convention (practicalswift)

Pull request description:

  Changes:
  * Add note about test suite naming convention
  * Fix exceptions
  * Add regression test

  Rationale:
  * Consistent naming of test suites makes programmatic test running of specific tests/subsets of tests easier
  * Explicit is better than implicit

  Before this commit:

  ```
  $ contrib/devtools/lint-tests.sh
  The test suite in file src/test/foo_tests.cpp should be named
  "foo_tests". Please make sure the following test suites follow
  that convention:

  src/test/blockchain_tests.cpp:BOOST_FIXTURE_TEST_SUITE(blockchain_difficulty_tests, BasicTestingSetup)
  src/test/prevector_tests.cpp:BOOST_FIXTURE_TEST_SUITE(PrevectorTests, TestingSetup)
  src/wallet/test/coinselector_tests.cpp:BOOST_FIXTURE_TEST_SUITE(coin_selection_tests, WalletTestingSetup)
  src/wallet/test/crypto_tests.cpp:BOOST_FIXTURE_TEST_SUITE(wallet_crypto, BasicTestingSetup)
  $
  ```

  After this commit:

  ```
  $ contrib/devtools/lint-tests.sh
  $
  ```

Tree-SHA512: 7258ab9a6b9b8fc1939efadc619e2f2f02cfce8034c7f2e5dc5ecc769aa12e17f6fb8e363817feaf15c026c5b958b2574525b8d2d3f6be69658679bf8ceea9e9
2018-04-01 18:28:22 -04:00
MarcoFalke
fa5825d610
Merge #12284: Remove assigned but never used local variables. Enable Travis checking for unused local variables.
ea04bf7862 Enable flake8 warning F841 ("local variable 'foo' is assigned to but never used") (practicalswift)
169f3e8637 Remove assigned but never used local variables (practicalswift)

Pull request description:

  Remove assigned but never used local variables. Enable Travis checking for unused local variables.

Tree-SHA512: d6052ec9044c5d1f03d874ea3c8addd5a156779213ef9200f89d3ae53230f2fd1691aff405c3dae14178e5ef09912c4432e92f606ef4a5220ed9daa140cdee81
2018-04-01 18:24:30 -04:00
MarcoFalke
5e53b80b02
Merge #12820: contrib: Fix check-doc script regexes
0c17e27630 init: Remove help text for non-existent -fuzzmessagestest arg (MarcoFalke)
136084470c contrib: Fix check-doc script regexes (MarcoFalke)

Pull request description:

  Fixup the regexes to properly find all used args. The regex should now match all of the getter and setter methods of the `ArgsManager`. See https://dev.visucore.com/bitcoin/doxygen/class_args_manager.html#pub-methods

  Before:
  ```
  Args used        : 159
  Args documented  : 188
  Args undocumented: 0
  Args unknown     : 29
  ```

  After:
  ```
  Args used        : 183
  Args documented  : 188
  Args undocumented: 0
  Args unknown     : 5
  ```

Tree-SHA512: 1a7fb7ea55b2f6030358a1055d8f2c19b31f69d0603be0b009e6e603564014b4e2bb824357c9d43d0fba3ce7159b7c4e7eaa60b3f962053d94f73d0e626294fc
2018-03-30 11:40:16 -04:00
Wladimir J. van der Laan
252c1b0fae
Merge #12829: Python3 fixup
f50975b [contrib] fixup symbol-check.py Python3 support (John Newbery)
5de2b18 [contrib] fixup security-check.py Python3 support (John Newbery)

Pull request description:

  security-check.py and symbol-check.py were broken by #11881. Fix them.

Tree-SHA512: 86de3d6dc3292b1ae4cc04c2d7d7dbbf39c9270551d7b224b8d8b19e3184c30c897dbf823200403706d06bb405c0decad5cfd690cb2c0312992a235a4ffcf6bf
2018-03-29 22:34:25 +02:00
practicalswift
ea04bf7862 Enable flake8 warning F841 ("local variable 'foo' is assigned to but never used") 2018-03-29 18:21:03 +02:00
practicalswift
169f3e8637 Remove assigned but never used local variables 2018-03-29 17:47:12 +02:00
John Newbery
f50975b136 [contrib] fixup symbol-check.py Python3 support 2018-03-28 16:58:42 -04:00
John Newbery
5de2b18c67 [contrib] fixup security-check.py Python3 support 2018-03-28 15:46:54 -04:00
MarcoFalke
05120ee755 contrib: Remove unused import string 2018-03-28 14:35:28 -04:00
MarcoFalke
136084470c contrib: Fix check-doc script regexes 2018-03-28 14:13:29 -04:00
John Newbery
bc6fdf2d15 Change all python files to use Python3 2018-03-26 16:49:33 -04:00
practicalswift
3bcc0059b8 Add lint-include-guards.sh which checks include guard consistency 2018-03-22 19:41:16 +01:00
practicalswift
db983beba6 tests: Add lint-tests.sh which checks the test suite naming convention 2018-03-19 08:54:08 +01:00
MarcoFalke
d8d9162f5b
Merge #12572: [script] lint-whitespace: find errors more easily
0fbed98e42 [script] lint-whitespace: improve print linenumber (Akio Nakamura)

Pull request description:

  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.

  example:

  0) git diff
  ```
  diff --git a/dummy.txt b/dummy.txt
  index c0ce4d776..aebbdb88d 100644
  --- a/dummy.txt
  +++ b/dummy.txt
  @@ -1,2 +1,2 @@
  -1
  -2
  +1
  +       2
  @@ -8,2 +8,2 @@
  -8
  -9
  +       8
  +9
  ```

  1) before this PR - Is there "9 " in second line? It may lead to be misunderstood.
  ```
  This diff appears to have added new lines with trailing whitespace.
  The following changes were suspected:

  diff --git a/dummy.txt b/dummy.txt
  @@ -1,2 +1,2 @@
  +1
  +9
  ```

  2) after this PR
  ```
  This diff appears to have added new lines with trailing whitespace.
  The following changes were suspected:

  diff --git a/dummy.txt b/dummy.txt
  @@ -1,2 +1,2 @@
  +1
  @@ -8,2 +8,2 @@
  +9
  ```

Tree-SHA512: 2fd52e3c982786f86cfe10aa2578589bc9c502bcad9b85111467840d726143330c23968cde5483ee0f563893c8381044b80e8c22a7c8eca56fc73c548b9a9496
2018-03-11 17:30:04 -04:00
Wladimir J. van der Laan
17c44b208f
Merge #12098: [scripts] lint-whitespace: add param to check last N commits
8dbf740f8 [scripts] lint-whitespace: check last N commits or unstaged changes (Sjors Provoost)

Pull request description:

  E.g. before you push three commits to Github and upset Travis, check if you didn't make any whitespace mistakes:
  ```sh
  contrib/devtools/lint-whitespace.sh 3
  ```

  This is slightly more convenient than doing:
  ```sh
  TRAVIS_COMMIT_RANGE=HEAD~3...HEAD contrib/devtools/lint-whitespace.sh
  ```

Tree-SHA512: 5d9c1ae978ccbe59477e8cf53391e9bd697d2da87f417a2519264af560d4768138e0b2d320dd497a1f1e704e18ab279d724f523b57c17a80ccd753133a5445bf
2018-03-06 23:17:26 +01:00
Wladimir J. van der Laan
14475e2dcd
Merge #12097: [scripts] lint-whitespace: use perl instead of grep -P
40b17f5f9 [scripts] lint-whitespace: use perl instead of grep -P (Sjors Provoost)

Pull request description:

  MacOS does not support `grep -P` out of the box. This change makes
  it easier for developers to check for whitespace problems locally.

  Based on [this](https://stackoverflow.com/a/16658690) and [this](https://serverfault.com/a/504387) Stack Exchange answer.

  Tested with:
  ```sh
  export TRAVIS_COMMIT_RANGE='fe78c9a...62e0453'
  contrib/devtools/lint-whitespace.sh
  This diff appears to have added new lines with tab characters instead of spaces.
  The following changes were suspected:

  diff --git a/src/test/bignum_tests.cpp b/src/test/bignum_tests.cpp
  @@ -0,0 +1,110 @@
  +	num.setint64(n);
  ```

Tree-SHA512: 37c342a0ca2580289cf326a278a051a7c21ba918d6b2143fd9987f159fab85f1de3d770fcf532a642cd5d1957afc8595678128196e102dc473924758f133db7f
2018-03-06 23:09:40 +01:00
Akio Nakamura
0fbed98e42 [script] lint-whitespace: improve print linenumber
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.
2018-03-01 16:03:38 +09:00
MarcoFalke
dcfe218626
Merge #12308: contrib: Add support for out-of-tree builds in gen-manpages.sh
526e28220a contrib: Add support for out-of-tree builds in gen-manpages.sh (Wladimir J. van der Laan)

Pull request description:

  This adds support for setting the environment variable `BUILDDIR` to point to executables that are outside the source directory.

  E.g. to invoke the tool when the build is in $PWD/build:

  ```bash
  BUILDDIR=$PWD/build contrib/devtools/gen-manpages.sh
  ```

  This avoids having to manually copy the generated manpages after they end up in the build instead of source path, when setting TOPDIR instead.

Tree-SHA512: 8dc6dd7a47a0c014ae7d27f0ac9d86f69238ec6bac8a3007b975bb88c9f37014755c716c5e62604dd91baad2f8a41fd1544cdca3ba4b59bc76602e6593f4a4a7
2018-02-18 18:04:57 -05:00
MarcoFalke
fafbf7f74e
devtools: Exclude patches from lint-whitespace 2018-02-15 14:39:04 -05:00
Wladimir J. van der Laan
526e28220a contrib: Add support for out-of-tree builds in gen-manpages.sh
This adds support for setting the environment variable `BUILDDIR`
to point to executables that are outside the source directory.

E.g. to invoke the tool when the build is in $PWD/build:

```bash
BUILDDIR=$PWD/build contrib/devtools/gen-manpages.sh
```
2018-01-31 11:27:36 +01:00
practicalswift
a9d0ebc262 Enable flake8 warnings for all currently non-violated rules 2018-01-29 23:22:58 +01:00
practicalswift
0b9207efbe Enable flake8 warning for "list comprehension redefines 'foo' from line N" (F812) 2018-01-29 20:23:58 +01:00
Sjors Provoost
8dbf740f80
[scripts] lint-whitespace: check last N commits or unstaged changes
Get usage instructions:
.lint-whitespace.sh -?
2018-01-08 12:10:07 +01:00
Sjors Provoost
40b17f5f91
[scripts] lint-whitespace: use perl instead of grep -P
MacOS does not support 'grep -P' out of the box. This change makes
it easier for developers to check for whitespace problems locally.
2018-01-05 14:41:01 +01:00
MarcoFalke
c991b304de
Merge #12075: [scripts] Add missing univalue file to copyright_header.py
415f86c6ae [scripts] Add missing univalue file to copyright_header.py (fanquake)

Pull request description:

  This needs to be added so that PRs like #12062 don't modify the subtree.

Tree-SHA512: 3642bdb0c8271ae700857a79fa5800b0c26c4b3f126d4406f224293817fb74d498fa1fc581d576ae747fbbb6952d4369fc4ab823ab48fd0946c1e8ccbe93cee6
2018-01-03 06:03:03 -09:00
Akira Takizawa
595a7bab23 Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
fanquake
415f86c6ae
[scripts] Add missing univalue file to copyright_header.py 2018-01-02 10:20:50 +08:00
practicalswift
d60b320740 Add Travis check for unused Python imports 2017-12-10 11:49:43 +01:00
Pieter Wuille
c17f11f7b4
Merge #10773: Shell script cleanups
13a81b19d Add quotes to variable assignment (as requested by @TheBlueMatt) (practicalswift)
683b9d280 Fix valid path output (practicalswift)
193c2fb4c Use bash instead of POSIX sh. POSIX sh does not support arrays. (practicalswift)
80f5f28d3 Fix incorrect quoting of quotes (the previous quotes had no effect beyond unquoting) (practicalswift)
564a172df Add required space to [[ -n "$1" ]] (previously [[ -n"$1" ]]) (practicalswift)
1e44ae0e1 Add error handling: exit if cd fails (practicalswift)
b9e79ab41 Remove "\n" from echo argument. echo does not support escape sequences. (practicalswift)
f6b3382fa Remove unused variables (practicalswift)

Pull request description:

  Shell script cleanups:
  * Add required space to `[ -n ]`.
  * Avoid quote within quote.
  * Exit if `cd` fails.
  * Remove `\n` which is not handled by `echo`.
  * ~~Remove redundant `$` in arithmetic variable expression.~~
  * ~~Use `$(command)` instead of legacy form `` `command` ``.~~
  * Arrays are not supported in POSIX `sh`. Use `bash` when arrays are used.
  * ~~`[ foo -a bar ]` is not well defined, use `[ foo ] && [ bar ]` instead.~~
  * ~~`[ foo -o bar ]` is not well defined, use `[ foo ] || [ bar ]` instead.~~

Tree-SHA512: 80f6ded58bce625b15b4da30d69d2714c633e184e62b21ed67d2c58e2ebaa08b4147593324012694d02bf4f1f252844cdff2fd1cf5e817ddb07e2777db7a6390
2017-12-04 15:52:11 -08:00
MarcoFalke
6e4e98ee8c
Merge #11394: Perform a weaker subtree check in Travis
487aff421 Check subtree consistency in Travis (Pieter Wuille)
e1d0cc23a Improve git-subtree-check.sh (Pieter Wuille)

Pull request description:

  Apparently many of our subtrees get modified by PRs in this repository, without getting noticed.

  To improve upon this:
  * Make git-subtree-check.sh capable of doing a weaker consistency check (that doesn't need access to external repositories), but which should be sufficient to detect unintended changes. It can be fooled by a fake subtree merge commit, but that would hopefully be obvious to reviewers.
  * Make Travis invoke this subtree check for each of our subtrees.

  Note that Travis is currently expected to fail on this PR, as 2 out of 4 subtrees (`src/secp156k1` and `src/univalue` have been modified directly in master).

Tree-SHA512: 465b680392d3daf38a8c1dda77d6f74b1d1c23324c378774777fb95aa673e119a8f7e3ccc124e41d97b5ac8975f3d79f3015797d2d309666582394364917ec4e
2017-11-09 17:06:20 -05:00
MarcoFalke
fa0025dc3c Revert "Remove unused variable in shell script"
This partially reverts commit ab8e8b97a3
2017-11-09 16:49:25 -05:00
Wladimir J. van der Laan
23e9074e0a
Merge #10771: Remove unused variables in shell scripts
ab8e8b9 Remove unused variables in shell scripts. (practicalswift)

Pull request description:

  Remove unused variables in shell scripts. Use `_` where we don't care about the result.

Tree-SHA512: 35049e79ee432c805f061456c32902a92811b5214d50ce6770b22d1442cc5999ed53cfe05bb2347f6995ca33c707a0f3fe92d5829c0385c4a3e254953924cbc4
2017-11-09 21:20:20 +01:00
practicalswift
193c2fb4c8 Use bash instead of POSIX sh. POSIX sh does not support arrays. 2017-10-18 17:10:23 +02:00
Pieter Wuille
e1d0cc23a9 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.
2017-10-11 11:40:57 -07:00
MarcoFalke
fae2673d5d qa: check-rpc-mapping must not run on empty lists 2017-10-01 16:46:56 +02:00
Wladimir J. van der Laan
96d91b79bd
contrib: Ignore historical release notes for whitespace check
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
2017-09-14 16:21:09 +02:00