Closed Bug 1644809 Opened 4 years ago Closed 4 years ago

mach lint -l clippy fails with "IndexError: list index out of range"

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(firefox79 fixed)

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

Details

Attachments

(1 file)

The issue doesn't happen in the CI because we probably don't use an up to date version of clippy (bug 1644799 to have this displayed)
on my system, with clippy

% cargo clippy --version
clippy 0.0.212 (fd4b177 2020-06-08)

The following command fails

% ./mach lint -l clippy  -n testing/webdriver/src/lib.rs                                                                                                                                                                    

with:

Traceback (most recent call last):
  File "/home/sylvestre/dev/mozilla/autoland.hg/python/mozlint/mozlint/roller.py", line 60, in _run_worker
    res = func(paths, config, **lintargs) or []
  File "/home/sylvestre/dev/mozilla/autoland.hg/python/mozlint/mozlint/types.py", line 54, in __call__
    return self._lint(paths, config, **lintargs)
  File "/home/sylvestre/dev/mozilla/autoland.hg/python/mozlint/mozlint/types.py", line 139, in _lint
    return func(files, config, **lintargs)
  File "/home/sylvestre/dev/mozilla/autoland.hg/tools/lint/clippy/__init__.py", line 205, in lint
    results += parse_issues(log, config, output, p, onlyIn)
  File "/home/sylvestre/dev/mozilla/autoland.hg/tools/lint/clippy/__init__.py", line 50, in parse_issues
    l = detail["spans"][0]
IndexError: list index out of range
A failure occurred in the clippy linter.
✖ 1 problem (0 errors, 0 warnings, 1 failure)

It is because we are getting a summary that we were not getting before:

{'rendered': 'warning: 5 warnings emitted\n\n', 'children': [], 'code': None, 'level': 'warning', 'message': '5 warnings emitted', 'spans': []} 

So, I propose to skip that line when spans is empty

Assignee: nobody → sledru
Status: NEW → ASSIGNED
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3fcba5174085
mozlint/clippy handle the summary r=marco
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
Regressions: 1645066
No longer regressions: 1645066
See Also: → 1645066
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: