Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15377081
D14307.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
919 B
Referenced Files
None
Subscribers
None
D14307.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
@@ -324,7 +324,7 @@
* Get the line and character of the message from the regex match.
*
* @param dict Captured groups from regex.
- * @return pair<int,int> Line and character of the message.
+ * @return pair<int,int|null> Line and character of the message.
*
* @task parse
*/
@@ -336,8 +336,19 @@
return array($line + 1, $char + 1);
}
- $line = idx($match, 'line', 1);
+ $line = idx($match, 'line');
+ if ($line) {
+ $line = (int)$line;
+ } else {
+ $line = 1;
+ }
+
$char = idx($match, 'char');
+ if ($char) {
+ $char = (int)$char;
+ } else {
+ $char = null;
+ }
return array($line, $char);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 14, 7:53 AM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7650936
Default Alt Text
D14307.diff (919 B)
Attached To
Mode
D14307: Allow Script-and-Regex linter to have optional/empty capturing patterns for char/line
Attached
Detach File
Event Timeline
Log In to Comment