Page MenuHomeDevCentral

D2064.diff
No OneTemporary

D2064.diff

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

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)

Event Timeline