Skip to content

Commit

Permalink
Merge pull request #185 from bskinn/flake8-noqa
Browse files Browse the repository at this point in the history
Flake8 noqa
  • Loading branch information
bskinn authored Feb 5, 2021
2 parents 648f967 + 8692e8f commit 6b0d318
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
18 changes: 18 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,21 @@ stages:
- script: if [[ $( git status | grep modified | wc -l ) -ne 0 ]]; then exit 1; fi
displayName: Fail if md-toc modified CONTRIBUTING

- job: noqa_info
displayName: Report flake8-noqa results for info (never fails)

pool:
vmImage: 'Ubuntu-latest'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'

- script: pip install tox flake8-noqa -r requirements-flake8.txt
displayName: Install requirements

- script: tox -e flake8-noqa
displayName: Run never-fail flake8 with noqa check


2 changes: 1 addition & 1 deletion src/sphobjinv/cli/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ def yesno_prompt(prompt):
"""
resp = ""
while not (resp.lower() == "n" or resp.lower() == "y"):
resp = input(prompt) # noqa: S322
resp = input(prompt)
return resp
4 changes: 2 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_cli_invocations(self, cmd):
runargs = shlex.split(cmd)
runargs.append("--help")

out = sp.check_output(" ".join(runargs), shell=True).decode() # noqa: S602,S603
out = sp.check_output(" ".join(runargs), shell=True).decode() # noqa: S602

assert "sphobjinv" in out
assert "suggest" in out
Expand Down Expand Up @@ -180,7 +180,7 @@ def test_cli_convert_various_pathargs(

decomp_cmp_test(full_dst_path)

@pytest.mark.timeout(CLI_TEST_TIMEOUT * 50 * 3) # noqa: F821
@pytest.mark.timeout(CLI_TEST_TIMEOUT * 50 * 3)
@pytest.mark.testall
def test_cli_convert_cycle_formats(
self,
Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ deps=-rrequirements-flake8.txt
commands=
python -c 'import sys, colorama; from flake8.main.cli import main; colorama.init(); sys.argv = ["flake8", "conftest.py", "tests", "src"]; main()'

[testenv:flake8-noqa]
skip_install=True
deps=-rrequirements-flake8.txt
commands=
pip install flake8-noqa
flake8 --color=never --exit-zero conftest.py tests src

[testenv:interrogate]
skip_install=True
deps=interrogate
Expand Down

0 comments on commit 6b0d318

Please sign in to comment.