Commit Graph

361 Commits

Author SHA1 Message Date
laanwj
9eedbe98c8
Merge bitcoin/bitcoin#24815: lint: convert lint-tests.sh to python
ae0e06a439 Converted lint-tests.sh to python (TakeshiMusgrave)

Pull request description:

  Reference issue: https://github.com/bitcoin/bitcoin/issues/24783

ACKs for top commit:
  laanwj:
    Tested ACK ae0e06a439

Tree-SHA512: a118295b5b6b5199b52d46b54de871d88dd544112e7dd5001a9575d65b093af0aea390f9ad223462a4fc6a201bd8c4debe5e26bfa4860a90c97cfe300477c04a
2022-04-25 19:27:37 +02:00
laanwj
0342ae1d39
Merge bitcoin/bitcoin#24802: lint: convert format strings linter test to python
267684ee34 lint: convert format strings linter test to python (Eunoia)

Pull request description:

  Refs #24783

  Attempted to keep the style and flow of implementation as it is.

  ### Additional Notes(Optional):
  1. There is scope of improvement on how the related files are fetched. In this `git grep` with `subprocess` is still used as I found it to be the simplest. Any pointers on this are appreciated.
  2. Removed sort operation on the matching files as I couldn't think of any strong arguments to have it. Any pointers on this are appreciated.
  3. Not important, but one small detail is that the previous implementation was storing matched files for all the `function_names` iterated so far. Fixed that in this PR.

ACKs for top commit:
  laanwj:
    Code review ACK 267684ee34

Tree-SHA512: 54ceae0c3501e561fdd9c5167b2dd8dd06da1b3697a077a042210970ce7004bda8c4e19abb1905ee64cbdce635f0a078508da645846ae7e81c016091f3f02458
2022-04-25 18:32:40 +02:00
laanwj
777b89b300
Merge bitcoin/bitcoin#24929: lint: convert shell locale linter test to Python
2c838cc309 lint: convert shell locale linter test to Python (Eunoia)

Pull request description:

  Refs #24783

ACKs for top commit:
  laanwj:
    Code review ACK 2c838cc309

Tree-SHA512: 3cb5e7c7cd2acbdf0dc45096055b33cbfa0ec9e47ea567452d23a49a7441b3b62a8416879f234459c86fa892c42205c91d8a575115346c023ab0152cf713e20c
2022-04-25 18:23:02 +02:00
laanwj
8b686776ef
Merge bitcoin/bitcoin#24902: lint: Convert lint-include-guards.sh to Python
d5fdec5cf8 Convert lint-include-guards.sh to python (brydinh)

Pull request description:

  This PR addresses [issue 24783](https://github.com/bitcoin/bitcoin/issues/24783).  Converted lint-include-guards.sh to python.

ACKs for top commit:
  KevinMusgrave:
    Tested ACK d5fdec5cf8
  laanwj:
    Code review ACK d5fdec5cf8

Tree-SHA512: cae566fc1b222b447c0d60ea20fd012f1cfde4dd07c1762ede2b2c9f84ed59ee8e629db1264dab8ac20bcac410e4c389827addf0a59757f94b40a65ea9bab466
2022-04-25 18:14:54 +02:00
laanwj
c90b42bcdb
Merge bitcoin/bitcoin#24916: lint: Convert lint-python-utf8-encoding.sh to Python
035eef4be6 lint: Convert lint-python-utf8-encoding.sh to Python (Dimitri)

Pull request description:

  A port of `test/lint/lint-python-utf8-encoding.sh` to a Python-script as part of the request of #24783. Checked for output-consistency.

ACKs for top commit:
  laanwj:
    Code review ACK 035eef4be6

Tree-SHA512: a8a2f505bf7953d318837182101346c44e73cfd1bf3b5342ff1400fb1c67c5292519fa99db1035da87cf27fb5f5ac5d28871bf55a1c085b5f8a3bb33ff0fa3fb
2022-04-25 17:58:25 +02:00
laanwj
7134327be5
Merge bitcoin/bitcoin#24932: lint: Convert lint-locale-dependence.sh to Python
3043a1bc9d lint: Make known violations more specific in lint-locale-dependence (Dimitri)
229917d3d4 lint: Convert lint-locale-dependence.sh to Python (Dimitri)

Pull request description:

  A port of `test/lint/lint-locale-dependence.sh` to a Python-script as part of the request of #24783. Checked for output-consistency.

ACKs for top commit:
  laanwj:
    Tested and code review ACK 3043a1bc9d

Tree-SHA512: 80555cf7aac156bab5488f85098731d1c12a42667fe7d0df0c35487ab8fc951654a70a15351a759282eabab8319f5aabd8bdb153412b9edc3a9033bef64fd609
2022-04-25 17:53:53 +02:00
Dimitri
035eef4be6 lint: Convert lint-python-utf8-encoding.sh to Python 2022-04-21 23:26:45 +02:00
Dimitri
3043a1bc9d lint: Make known violations more specific in lint-locale-dependence 2022-04-21 20:03:32 +02:00
Dimitri
229917d3d4 lint: Convert lint-locale-dependence.sh to Python 2022-04-21 19:31:41 +02:00
laanwj
2513499348
Merge bitcoin/bitcoin#24803: lint: convert submodule linter test to Python
4a9e36dbaf lint: convert submodule linter test to Python (Eunoia)

Pull request description:

  Refs #24783

ACKs for top commit:
  laanwj:
    Tested ACK 4a9e36dbaf

Tree-SHA512: ca25b59acf75cebc79588a6c51dc5c313c8d0bd1d492127815d7b81b36aaffd02815a515d97b355582002f71efc33d46435d0b28fce24497bb99799d9ba57228
2022-04-21 17:10:43 +02:00
Eunoia
2c838cc309 lint: convert shell locale linter test to Python 2022-04-20 14:37:52 +00:00
brydinh
d5fdec5cf8 Convert lint-include-guards.sh to python
Specify encoding when reading header files, add docstring

Update test/lint/lint-include-guards.py  include guard count logic

Co-authored-by: Kevin Musgrave <tkm45@cornell.edu>

Update test/lint/lint-include-guards.py by removing whitespace
2022-04-20 09:52:58 -04:00
MarcoFalke
fc99f8c09e
Merge bitcoin/bitcoin#24895: lint: Convert lint-includes.sh to Python
67b41678c8 lint: Convert lint-includes.sh to Python (Dimitri)

Pull request description:

  A port of `test/lint/lint-includes.sh` to a Python-script as part of the request of #24783. Checked for output-consistency.

ACKs for top commit:
  KevinMusgrave:
    Tested ACK 67b41678c8

Tree-SHA512: 05b4b114dc101e571004aee8aea1480e4dda1dc645426100649e9cb81e56e8667f88d6d5646a9860ea1c7abc36754eda2a77ec10156c54b62db00e2c00b8ceae
2022-04-20 09:55:33 +02:00
Eunoia
4a9e36dbaf lint: convert submodule linter test to Python 2022-04-20 05:21:13 +00:00
Dimitri
67b41678c8 lint: Convert lint-includes.sh to Python 2022-04-19 02:23:56 +02:00
laanwj
57a73d71a3
Merge bitcoin/bitcoin#24794: lint: Convert Python linter to Python
47b66ac4ac lint: Convert Python linter to Python (Fabian Jahr)

Pull request description:

  The outputs provided by the Python version should be exactly the same as the ones from the shell version.

  There is small improvement here: Previously only the dependency of `flake9` was checked, now all dependencies are checked before running.

  I also tried to mostly follow the [recommendations here](https://github.com/bitcoin/bitcoin/pull/24766#pullrequestreview-932953476) but happy to make more changes if there is still room for improvement.

ACKs for top commit:
  laanwj:
    Tested ACK 47b66ac4ac

Tree-SHA512: 1630188e176c1063b8905669b76682b361a858cde6990ab17e51ad4333bf376eab796050cdb9f2967b84f1f74379d9e860c4258561b1964e1a47183c593e5bb4
2022-04-18 18:51:15 +02:00
laanwj
5fdf37e14b
Merge bitcoin/bitcoin#24853: lint: Convert lint-git-commit-check.sh to Python
f27fcd9bf4 lint: Convert lint-git-commit-check.sh to Python (Dimitri)

Pull request description:

  A port of `/test/lint/lint-git-commit-check.sh` to a Python-script as part of the request of #24783 . Checked for output-consistency.

ACKs for top commit:
  laanwj:
    re-ACK f27fcd9bf4

Tree-SHA512: afc4a662f4aec1796c023b98a875c1591940ecdfc709eefe2df29d33e51e807c3c2e2b5c410aa3ad1cd3f6f8207f5c15b638637ff9f5659cafa7543bbe8a0bae
2022-04-18 18:04:34 +02:00
laanwj
3059d4dd72
Merge bitcoin/bitcoin#24844: lint: Convert lint-whitespace.sh to Python
a75f6d86d1 lint: Convert lint-whitespace.sh to Python (Dimitri)

Pull request description:

  A port of `/test/lint/lint-whitespace.sh` to a Python-script as part of the request of #24783 . Checked for output-consistency.

ACKs for top commit:
  laanwj:
    Code review and tested ACK a75f6d86d1

Tree-SHA512: 982041b0beb1b3866493ad523950c9a536a8b1ec79b773fe86dbc1166844c13a30b384e92025f845d45d25334f90f3abda5fa23f0f28e7c2cddc5e496f84c445
2022-04-18 17:50:07 +02:00
Fabian Jahr
47b66ac4ac
lint: Convert Python linter to Python 2022-04-18 00:55:06 +02:00
Dimitri
a75f6d86d1 lint: Convert lint-whitespace.sh to Python 2022-04-16 15:53:15 +02:00
Dimitri
f27fcd9bf4 lint: Convert lint-git-commit-check.sh to Python 2022-04-16 15:43:19 +02:00
TakeshiMusgrave
ae0e06a439 Converted lint-tests.sh to python
Use raw string

Use re.search instead of grep in check_matching_test_names

Replaced bash commands in check_unique_test_names with python commands

Use set and sort output

Use set comprehension

Use .splitlines()

Call grep_boost_fixture_test_suite once

splitlines() once

Fixed copyright date

Use check_output() instead of run()

add encoding='utf8'

Use clearer code for getting duplicates
2022-04-15 10:10:03 -04:00
Eunoia
267684ee34 lint: convert format strings linter test to python 2022-04-13 21:32:20 +00:00
TakeshiMusgrave
e8e48fa82b Converted lint-python-mutable-default-parameters.sh to python
Change permission

Change argument so that it's compatiable with python 3.6

Change comment to docstring

Remove .split, .append, .extend calls. Remove 'output' variable assignment
2022-04-08 11:53:47 -04:00
fanquake
b72925e7ce
lint: remove qt SIGNAL/SLOT lint
I think we are past the point where we need to lint for this, the CPU
can probably be better utilized.
2022-04-06 19:47:16 +01:00
fanquake
4105a54381
lint: remove boost::bind linter
I don't think we need to maintain a linter for reintroducing boost::bind
at this point.
2022-04-06 14:09:47 +01:00
MarcoFalke
70c522004f
Merge bitcoin/bitcoin#24766: lint: convert spellchecking lint test to python
4685463301 doc: Update lint test docs (Fabian Jahr)
77f98df41f lint: convert spell check lint test to python (Fabian Jahr)

Pull request description:

  The new python version should produce the exact same output as the bash version but be easier to maintain.

ACKs for top commit:
  MarcoFalke:
    cr ACK 4685463301

Tree-SHA512: 242b802b750b42b299b93d1de4bcf17d92ad0a633d31894145d8590782a1db1041de59a283f133a4f75898d95444eb3c842005a6aa5cb919543625addad596d8
2022-04-06 09:12:45 +02:00
Fabian Jahr
076cd6835f
lint: Convert Python dead code linter to Python 2022-04-06 00:55:22 +02:00
Fabian Jahr
77f98df41f
lint: convert spell check lint test to python 2022-04-06 00:16:01 +02:00
Dimitri
e9d277131c lint: Convert lint-logs.sh to Python 2022-04-14 02:43:31 +02:00
MarcoFalke
fae211c0ae
lint: Start to use py lint scripts 2022-04-04 16:58:54 +02:00
MarcoFalke
fa82e890e7
Move lint script and data file to avoid lint- prefix
This is needed for the next commit
2022-04-04 16:58:07 +02:00
MarcoFalke
3c565302aa
Merge bitcoin/bitcoin#24409: Always output license/copyright info with -version
5a89bed410 contrib: address gen-manpages feedback from #24263 (fanquake)
2618fb8d15 Output license info when binaries are passed -version (fanquake)
4c3e3c5746 refactor: shift CopyrightHolders() and LicenseInfo() to clientversion.cpp (fanquake)

Pull request description:

  Addresses a review comment from #24263, and addresses the [comment](https://github.com/bitcoin/bitcoin/pull/24263#issuecomment-1030582925) where it was pointed out that we are inconsistent with emitting  our copyright. After this change, the copyright is always emitted with `-version`, rather than `-help`, i.e:
  ```bash
  bitcoind -version

  Bitcoin Core version v22.99.0-fc1f355913f6-dirty
  Copyright (C) 2009-2022 The Bitcoin Core developers

  Please contribute if you find Bitcoin Core useful. Visit
  <https://bitcoincore.org/> for further information about the software.
  The source code is available from <https://github.com/bitcoin/bitcoin>.

  This is experimental software.
  Distributed under the MIT software license, see the accompanying file COPYING
  or <https://opensource.org/licenses/MIT>
  ```

  The info is also added to binaries other than `bitcoind`/`bitcoin-qt`. This change also prevents duplicate copyright info appearing in the `bitcoind` man page.

ACKs for top commit:
  laanwj:
    Tested ACK 5a89bed410

Tree-SHA512: 0ac2a1adf9e9de0c3206f35837008e3f93eaf15b193736203d71609273f0887cca20b8a90972cb9f941ebd62b330d61a0cbb5fb1b7a7f2dbc715ed8a0c1569d9
2022-02-23 09:39:42 +01:00
fanquake
5b8f2484ba
lint: remove no-longer used exceptions from lint-format-strings.py 2022-02-22 15:51:27 +00:00
fanquake
4c3e3c5746
refactor: shift CopyrightHolders() and LicenseInfo() to clientversion.cpp 2022-02-22 15:36:19 +00:00
fanquake
39e66e938f
build: use header-only Boost unit test 2022-02-13 20:59:02 +00:00
Kiminuo
41d7166c8a
refactor: replace boost::filesystem with std::filesystem
Warning: Replacing fs::system_complete calls with fs::absolute calls
in this commit may cause minor changes in behaviour because fs::absolute
no longer strips trailing slashes; however these changes are believed to
be safe.

Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2022-02-03 18:35:52 +08:00
brunoerg
58ccc88541 lint: add creat and ba into ignore-words for lint-spelling 2022-01-30 16:16:18 -03:00
MarcoFalke
b3122e167a
Merge bitcoin/bitcoin#23543: test: Prevent non-compatible sed binary for scripted-diffs
d8dfc403f7 script: redirecting stderr to stdout before pipelining into grep (anouar kappitou)
30df5c3dd4 script: preventing non-compatible sed binary. (anouar kappitou)

Pull request description:

  This Pull request improve scripted diff by checking for non-compatible sed binary. Fixes #19815

ACKs for top commit:
  shaavan:
    reACK d8dfc403f7
  theStack:
    Tested ACK d8dfc403f7

Tree-SHA512: 4813abb02195e04b8953662e51cba4599789e6185a6d384f56255e2d37c2b16be46c7c8861e44ba1a13d42573a58eb708901472925cb308dba2f602020e9f0f6
2022-01-24 12:22:07 +01:00
anouar kappitou
d8dfc403f7
script: redirecting stderr to stdout before pipelining into grep
Co-authored-by: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
2022-01-22 12:36:19 +01:00
James O'Beirne
b5c9bb5cb9 util: Restore GetIntArg saturating behavior
The new locale-independent atoi64 method introduced in #20452 parses
large integer values higher than maximum representable value as 0
instead of the maximum value, which breaks backwards compatibility.
This commit restores compatibility and adds test coverage for this case
in terms of the related GetIntArg and strtoll functions.

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
2022-01-11 19:54:36 -05:00
Hennadii Stepanov
1362d6173f
scripted-diff: Insert missed copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py insert contrib/guix/libexec/build.sh
./contrib/devtools/copyright_header.py insert contrib/guix/libexec/codesign.sh
./contrib/devtools/copyright_header.py insert contrib/tracing/log_raw_p2p_msgs.py
./contrib/devtools/copyright_header.py insert contrib/tracing/log_utxocache_flush.py
./contrib/devtools/copyright_header.py insert contrib/tracing/p2p_monitor.py
./contrib/devtools/copyright_header.py insert test/lint/lint-files.sh
-END VERIFY SCRIPT-
2021-12-30 19:46:41 +02:00
Hennadii Stepanov
f47dda2c58
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-

Commits of previous years:
* 2020: fa0074e2d8
* 2019: aaaaad6ac9
2021-12-30 19:36:57 +02:00
MarcoFalke
4633199cc8
Merge bitcoin/bitcoin#22677: cut the validation <-> txmempool circular dependency 2/2
a64078e385 Break validation <-> txmempool circular dependency (glozow)
64e4963c63 [mempool] always assert coin spent (glozow)
bb9078ed51 [refactor] put finality and maturity checking into a lambda (glozow)
bedf246f1e [mempool] only update lockpoints for non-removed entries (glozow)
1b3a11e126 MOVEONLY: TestLockPointValidity to txmempool (glozow)

Pull request description:

  Remove 2 circular dependencies: validation - txmempool and validation - policy/rbf - txmempool

  Validation should depend on txmempool (e.g. `CChainstateManager` has a mempool and we often need to know what's in our mempool to validate transactions), but txmempool is a data structure that shouldn't really need to know about chain state.

  - Changes `removeForReorg()` to be parameterized by a callable that returns true/false (i.e. whether the transaction should be removed due to being now immature or nonfinal) instead of a `CChainState`. The mempool really shouldn't need to know about coinbase maturity or lockpoints, it just needs to know which entries to remove.

ACKs for top commit:
  laanwj:
    Code review ACK a64078e385
  mjdietzx:
    reACK a64078e385
  theStack:
    re-ACK a64078e385

Tree-SHA512: f75995200569c09dfb8ddc09729da66ddb32167ff1e8a7e72f105ec062d2d6a9a390e6b4a2a115e7ad8ad3525f891ee1503f3cd2bed11773abcaf7c3230b1136
2021-12-01 17:56:08 +01:00
W. J. van der Laan
c5712d172e
Merge bitcoin/bitcoin#23506: test: Make more shell scripts verifiable by the shellcheck tool
a3f61676e8 test: Make more shell scripts verifiable by the `shellcheck` tool (Hennadii Stepanov)

Pull request description:

  Some shell scripts from `contrib/guix` and `contrib/shell` are not verifiable by the `shellcheck` tool for the following reasons:
  - they have no extension (see 4eccf063b2 from bitcoin/bitcoin#21375)
  - they have the `.bash` extension while `.sh` is expected

  This PR adds these scripts to the input for the `shellcheck` tool, and it fixes discovered `shellcheck` warnings.

ACKs for top commit:
  dongcarl:
    Code Review ACK a3f61676e8, this is a good robustness improvement for our shell scripts.
  jamesob:
    crACK a3f61676e8

Tree-SHA512: 6703f5369d9c04c1a174491f381afa5ec2cc4d37321c1b93615abcdde4dfd3caae82868b699c25b72132d8c8c6f2e9cf24d38eb180ed4d0f0584d8c282e58935
2021-11-30 20:05:44 +01:00
glozow
a64078e385 Break validation <-> txmempool circular dependency
No behavior change.

Parameterize removeForReorg using a CChain and callable that
encapsulates validation logic.  The mempool shouldn't need to know a
bunch of details about coinbase maturity and lock finality. Instead,
just pass in a callable function that says true/false. Breaks circular
dependency by removing txmempool's dependency on validation.
2021-11-30 12:21:56 +00:00
Hennadii Stepanov
a3f61676e8
test: Make more shell scripts verifiable by the shellcheck tool 2021-11-28 14:08:54 +02:00
anouar kappitou
30df5c3dd4 script: preventing non-compatible sed binary. 2021-11-20 12:03:58 +01:00
MarcoFalke
fa186eb7f4
Remove strtol in torcontrol 2021-11-18 18:13:21 +01:00
MarcoFalke
fa44237d76
doc: Fix typos in endif header comments 2021-11-16 09:56:45 +01:00