lbrycrd/test/lint
MarcoFalke bffb35f876
Merge #13054: tests: Enable automatic detection of undefined names in Python tests scripts. Remove wildcard imports.
68400d8b96 tests: Use explicit imports (practicalswift)

Pull request description:

  Enable automatic detection of undefined names in Python tests scripts. Remove wildcard imports.

  Wildcard imports make it unclear which names are present in the namespace, confusing both readers and many automated tools.

  An additional benefit of not using wildcard imports in tests scripts is that readers of a test script then can infer the rough testing scope just by looking at the imports.

  Before this commit:

  ```
  $ contrib/devtools/lint-python.sh | head -10
  ./test/functional/feature_rbf.py:8:1: F403 'from test_framework.util import *' used; unable to detect undefined names
  ./test/functional/feature_rbf.py:9:1: F403 'from test_framework.script import *' used; unable to detect undefined names
  ./test/functional/feature_rbf.py:10:1: F403 'from test_framework.mininode import *' used; unable to detect undefined names
  ./test/functional/feature_rbf.py:15:12: F405 bytes_to_hex_str may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:17:58: F405 CScript may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:25:13: F405 COIN may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:26:31: F405 satoshi_round may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:26:60: F405 COIN may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:30:41: F405 satoshi_round may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  ./test/functional/feature_rbf.py:30:68: F405 COIN may be undefined, or defined from star imports: test_framework.mininode, test_framework.script, test_framework.util
  $
  ```

  After this commit:

  ```
  $ contrib/devtools/lint-python.sh | head -10
  $
  ```

Tree-SHA512: 3f826d39cffb6438388e5efcb20a9622ff8238247e882d68f7b38609877421b2a8e10e9229575f8eb6a8fa42dec4256986692e92922c86171f750a0e887438d9
2018-08-13 08:28:06 -04:00
..
check-doc.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
check-rpc-mappings.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
commit-script-check.sh Add "export LC_ALL=C" to all shell scripts 2018-06-14 15:27:52 +02:00
git-subtree-check.sh Add "export LC_ALL=C" to all shell scripts 2018-06-14 15:27:52 +02:00
lint-all.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-circular-dependencies.sh lint: Add linter for circular dependencies 2018-07-18 09:11:26 -04:00
lint-filenames.sh Merge #13496: Test: Harden lint-filenames.sh 2018-06-24 18:39:27 +02:00
lint-format-strings.py Make format string linter understand basic template parameter syntax 2018-08-10 17:28:59 +02:00
lint-format-strings.sh Add linting of WalletLogPrintf(...) format strings 2018-08-07 14:57:54 +02:00
lint-include-guards.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-includes.sh Removes Boost predicate.hpp dependency 2018-07-22 21:34:45 +02:00
lint-locale-dependence.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-logs.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-python-shebang.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-python-utf8-encoding.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-python.sh tests: Use explicit imports 2018-08-13 14:13:39 +02:00
lint-shell-locale.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-shell.sh fix locale for lint-shell 2018-08-02 14:46:05 +02:00
lint-tests.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
lint-whitespace.sh Obsolete #!/bin/bash shebang 2018-06-20 11:12:41 +03:00
README.md test: Move linters to test/lint, add readme 2018-05-24 12:02:15 -04:00

This folder contains lint scripts.

check-doc.py

Check for missing documentation of command line options.

commit-script-check.sh

Verification of scripted diffs.

git-subtree-check.sh

Run this script from the root of the repository to verify that a subtree matches the contents of the commit it claims to have been updated to.

To use, make sure that you have fetched the upstream repository branch in which the subtree is maintained:

Usage: git-subtree-check.sh DIR (COMMIT)

COMMIT may be omitted, in which case HEAD is used.

lint-all.sh

Calls other scripts with the lint- prefix.