diff --git a/test/pylint_tools/.lint.conf b/.lint.conf similarity index 100% rename from test/pylint_tools/.lint.conf rename to .lint.conf diff --git a/test/automation_tools/__init__.py b/test/automation_tools/__init__.py deleted file mode 100644 index 2130383f8..000000000 --- a/test/automation_tools/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from utilities import get_branchname, run_pylint -from yamlwrapper import read_yaml, write_yaml diff --git a/test/test_tools/__init__.py b/test/helpers/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from test/test_tools/__init__.py rename to test/helpers/__init__.py diff --git a/test/helpers/automation_tools/__init__.py b/test/helpers/automation_tools/__init__.py new file mode 100644 index 000000000..c64dc5841 --- /dev/null +++ b/test/helpers/automation_tools/__init__.py @@ -0,0 +1,2 @@ +from utilities import get_branchname, run_pylint, directory +from yamlwrapper import read_yaml, write_yaml diff --git a/test/automation_tools/get_branch b/test/helpers/automation_tools/get_branch similarity index 100% rename from test/automation_tools/get_branch rename to test/helpers/automation_tools/get_branch diff --git a/test/automation_tools/utilities.py b/test/helpers/automation_tools/utilities.py similarity index 100% rename from test/automation_tools/utilities.py rename to test/helpers/automation_tools/utilities.py diff --git a/test/automation_tools/yamlwrapper.py b/test/helpers/automation_tools/yamlwrapper.py similarity index 100% rename from test/automation_tools/yamlwrapper.py rename to test/helpers/automation_tools/yamlwrapper.py diff --git a/test/pylint_tools/__init__.py b/test/helpers/pylint/__init__.py similarity index 100% rename from test/pylint_tools/__init__.py rename to test/helpers/pylint/__init__.py diff --git a/test/pylint_tools/findErrors.py b/test/helpers/pylint/findErrors.py similarity index 100% rename from test/pylint_tools/findErrors.py rename to test/helpers/pylint/findErrors.py diff --git a/test/pylint_tools/findWarnings.py b/test/helpers/pylint/findWarnings.py similarity index 100% rename from test/pylint_tools/findWarnings.py rename to test/helpers/pylint/findWarnings.py diff --git a/test/pylint_tools/helpers.py b/test/helpers/pylint/helpers.py similarity index 100% rename from test/pylint_tools/helpers.py rename to test/helpers/pylint/helpers.py diff --git a/test/pylint_tools/lintAll.py b/test/helpers/pylint/lintAll.py similarity index 100% rename from test/pylint_tools/lintAll.py rename to test/helpers/pylint/lintAll.py diff --git a/test/pylint_tools/lookFor.py b/test/helpers/pylint/lookFor.py similarity index 72% rename from test/pylint_tools/lookFor.py rename to test/helpers/pylint/lookFor.py index cac60880a..14607f11b 100755 --- a/test/pylint_tools/lookFor.py +++ b/test/helpers/pylint/lookFor.py @@ -1,24 +1,26 @@ #!/usr/bin/env python3 -from helpers import get_output, write_output -from ..automation_tools import read_yaml -import sys +from helpers import get_output, write_output +from ..automation_tools import read_yaml, directory +import os, sys # https://docs.pylint.org/features.html#general-options def look_for(items, filename): enabled = ','.join(items) print('Generating %s in all of pygsti. This should take less than a minute' % enabled) - - config = read_yaml('config.yml') + config = read_yaml('pylint_config.yml') commands = [config['pylint-version'], '--disable=all', '--enable=%s' % enabled, '--rcfile=%s' % config['config-file'], '--reports=n'] + config['packages'] - output = get_output(commands) + # pyGSTi directory + with directory('..'): + output = get_output(commands) print('\n'.join(output)) - write_output(output, 'output/%s.out' % filename) + with directory('output/pylint'): + write_output(output, '%s.out' % filename) if __name__ == "__main__": if len(sys.argv) == 1: diff --git a/test/pylint_tools/output/cyclic-import.out b/test/helpers/pylint/output/cyclic-import.out similarity index 100% rename from test/pylint_tools/output/cyclic-import.out rename to test/helpers/pylint/output/cyclic-import.out diff --git a/test/pylint_tools/output/duplicate-code.out b/test/helpers/pylint/output/duplicate-code.out similarity index 100% rename from test/pylint_tools/output/duplicate-code.out rename to test/helpers/pylint/output/duplicate-code.out diff --git a/test/pylint_tools/output/errors.out b/test/helpers/pylint/output/errors.out similarity index 100% rename from test/pylint_tools/output/errors.out rename to test/helpers/pylint/output/errors.out diff --git a/test/pylint_tools/output/if.out b/test/helpers/pylint/output/if.out similarity index 100% rename from test/pylint_tools/output/if.out rename to test/helpers/pylint/output/if.out diff --git a/test/pylint_tools/output/missingdocs.out b/test/helpers/pylint/output/missingdocs.out similarity index 100% rename from test/pylint_tools/output/missingdocs.out rename to test/helpers/pylint/output/missingdocs.out diff --git a/test/pylint_tools/output/out.out b/test/helpers/pylint/output/out.out similarity index 100% rename from test/pylint_tools/output/out.out rename to test/helpers/pylint/output/out.out diff --git a/test/pylint_tools/output/rawexcept.out b/test/helpers/pylint/output/rawexcept.out similarity index 100% rename from test/pylint_tools/output/rawexcept.out rename to test/helpers/pylint/output/rawexcept.out diff --git a/test/pylint_tools/output/specific.out b/test/helpers/pylint/output/specific.out similarity index 100% rename from test/pylint_tools/output/specific.out rename to test/helpers/pylint/output/specific.out diff --git a/test/pylint_tools/output/todos.out b/test/helpers/pylint/output/todos.out similarity index 100% rename from test/pylint_tools/output/todos.out rename to test/helpers/pylint/output/todos.out diff --git a/test/pylint_tools/output/too-many-arguments.txt b/test/helpers/pylint/output/too-many-arguments.txt similarity index 100% rename from test/pylint_tools/output/too-many-arguments.txt rename to test/helpers/pylint/output/too-many-arguments.txt diff --git a/test/pylint_tools/output/too-many-boolean-expressions.txt b/test/helpers/pylint/output/too-many-boolean-expressions.txt similarity index 100% rename from test/pylint_tools/output/too-many-boolean-expressions.txt rename to test/helpers/pylint/output/too-many-boolean-expressions.txt diff --git a/test/pylint_tools/output/too-many-branches.txt b/test/helpers/pylint/output/too-many-branches.txt similarity index 100% rename from test/pylint_tools/output/too-many-branches.txt rename to test/helpers/pylint/output/too-many-branches.txt diff --git a/test/pylint_tools/output/too-many-instance-attributes.txt b/test/helpers/pylint/output/too-many-instance-attributes.txt similarity index 100% rename from test/pylint_tools/output/too-many-instance-attributes.txt rename to test/helpers/pylint/output/too-many-instance-attributes.txt diff --git a/test/pylint_tools/output/too-many-locals.txt b/test/helpers/pylint/output/too-many-locals.txt similarity index 100% rename from test/pylint_tools/output/too-many-locals.txt rename to test/helpers/pylint/output/too-many-locals.txt diff --git a/test/pylint_tools/output/too-many-return-statements.txt b/test/helpers/pylint/output/too-many-return-statements.txt similarity index 100% rename from test/pylint_tools/output/too-many-return-statements.txt rename to test/helpers/pylint/output/too-many-return-statements.txt diff --git a/test/pylint_tools/output/too-many-statements.txt b/test/helpers/pylint/output/too-many-statements.txt similarity index 100% rename from test/pylint_tools/output/too-many-statements.txt rename to test/helpers/pylint/output/too-many-statements.txt diff --git a/test/pylint_tools/output/unused-import.out b/test/helpers/pylint/output/unused-import.out similarity index 100% rename from test/pylint_tools/output/unused-import.out rename to test/helpers/pylint/output/unused-import.out diff --git a/test/pylint_tools/output/unused.out b/test/helpers/pylint/output/unused.out similarity index 100% rename from test/pylint_tools/output/unused.out rename to test/helpers/pylint/output/unused.out diff --git a/test/pylint_tools/output/warnings.out b/test/helpers/pylint/output/warnings.out similarity index 100% rename from test/pylint_tools/output/warnings.out rename to test/helpers/pylint/output/warnings.out diff --git a/test/pylint_tools/pylint_messages.txt b/test/helpers/pylint/pylint_messages.txt similarity index 100% rename from test/pylint_tools/pylint_messages.txt rename to test/helpers/pylint/pylint_messages.txt diff --git a/test/pylint_tools/runAdjustables.py b/test/helpers/pylint/runAdjustables.py similarity index 100% rename from test/pylint_tools/runAdjustables.py rename to test/helpers/pylint/runAdjustables.py diff --git a/test/pylint_tools/score.py b/test/helpers/pylint/score.py similarity index 100% rename from test/pylint_tools/score.py rename to test/helpers/pylint/score.py diff --git a/test/pylint_tools/yamlwrapper.py b/test/helpers/pylint/yamlwrapper.py similarity index 100% rename from test/pylint_tools/yamlwrapper.py rename to test/helpers/pylint/yamlwrapper.py diff --git a/test/helpers/test/__init__.py b/test/helpers/test/__init__.py new file mode 100755 index 000000000..e69de29bb diff --git a/test/test_tools/_genInfo.py b/test/helpers/test/_genInfo.py similarity index 100% rename from test/test_tools/_genInfo.py rename to test/helpers/test/_genInfo.py diff --git a/test/test_tools/_getCoverage.py b/test/helpers/test/_getCoverage.py similarity index 100% rename from test/test_tools/_getCoverage.py rename to test/helpers/test/_getCoverage.py diff --git a/test/test_tools/_runBenchmark.py b/test/helpers/test/_runBenchmark.py similarity index 100% rename from test/test_tools/_runBenchmark.py rename to test/helpers/test/_runBenchmark.py diff --git a/test/test_tools/benchmarks/__init__.py b/test/helpers/test/benchmarks/__init__.py similarity index 100% rename from test/test_tools/benchmarks/__init__.py rename to test/helpers/test/benchmarks/__init__.py diff --git a/test/test_tools/benchmarks/benchmark.py b/test/helpers/test/benchmarks/benchmark.py similarity index 100% rename from test/test_tools/benchmarks/benchmark.py rename to test/helpers/test/benchmarks/benchmark.py diff --git a/test/test_tools/findDependencies.py b/test/helpers/test/findDependencies.py similarity index 100% rename from test/test_tools/findDependencies.py rename to test/helpers/test/findDependencies.py diff --git a/test/test_tools/genPackageInfo.py b/test/helpers/test/genPackageInfo.py similarity index 100% rename from test/test_tools/genPackageInfo.py rename to test/helpers/test/genPackageInfo.py diff --git a/test/test_tools/helpers.py b/test/helpers/test/helpers.py similarity index 100% rename from test/test_tools/helpers.py rename to test/helpers/test/helpers.py diff --git a/test/test_tools/runChanged.py b/test/helpers/test/runChanged.py similarity index 100% rename from test/test_tools/runChanged.py rename to test/helpers/test/runChanged.py diff --git a/test/test_tools/runCoverageTests.sh b/test/helpers/test/runCoverageTests.sh similarity index 100% rename from test/test_tools/runCoverageTests.sh rename to test/helpers/test/runCoverageTests.sh diff --git a/test/test_tools/runNoseTests.sh b/test/helpers/test/runNoseTests.sh similarity index 100% rename from test/test_tools/runNoseTests.sh rename to test/helpers/test/runNoseTests.sh diff --git a/test/test_tools/runNoseTests2.sh b/test/helpers/test/runNoseTests2.sh similarity index 100% rename from test/test_tools/runNoseTests2.sh rename to test/helpers/test/runNoseTests2.sh diff --git a/test/test_tools/runPackage.py b/test/helpers/test/runPackage.py similarity index 100% rename from test/test_tools/runPackage.py rename to test/helpers/test/runPackage.py diff --git a/test/test_tools/runTimedNoseTests.sh b/test/helpers/test/runTimedNoseTests.sh similarity index 100% rename from test/test_tools/runTimedNoseTests.sh rename to test/helpers/test/runTimedNoseTests.sh diff --git a/test/test_tools/testconfig.yml b/test/helpers/test/testconfig.yml similarity index 100% rename from test/test_tools/testconfig.yml rename to test/helpers/test/testconfig.yml diff --git a/test/lint.py b/test/lint.py index 223407a44..c867292c9 100755 --- a/test/lint.py +++ b/test/lint.py @@ -1,2 +1,3 @@ -from pylint_tools import look_for -look_for(['unused-import'], 'unused_import') +#!/usr/bin/env python +from helpers.pylint import look_for +look_for(['unused-argument'], 'unused-argument') diff --git a/test/pylint_tools/config.yml b/test/pylint_config.yml similarity index 96% rename from test/pylint_tools/config.yml rename to test/pylint_config.yml index b0e3ed139..80cbb463a 100644 --- a/test/pylint_tools/config.yml +++ b/test/pylint_config.yml @@ -32,8 +32,8 @@ desired-score: '9.10' # Pylint now checks the pylint scripts, which lowers the o # packages to be scores by pylint packages: -- ../../packages/pygsti -- ../../test +- packages/pygsti +- test pylint-version: pylint3 diff --git a/test/pylint_tools/genDuplicateCode.sh b/test/pylint_tools/genDuplicateCode.sh deleted file mode 100755 index 4b7a119f6..000000000 --- a/test/pylint_tools/genDuplicateCode.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -./lookFor.py duplicate-code diff --git a/test/pylint_tools/genMissingDocs.sh b/test/pylint_tools/genMissingDocs.sh deleted file mode 100755 index 28096bc68..000000000 --- a/test/pylint_tools/genMissingDocs.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -./lookFor.py docs missing-docstring empty-docstring - diff --git a/test/pylint_tools/genTODOS.sh b/test/pylint_tools/genTODOS.sh deleted file mode 100755 index 2758d0acd..000000000 --- a/test/pylint_tools/genTODOS.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -./lookFor.py todos fixme diff --git a/test/pylint_tools/genUnused.sh b/test/pylint_tools/genUnused.sh deleted file mode 100755 index f6ff07a7d..000000000 --- a/test/pylint_tools/genUnused.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -./lookFor.py unused unused-import unused-argument unused-variable