Mozlint publisher ignores lineoffset, so multi-line warnings aren't posted inline
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
Research direction
Start in bot/code_review_bot/tasks/lint.py at the hardcoded nb_lines=1 and trace how the mozlint JSON artifact is parsed. Check the referenced mozlint result.py definition and compare-locales lineoffset usage. Done when multiline warnings are anchored across their affected lines and publish inline when the relevant lines are in the diff.
Written by the indexing model from the issue text.
Description
I have updated compare-locales to provide a lineoffset on top of lineno when finding an error in a multiline string. Turns out that doesn't do anything.
The mozlint parser in hardcodes nb_lines=1 and never reads the lineoffset field from the mozlint JSON artifact (guessing it should use lineoffset + 1).
As a result, warnings that apply to a multi-line entity are anchored to a single line and dropped from publishing when that line isn't part of the diff.
Example revision: https://phabricator.services.mozilla.com/D304024 — 4 changed strings, only a general comment, no inline comments.
P.S. compare-locales still has an issue, because I set lineoffset as a value, not as a tuple. I honestly don't understand why that's the case, since lineno is already defined.
- Dominant language
- Python
- Stars
- 67
- Forks
- 52
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 54
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mozilla/code-review
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
mozilla/code-review#3666 ·
-
Remove the frontend Open
Difficulty 5/5 Over a week Newbie friendliness 30/100
mozilla/code-review#3648 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
mozilla/code-review#3640 ·
-
mozilla/code-review#3638 · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
mozilla/code-review#3530 · 1 comment ·
All issues in mozilla/code-review
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100