Repository: sscpac/statick

Issue:
Support Python 3.8
According to [PEP-569](https://www.python.org/dev/peps/pep-0569/), Python 3.8 will be released on October 21, 2019. When that happens we should add it to the tox configuration.

Comments:

Patch:
diff --git a/statick_tool/plugins/tool/pyflakes_tool_plugin.py b/statick_tool/plugins/tool/pyflakes_tool_plugin.py
index 35f29e6..2eab8cb 100644
--- a/statick_tool/plugins/tool/pyflakes_tool_plugin.py
+++ b/statick_tool/plugins/tool/pyflakes_tool_plugin.py
@@ -55,18 +55,48 @@ class PyflakesToolPlugin(ToolPlugin):
         issues = self.parse_output(total_output)
         return issues
 
-    def parse_output(self, total_output):
+    def parse_output(self, total_output):  # pylint: disable=too-many-locals
         """Parse tool output and report issues."""
-        pyflakes_re = r"(.+):(\d+):\s(.+)"
-        parse = re.compile(pyflakes_re)
+        tool_re_first = r"(.+):(\d+):(\d+):\s(.+)"
+        parse_first = re.compile(tool_re_first)
+        tool_re_second = r"(.+):(\d+):\s(.+)"
+        parse_second = re.compile(tool_re_second)
+        tool_re_third = r"\s(.+)"
+        parse_third = re.compile(tool_re_third)
         issues = []
+        filename = ''
+        line_number = 0
+        issue_type = ''
+        message = ''
 
         for output in total_output:
+            first_line = True
+            found_match = False
             for line in output.splitlines():
-                match = parse.match(line)
-                if match:
-                    issues.append(Issue(match.group(1), match.group(2),
-                                        self.get_name(), self.get_name(),
-                                        "5", match.group(3), None))
+                if first_line:
+                    match = parse_first.match(line)
+                    first_line = False
+                    if match:
+                        found_match = True
+                        filename = match.group(1)
+                        line_number = match.group(2)
+                        issue_type = match.group(4)
+                    else:
+                        match = parse_second.match(line)
+                        if match:
+                            found_match = True
+                            filename = match.group(1)
+                            line_number = match.group(2)
+                            issue_type = match.group(3)
+                else:
+                    match = parse_third.match(line)
+                    first_line = True
+                    if match:
+                        found_match = True
+                        message = match.group(1)
+            if found_match:
+                issues.append(Issue(filename, line_number,
+                                    self.get_name(), issue_type,
+                                    "5", message, None))
 
         return issues


Test patch:
diff --git a/tests/plugins/tool/pyflakes_tool_plugin/test_pyflakes_tool_plugin.py b/tests/plugins/tool/pyflakes_tool_plugin/test_pyflakes_tool_plugin.py
index d0b148f..5c1dd05 100644
--- a/tests/plugins/tool/pyflakes_tool_plugin/test_pyflakes_tool_plugin.py
+++ b/tests/plugins/tool/pyflakes_tool_plugin/test_pyflakes_tool_plugin.py
@@ -63,15 +63,15 @@ def test_pyflakes_tool_plugin_scan_valid():
 def test_pyflakes_tool_plugin_parse_valid():
     """Verify that we can parse the normal output of pyflakes."""
     pftp = setup_pyflakes_tool_plugin()
-    output = "pyflakes_test.py:4: 'json' imported but unused"
+    output = "pyflakes_test.py:39:34: invalid syntax\nprint 'No files in %s' " \
+             "% (source_dir)"
     issues = pftp.parse_output([output])
     assert len(issues) == 1
     assert issues[0].filename == 'pyflakes_test.py'
-    assert issues[0].line_number == '4'
+    assert issues[0].line_number == '39'
     assert issues[0].tool == 'pyflakes'
-    assert issues[0].issue_type == 'pyflakes'
+    assert issues[0].issue_type == 'invalid syntax'
     assert issues[0].severity == '5'
-    assert issues[0].message == "'json' imported but unused"
 
 
 def test_pyflakes_tool_plugin_parse_invalid():