Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3945358
D2064.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D2064.diff
View Options
diff --git a/.arcconfig b/.arcconfig
--- a/.arcconfig
+++ b/.arcconfig
@@ -1,4 +1,7 @@
{
"phabricator.uri": "https://devcentral.nasqueron.org/",
- "repository.callsign": "SCL"
+ "repository.callsign": "SCL",
+ "load": [
+ "shellcheck-linter"
+ ]
}
diff --git a/.arcunit b/.arcunit
new file mode 100644
--- /dev/null
+++ b/.arcunit
@@ -0,0 +1,8 @@
+{
+ "engines": {
+ "phutil": {
+ "type": "phutil",
+ "include": "(\\.php$)"
+ }
+ }
+}
diff --git a/__phutil_library_map__.php b/__phutil_library_map__.php
--- a/__phutil_library_map__.php
+++ b/__phutil_library_map__.php
@@ -10,9 +10,11 @@
'__library_version__' => 2,
'class' => array(
'ArcanistShellCheckLinter' => 'lint/linter/ArcanistShellCheckLinter.php',
+ 'ArcanistShellCheckLinterTestCase' => 'lint/linter/__tests__/ArcanistShellCheckLinterTestCase.php',
),
'function' => array(),
'xmap' => array(
'ArcanistShellCheckLinter' => 'ArcanistExternalLinter',
+ 'ArcanistShellCheckLinterTestCase' => 'PhutilTestCase',
),
));
diff --git a/lint/linter/ArcanistShellCheckLinter.php b/lint/linter/ArcanistShellCheckLinter.php
--- a/lint/linter/ArcanistShellCheckLinter.php
+++ b/lint/linter/ArcanistShellCheckLinter.php
@@ -105,7 +105,7 @@
'%C --version', $this->getExecutableCommand());
$matches = null;
- if (preg_match('/^version: (\d(?:\.\d){2})$/', $stdout, $matches)) {
+ if (preg_match('/version: (\d(?:\.\d){2})/', $stdout, $matches)) {
return $matches[1];
}
diff --git a/lint/linter/__tests__/ArcanistShellCheckLinterTestCase.php b/lint/linter/__tests__/ArcanistShellCheckLinterTestCase.php
new file mode 100644
--- /dev/null
+++ b/lint/linter/__tests__/ArcanistShellCheckLinterTestCase.php
@@ -0,0 +1,13 @@
+<?php
+
+final class ArcanistShellCheckLinterTestCase extends PhutilTestCase {
+
+ public function testGetVersion() {
+ $linter = new ArcanistShellCheckLinter();
+ $actualVersion = $linter->getVersion();
+
+ $this->assertFalse($actualVersion === null, "The version can't be extracted from the binary output.");
+ $this->assertTrue(strpos($actualVersion, '.') > -1, "The version doesn't match expected format: does not contain a dot.");
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 27, 05:25 (12 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2316544
Default Alt Text
D2064.diff (2 KB)
Attached To
Mode
D2064: Fix version regex
Attached
Detach File
Event Timeline
Log In to Comment