From 3a62a2a0d78d6240b9036c8f64288168e05e424c Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Thu, 5 Jul 2018 14:26:52 +1000 Subject: [PATCH] tools: Always show problems with problem status. - Some tools are strict and produce many issues. Previously their problems were ignored, and given normal status. - Which tools produce too many issues is not obvious, better to be consistent and show problems for all. --- tests/tools_test.py | 2 +- vigil/tools.py | 4 ++-- vigil/tools.toml | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/tools_test.py b/tests/tools_test.py index e741816..b7a9590 100755 --- a/tests/tools_test.py +++ b/tests/tools_test.py @@ -104,7 +104,7 @@ class ToolsTestCase(unittest.TestCase): def test_mypy(self): self._test_tool(tools.mypy, [("hi3.py", tools.Status.ok), - ("hi.py", tools.Status.normal)]) + ("hi.py", tools.Status.problem)]) def test_python_coverage(self): self._test_tool(tools.python_coverage, self.HI_NORMAL) diff --git a/vigil/tools.py b/vigil/tools.py index ed9f061..a88fc33 100644 --- a/vigil/tools.py +++ b/vigil/tools.py @@ -334,7 +334,7 @@ def pydoc(path): @deps(deps={"mypy"}, url="mypy", executables={"mypy"}) def mypy(path): stdout, stderr, returncode = _do_command(["mypy", path], timeout=TIMEOUT) - status = Status.ok if returncode == 0 else Status.normal + status = Status.ok if returncode == 0 else Status.problem return status, fill3.Text(stdout) @@ -458,7 +458,7 @@ def bandit(path): stdout, stderr, returncode = _do_command( [python_version, "-m", "bandit.cli.main", "-f", "txt", path], timeout=TIMEOUT) - status = Status.ok if returncode == 0 else Status.normal + status = Status.ok if returncode == 0 else Status.problem text_without_timestamp = "".join(stdout.splitlines(keepends=True)[2:]) return status, fill3.Text(text_without_timestamp) diff --git a/vigil/tools.toml b/vigil/tools.toml index 975d816..cd1d217 100644 --- a/vigil/tools.toml +++ b/vigil/tools.toml @@ -227,13 +227,11 @@ tools_for_extensions = [ dependencies = ["golang-go"] url = "golang-go" command = "go vet" - error_status = "normal" [golint] dependencies = ["golint"] url = "golint" command = "golint -set_exit_status" - error_status = "normal" [yamllint] dependencies = ["yamllint"]