~fuzzbawls/pivx-core/+git/test:2023_lint-spelling

Last commit made on 2023-08-23
Get this branch:
git clone -b 2023_lint-spelling https://git.launchpad.net/~fuzzbawls/pivx-core/+git/test

Branch merges

Branch information

Name:
2023_lint-spelling
Repository:
lp:~fuzzbawls/pivx-core/+git/test

Recent commits

27b0e0c... by Fuzzbawls

[Lint] lint spelling

4264308... by Fuzzbawls

Merge #2877: [Tests][Scripts] Bump Python version to 3.8 and add more linting

c340533f152426106e33df9f3e78bd9c55b726bb Bump python version to 3.8 (Fuzzbawls)
17bc5bf7bc96044ddcba2620f12eed8008212704 tests: remove redundant function (Fuzzbawls)
ec22835f134551c143b23afe1d9fd1bb7459e34a scripted-diff: test: Use py3.5 bytes::hex() method (Fuzzbawls)
139ae9d9ac182a20b53c89d215c86988099c4827 lint: more python linting (Fuzzbawls)
c757ce3aca4d23ec5240dfc13ff9edce567b1111 scripts: clean github-merge.py and symbol-check.py (Fuzzbawls)
6f822aea436e1dfe9b3b0d44a8e4a644f812e3cc scripts: additional E275 fixups (Fuzzbawls)
07d1c56c1221072dd57206fd653dca288ef2afb8 scripted-diff: test: Remove brackets after assert (Fuzzbawls)
ef83f5b5f4cc99856e9f571c636c315558801870 tests: Avoid using mutable default parameter values (Fuzzbawls)
77b42a262f8e863c7b1dd39c724769c15fcb8df1 Lint: enable mypy linting for python files (Fuzzbawls)
19862fd60050de4e296271838026f371d843576e scripts: exclude wallet_bumpfee.py from linting (Fuzzbawls)
8c0dd38534d06b03ebc4e1bcdd387569942b140b scripts: remove outdated python3 workaround in scrypt.py (Fuzzbawls)
56198916ff01cdc8e50dbc61d0b4d3b31472ca39 scripts: remove NONFATAL from security-check.py (fanquake)
457f2a8a620fbc607d51ec21262c78cbbb9a2379 scripts: no-longer check for 32 bit windows in security-check.py (fanquake)
036ab88a23a65c1879fa7367c02ee50c54270aed tests: add type hints to the test framework's script.py (Fuzzbawls)
a560910fd6e3bbbb18f5922bf13330fa9c54bb20 Strictly enforce instance attrs in critical functional test classes. (Justin Turner Arthur)
f46217b5269f0d9eb18d45a0a86af80fbf49c6b3 test: Remove python3.4 workaround in feature_dbcrash (MarcoFalke)

Pull request description:

  This PR offers a bit of an overhaul to our python test suite and python standards. The high level information is that we:
  - migrate from the EOL'd Python 3.5 to a more recent version (3.8)
  - strip out some ancient workaround code that is no longer necessary
  - add new linters that will provide an early warning if new python code is not up to standards

  The bulk of the changes here are via scripted-diff commits, or adapted cherry-picks from upstream.

ACKs for top commit:
  Liquid369:
    ACK c340533f152426106e33df9f3e78bd9c55b726bb
  panleone:
    re tACK c340533f152426106e33df9f3e78bd9c55b726bb

Tree-SHA512: 12ec442232fa0cc40b377844105792144862943ead7a0803754bf36eb4def6307aeb91753c4c6e386f7610cf9b5a76e82ac3b982a4e24be56468b8707135b49e

c340533... by Fuzzbawls

Bump python version to 3.8

17bc5bf... by Fuzzbawls

tests: remove redundant function

ec22835... by Fuzzbawls

scripted-diff: test: Use py3.5 bytes::hex() method

-BEGIN VERIFY SCRIPT-
sed -i -e "s/def bytes_to_hex_str/def b_2_x/g" $(git grep -l bytes_to_hex_str)

export RE_B_0="[^()]*" # match no bracket
export RE_B_1="${RE_B_0}\(${RE_B_0}\)${RE_B_0}" # match exactly one ()
export RE_B_2="${RE_B_0}\(${RE_B_1}\)${RE_B_0}" # match wrapped (())

export RE_M="(b2x|bytes_to_hex_str)\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\)"

sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l -E '(b2x|bytes_to_hex_str)')

sed -i --regexp-extended -e "/ +bytes_to_hex_str( as b2x)?,/d" $(git grep -l bytes_to_hex_str)
sed -i --regexp-extended -e "s/ +bytes_to_hex_str( as b2x)?,//g" $(git grep -l bytes_to_hex_str)
sed -i --regexp-extended -e "s/, bytes_to_hex_str( as b2x)?//g" $(git grep -l bytes_to_hex_str)

export RE_M="(binascii\.)?hexlify\(((${RE_B_0}|${RE_B_1}|${RE_B_2})*)\).decode\(${RE_B_0}\)"

sed -i --regexp-extended -e "s/${RE_M}/\2.hex()/g" $(git grep -l hexlify -- ':(exclude)share')

sed -i --regexp-extended -e "/from binascii import hexlify$/d" $(git grep -l hexlify -- ':(exclude)share')
sed -i --regexp-extended -e "s/(from binascii import) .*hexlify/\1 unhexlify/g" $(git grep -l hexlify -- ':(exclude)share')

sed -i -e 's/ignore-names "/ignore-names "b_2_x,/g' ./test/lint/lint-python-dead-code.sh
-END VERIFY SCRIPT-

139ae9d... by Fuzzbawls

lint: more python linting

c757ce3... by Fuzzbawls

scripts: clean github-merge.py and symbol-check.py

clean both files to adhere to flake8 standards.

6f822ae... by Fuzzbawls

scripts: additional E275 fixups

07d1c56... by Fuzzbawls

scripted-diff: test: Remove brackets after assert

-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/assert ?\((.+)\)(( )*)?(#.*)?$/assert \1\3\3\4/g' $(git grep -l --extended-regexp 'assert ?\(' test)
-END VERIFY SCRIPT-

ef83f5b... by Fuzzbawls

tests: Avoid using mutable default parameter values