Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14094290
D15000.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D15000.diff
View Options
diff --git a/src/lint/linter/ArcanistScriptAndRegexLinter.php b/src/lint/linter/ArcanistScriptAndRegexLinter.php
--- a/src/lint/linter/ArcanistScriptAndRegexLinter.php
+++ b/src/lint/linter/ArcanistScriptAndRegexLinter.php
@@ -108,7 +108,8 @@
* not specified, defaults to the linted file. It is generally not necessary
* to capture this unless the linter can raise messages in files other than
* the one it is linting.
- * - `line` (optional) The line number of the message.
+ * - `line` (optional) The line number of the message. If no text is
+ * captured, the message is assumed to affect the entire file.
* - `char` (optional) The character offset of the message.
* - `offset` (optional) The byte offset of the message. If captured, this
* supersedes `line` and `char`.
@@ -324,7 +325,7 @@
* Get the line and character of the message from the regex match.
*
* @param dict Captured groups from regex.
- * @return pair<int,int|null> Line and character of the message.
+ * @return pair<int|null,int|null> Line and character of the message.
*
* @task parse
*/
@@ -337,10 +338,13 @@
}
$line = idx($match, 'line');
- if ($line) {
+ if (strlen($line)) {
$line = (int)$line;
+ if (!$line) {
+ $line = 1;
+ }
} else {
- $line = 1;
+ $line = null;
}
$char = idx($match, 'char');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 3:08 PM (11 h, 40 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6789931
Default Alt Text
D15000.diff (1 KB)
Attached To
Mode
D15000: If the Script-and-Regex linter captures no "line" text, treat the message as affecting the entire file
Attached
Detach File
Event Timeline
Log In to Comment