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.

Discussion:
codecov-io: # [Codecov](https://codecov.io/gh/sscpac/statick/pull/157?src=pr&el=h1) Report
> Merging [#157](https://codecov.io/gh/sscpac/statick/pull/157?src=pr&el=desc) into [master](https://codecov.io/gh/sscpac/statick/commit/7e56cf7aa79e2b6fa3af28e2a2194008d2d9562b?src=pr&el=desc) will **decrease** coverage by `0.06%`.
> The diff coverage is `94.11%`.

[![Impacted file tree graph](https://codecov.io/gh/sscpac/statick/pull/157/graphs/tree.svg?width=650&token=Vgq0OM4Uhi&height=150&src=pr)](https://codecov.io/gh/sscpac/statick/pull/157?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##           master    #157      +/-   ##
=========================================
- Coverage   94.36%   94.3%   -0.07%     
=========================================
  Files          44      44              
  Lines        2149    2161      +12     
=========================================
+ Hits         2028    2038      +10     
- Misses        121     123       +2
```


| [Impacted Files](https://codecov.io/gh/sscpac/statick/pull/157?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [statick\_tool/plugins/tool/pyflakes\_tool\_plugin.py](https://codecov.io/gh/sscpac/statick/pull/157/diff?src=pr&el=tree#diff-c3RhdGlja190b29sL3BsdWdpbnMvdG9vbC9weWZsYWtlc190b29sX3BsdWdpbi5weQ==) | `97.18% <94.11%> (-2.82%)` | :arrow_down: |
| [statick\_tool/discovery\_plugin.py](https://codecov.io/gh/sscpac/statick/pull/157/diff?src=pr&el=tree#diff-c3RhdGlja190b29sL2Rpc2NvdmVyeV9wbHVnaW4ucHk=) | `89.47% <0%> (-0.53%)` | :arrow_down: |
| [statick\_tool/plugins/tool/make\_tool\_plugin.py](https://codecov.io/gh/sscpac/statick/pull/157/diff?src=pr&el=tree#diff-c3RhdGlja190b29sL3BsdWdpbnMvdG9vbC9tYWtlX3Rvb2xfcGx1Z2luLnB5) | `80.72% <0%> (-0.46%)` | :arrow_down: |
| [...k\_tool/plugins/discovery/cmake\_discovery\_plugin.py](https://codecov.io/gh/sscpac/statick/pull/157/diff?src=pr&el=tree#diff-c3RhdGlja190b29sL3BsdWdpbnMvZGlzY292ZXJ5L2NtYWtlX2Rpc2NvdmVyeV9wbHVnaW4ucHk=) | `77.33% <0%> (-0.3%)` | :arrow_down: |
| [statick\_tool/plugins/tool/cppcheck\_tool\_plugin.py](https://codecov.io/gh/sscpac/statick/pull/157/diff?src=pr&el=tree#diff-c3RhdGlja190b29sL3BsdWdpbnMvdG9vbC9jcHBjaGVja190b29sX3BsdWdpbi5weQ==) | `83.9% <0%> (-0.19%)` | :arrow_down: |
| [...tatick\_tool/plugins/tool/clang\_tidy\_tool\_plugin.py](https://codecov.io/gh/sscpac/statick/pull/157/diff?src=pr&el=tree#diff-c3RhdGlja190b29sL3BsdWdpbnMvdG9vbC9jbGFuZ190aWR5X3Rvb2xfcGx1Z2luLnB5) | `95.31% <0%> (-0.08%)` | :arrow_down: |
| [statick\_tool/exceptions.py](https://codecov.io/gh/sscpac/statick/pull/157/diff?src=pr&el=tree#diff-c3RhdGlja190b29sL2V4Y2VwdGlvbnMucHk=) | `98.19% <0%> (-0.04%)` | :arrow_down: |
| [statick\_tool/plugins/tool/cccc\_tool\_plugin.py](https://codecov.io/gh/sscpac/statick/pull/157/diff?src=pr&el=tree#diff-c3RhdGlja190b29sL3BsdWdpbnMvdG9vbC9jY2NjX3Rvb2xfcGx1Z2luLnB5) | `99.31% <0%> (-0.01%)` | :arrow_down: |
| [statick\_tool/tool\_plugin.py](https://codecov.io/gh/sscpac/statick/pull/157/diff?src=pr&el=tree#diff-c3RhdGlja190b29sL3Rvb2xfcGx1Z2luLnB5) | `100% <0%> (ø)` | :arrow_up: |
| [...atick\_tool/plugins/tool/catkin\_lint\_tool\_plugin.py](https://codecov.io/gh/sscpac/statick/pull/157/diff?src=pr&el=tree#diff-c3RhdGlja190b29sL3BsdWdpbnMvdG9vbC9jYXRraW5fbGludF90b29sX3BsdWdpbi5weQ==) | `100% <0%> (ø)` | :arrow_up: |
| ... and [1 more](https://codecov.io/gh/sscpac/statick/pull/157/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/sscpac/statick/pull/157?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/sscpac/statick/pull/157?src=pr&el=footer). Last update [7e56cf7...f92d3d3](https://codecov.io/gh/sscpac/statick/pull/157?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-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():