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).

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

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.
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():

pip install -e .[test]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-flake8 pytest-isort
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
astroid==3.3.9
backports.tempfile==1.0
backports.weakref==1.0.post1
bandit==1.8.3
cmakelint==1.4.3
coverage==7.8.0
cpplint==2.0.0
dill==0.3.9
exceptiongroup==1.2.2
flake8==7.2.0
flawfinder==2.0.19
iniconfig==2.1.0
isort==6.0.1
lizard==1.17.23
markdown-it-py==3.0.0
mccabe==0.7.0
mdurl==0.1.2
mock==5.2.0
packaging==24.2
pathspec==0.12.1
pbr==6.1.1
platformdirs==4.3.7
pluggy==1.5.0
pycodestyle==2.13.0
pydocstyle==6.3.0
pyflakes==3.3.1
Pygments==2.19.1
pylint==3.3.6
pylint-django==0.11.1
pylint-plugin-utils==0.8.2
pytest==8.3.5
pytest-cov==6.0.0
pytest-flake8==1.3.0
pytest-isort==4.0.0
PyYAML==6.0.2
rich==14.0.0
snowballstemmer==2.2.0
-e git+https://github.com/sscpac/statick.git@7e56cf7aa79e2b6fa3af28e2a2194008d2d9562b#egg=statick
stevedore==5.4.1
tomli==2.2.1
tomlkit==0.13.2
typing_extensions==4.13.0
xmltodict==0.14.2
yamllint==1.37.0
Yapsy==1.12.2

name: statick
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - astroid==3.3.9
      - backports-tempfile==1.0
      - backports-weakref==1.0.post1
      - bandit==1.8.3
      - cmakelint==1.4.3
      - coverage==7.8.0
      - cpplint==2.0.0
      - dill==0.3.9
      - exceptiongroup==1.2.2
      - flake8==7.2.0
      - flawfinder==2.0.19
      - iniconfig==2.1.0
      - isort==6.0.1
      - lizard==1.17.23
      - markdown-it-py==3.0.0
      - mccabe==0.7.0
      - mdurl==0.1.2
      - mock==5.2.0
      - packaging==24.2
      - pathspec==0.12.1
      - pbr==6.1.1
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pydocstyle==6.3.0
      - pyflakes==3.3.1
      - pygments==2.19.1
      - pylint==3.3.6
      - pylint-django==0.11.1
      - pylint-plugin-utils==0.8.2
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - pytest-flake8==1.3.0
      - pytest-isort==4.0.0
      - pyyaml==6.0.2
      - rich==14.0.0
      - snowballstemmer==2.2.0
      - stevedore==5.4.1
      - tomli==2.2.1
      - tomlkit==0.13.2
      - typing-extensions==4.13.0
      - xmltodict==0.14.2
      - yamllint==1.37.0
      - yapsy==1.12.2
prefix: /opt/conda/envs/statick

tests/plugins/tool/pyflakes_tool_plugin/test_pyflakes_tool_plugin.py::test_pyflakes_tool_plugin_parse_valid
tests/plugins/tool/pyflakes_tool_plugin/test_pyflakes_tool_plugin.py::test_pyflakes_tool_plugin_found tests/plugins/tool/pyflakes_tool_plugin/test_pyflakes_tool_plugin.py::test_pyflakes_tool_plugin_scan_valid tests/plugins/tool/pyflakes_tool_plugin/test_pyflakes_tool_plugin.py::test_pyflakes_tool_plugin_parse_invalid tests/plugins/tool/pyflakes_tool_plugin/test_pyflakes_tool_plugin.py::test_pyflakes_tool_plugin_scan_calledprocesserror tests/plugins/tool/pyflakes_tool_plugin/test_pyflakes_tool_plugin.py::test_pyflakes_tool_plugin_scan_oserror
statick_tool/plugins/tool/pyflakes_tool_plugin.py
statick_tool/plugins/tool/pyflakes_tool_plugin.py