Closed
Bug 609180
Opened 15 years ago
Closed 15 years ago
Pass the line number and context back with the validation results
Categories
(addons.mozilla.org Graveyard :: Developer Pages, defect, P1)
addons.mozilla.org Graveyard
Developer Pages
Tracking
(Not tracked)
RESOLVED
FIXED
5.12.3
People
(Reporter: clouserw, Assigned: basta)
Details
We've talked about this before, but just to make sure we don't forget: we need to pass the line number the error happened on, and the context (140 chars on either side) back with the result JSON.
Assignee | ||
Comment 1•15 years ago
|
||
This is implemented on the "contextgenerator" branch of the validator. In the JSON, the messages should have a "context" property that contains up to three strings. The middle string should be the line that the error was detected at. The other two are the surrounding lines.
Lines are truncated at 140 characters. Since position information is rarely, if ever, available, it is still difficult to handle very long lines (as in minified JS files). The JS traverser currently does not support position information; this is a planned future enhancement.
install.rdf files do not have contexts (rdflib does not pass back line numbers). This is an item for future development.
If someone could look over the code, that would be great.
https://github.com/mattbasta/amo-validator/blob/contextgenerator/validator/contextgenerator.py
Also, if there is a more useful format for the output in the JSON, please let me know.
Reporter | ||
Comment 2•15 years ago
|
||
That's looking good. We want the 140 chars trimmed to the closest side. For example:
...some really long line
the line that broke
some other long line...
CCing Kumar who is doing the front end
Reporter | ||
Comment 3•15 years ago
|
||
Oh, you wrote what I'm talking about in Bug 532789. Is that the same file on a different branch? We should use that one
Assignee | ||
Comment 4•15 years ago
|
||
(In reply to comment #3)
> Oh, you wrote what I'm talking about in Bug 532789. Is that the same file on a
> different branch? We should use that one
It is, it's a more up-to-date version that includes the proper truncation stuff. That one is merged into master now.
Assignee | ||
Comment 5•15 years ago
|
||
This should be done in 79ec446; there are now unit tests! Hooray!
https://github.com/mattbasta/amo-validator/commit/79ec4469854a6c373471a5e6d6c28b51d684e1ac
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•