Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15412742
D21357.id50835.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
915 B
Referenced Files
None
Subscribers
None
D21357.id50835.diff
View Options
diff --git a/src/lint/renderer/ArcanistConsoleLintRenderer.php b/src/lint/renderer/ArcanistConsoleLintRenderer.php
--- a/src/lint/renderer/ArcanistConsoleLintRenderer.php
+++ b/src/lint/renderer/ArcanistConsoleLintRenderer.php
@@ -122,6 +122,24 @@
$old_impact = substr_count($original, "\n") + 1;
$start = $line;
+ $max_old = count($old_lines);
+ if ($start > $max_old) {
+ // See PHI1782. If a linter raises a warning at a line that does not
+ // exist, just render a warning.
+
+ $line = $this->renderLine(
+ $start,
+ pht(
+ '(This message was raised at line %s, but the file only has '.
+ '%s line(s).)',
+ new PhutilNumber($start),
+ new PhutilNumber($max_old)),
+ false,
+ '?');
+
+ return $line."\n\n";
+ }
+
if ($message->isPatchable()) {
$patch_offset = $line_map[$line] + ($char - 1);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 2:40 PM (2 d, 7 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7315918
Default Alt Text
D21357.id50835.diff (915 B)
Attached To
Mode
D21357: When a linter raises a message at a nonexistent line, don't fatal during rendering
Attached
Detach File
Event Timeline
Log In to Comment