mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
Display and link lint errors on line 0
Summary: Some lint errors (e.g. Javelin) don't have a line number. Put them on the first line. Putting them above the first line would be even nicer but much more complicated. Test Plan: Display diff with lint error on line 0 (D2583). Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2599
This commit is contained in:
parent
c002b466b8
commit
6f10706852
2 changed files with 3 additions and 3 deletions
|
@ -86,13 +86,12 @@ final class DifferentialLintFieldSpecification
|
||||||
$name = idx($message, 'name');
|
$name = idx($message, 'name');
|
||||||
$description = idx($message, 'description');
|
$description = idx($message, 'description');
|
||||||
|
|
||||||
$line_link = 'line '.phutil_escape_html($line);
|
$line_link = 'line '.intval($line);
|
||||||
if (isset($path_changesets[$path])) {
|
if (isset($path_changesets[$path])) {
|
||||||
// TODO: Load very large diff before linking to line.
|
|
||||||
$line_link = phutil_render_tag(
|
$line_link = phutil_render_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
'href' => '#C'.$path_changesets[$path].'NL'.$line,
|
'href' => '#C'.$path_changesets[$path].'NL'.max(1, $line),
|
||||||
),
|
),
|
||||||
$line_link);
|
$line_link);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1086,6 +1086,7 @@ final class DifferentialChangesetParser {
|
||||||
foreach ($this->comments as $comment) {
|
foreach ($this->comments as $comment) {
|
||||||
$final = $comment->getLineNumber() +
|
$final = $comment->getLineNumber() +
|
||||||
$comment->getLineLength();
|
$comment->getLineLength();
|
||||||
|
$final = max(1, $final);
|
||||||
if ($this->isCommentOnRightSideWhenDisplayed($comment)) {
|
if ($this->isCommentOnRightSideWhenDisplayed($comment)) {
|
||||||
$new_comments[$final][] = $comment;
|
$new_comments[$final][] = $comment;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue