From 838a3c26548d83361fb943a9c7118bb4d62f3ce1 Mon Sep 17 00:00:00 2001 From: Valerie Lambert Date: Tue, 21 Dec 2021 14:11:40 -0800 Subject: [PATCH 1/3] chore: Pin dependencies for linters --- dev_requirements/linter-requirements.txt | 14 +++++++++++++ tox.ini | 25 ++++++++++-------------- 2 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 dev_requirements/linter-requirements.txt diff --git a/dev_requirements/linter-requirements.txt b/dev_requirements/linter-requirements.txt new file mode 100644 index 000000000..a1e5aa3d4 --- /dev/null +++ b/dev_requirements/linter-requirements.txt @@ -0,0 +1,14 @@ +bandit==1.7.0 +black==21.12b0 +doc8==0.10.1 +flake8==4.0.1 +flake8-bugbear==21.11.29 +flake8-docstrings==1.6.0 +flake8-print==4.0.0 +isort==5.10.1 +pyflakes==2.4.0 +pylint==2.12.2 +readme_renderer==32.0 +seed-isort-config==2.2.0 +vulture==2.3 +sphinx==4.3.2 \ No newline at end of file diff --git a/tox.ini b/tox.ini index b0221eee2..7468164e2 100644 --- a/tox.ini +++ b/tox.ini @@ -149,15 +149,13 @@ commands = [testenv:flake8-tests] basepython = {[testenv:flake8]basepython} deps = - flake8 - # https://github.com/JBKahn/flake8-print/pull/30 - flake8-print>=3.1.0 + -rdev_requirements/linter-requirements.txt commands = flake8 \ # Ignore F811 redefinition errors in tests (breaks with pytest-mock use) # E203 is not PEP8 compliant https://github.com/ambv/black#slices # W503 is not PEP8 compliant https://github.com/ambv/black#line-breaks--binary-operators - --ignore F811,E203,W503 \ + --ignore F811,E203,W503,D \ test/ [testenv:flake8-examples] @@ -176,8 +174,7 @@ commands = basepython = python3 deps = {[testenv]deps} - pyflakes - pylint + -rdev_requirements/linter-requirements.txt commands = pylint \ --rcfile=src/pylintrc \ @@ -205,7 +202,7 @@ commands = [testenv:blacken-src] basepython = python3 deps = - black + -rdev_requirements/linter-requirements.txt commands = black --line-length 120 \ src/aws_encryption_sdk/ \ @@ -232,12 +229,12 @@ commands = [testenv:isort-seed] basepython = python3 -deps = seed-isort-config +deps = -rdev_requirements/linter-requirements.txt commands = seed-isort-config [testenv:isort] basepython = python3 -deps = isort +deps = -rdev_requirements/linter-requirements.txt commands = isort -rc \ src \ test \ @@ -264,25 +261,23 @@ commands = [testenv:doc8] basepython = python3 deps = - sphinx - doc8 + -rdev_requirements/linter-requirements.txt commands = doc8 doc/index.rst README.rst CHANGELOG.rst [testenv:readme] basepython = python3 -deps = readme_renderer +deps = -rdev_requirements/linter-requirements.txt commands = python setup.py check -r -s [testenv:bandit] basepython = python3 -deps = - bandit>=1.5.1 +deps = -rdev_requirements/linter-requirements.txt commands = bandit -r src/aws_encryption_sdk/ # Prone to false positives: only run independently [testenv:vulture] basepython = python3 -deps = vulture +deps = -rdev_requirements/linter-requirements.txt commands = vulture src/aws_encryption_sdk/ [testenv:linters] From d364eb55e72941e0c03d7014fa3c5eec86d4862f Mon Sep 17 00:00:00 2001 From: Valerie Lambert Date: Tue, 21 Dec 2021 14:31:07 -0800 Subject: [PATCH 2/3] lint --- test/unit/test_encryption_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/test_encryption_context.py b/test/unit/test_encryption_context.py index 094430707..ccc18c219 100644 --- a/test/unit/test_encryption_context.py +++ b/test/unit/test_encryption_context.py @@ -189,4 +189,4 @@ def test_deserialize_encryption_context_empty(self): test = aws_encryption_sdk.internal.formatting.encryption_context.deserialize_encryption_context( serialized_encryption_context=b"" ) - assert test == {} + assert not test From 7109b9a16a77513176a9e46edcec9eab08dbbeea Mon Sep 17 00:00:00 2001 From: Tony Knapp <5892063+texastony@users.noreply.github.com> Date: Fri, 28 Jan 2022 14:07:26 -0600 Subject: [PATCH 3/3] Update tox.ini --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 7468164e2..10506814f 100644 --- a/tox.ini +++ b/tox.ini @@ -155,6 +155,7 @@ commands = # Ignore F811 redefinition errors in tests (breaks with pytest-mock use) # E203 is not PEP8 compliant https://github.com/ambv/black#slices # W503 is not PEP8 compliant https://github.com/ambv/black#line-breaks--binary-operators + # D is for Documentation. We do not care if Test classes and their methods have docstrings --ignore F811,E203,W503,D \ test/