Page MenuHomePhabricator

D7377.diff

diff --git a/src/lint/engine/ArcanistLintEngine.php b/src/lint/engine/ArcanistLintEngine.php
--- a/src/lint/engine/ArcanistLintEngine.php
+++ b/src/lint/engine/ArcanistLintEngine.php
@@ -63,11 +63,22 @@
private $enableAsyncLint = false;
private $postponedLinters = array();
+ private $configurationManager;
public function __construct() {
}
+ public function setConfigurationManager(
+ ArcanistConfigurationManager $configuration_manager) {
+ $this->configurationManager = $configuration_manager;
+ return $this;
+ }
+
+ public function getConfigurationManager() {
+ return $this->configurationManager;
+ }
+
public function setWorkingCopy(ArcanistWorkingCopyIdentity $working_copy) {
$this->workingCopy = $working_copy;
return $this;
diff --git a/src/lint/engine/ArcanistSingleLintEngine.php b/src/lint/engine/ArcanistSingleLintEngine.php
--- a/src/lint/engine/ArcanistSingleLintEngine.php
+++ b/src/lint/engine/ArcanistSingleLintEngine.php
@@ -15,7 +15,8 @@
public function buildLinters() {
$key = 'lint.engine.single.linter';
- $linter_name = $this->getWorkingCopy()->getConfigFromAnySource($key);
+ $linter_name = $this->getConfigurationManager()
+ ->getConfigFromAnySource($key);
if (!$linter_name) {
throw new ArcanistUsageException(
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
@@ -348,7 +348,9 @@
*/
private function getConfiguredScript() {
$key = 'linter.scriptandregex.script';
- $config = $this->getConfigFromAnySource($key);
+ $config = $this->getEngine()
+ ->getConfigurationManager()
+ ->getConfigFromAnySource($key);
if (!$config) {
throw new ArcanistUsageException(
@@ -373,7 +375,9 @@
*/
private function getConfiguredRegex() {
$key = 'linter.scriptandregex.regex';
- $config = $this->getConfigFromAnySource($key);
+ $config = $this->getEngine()
+ ->getConfigurationManager()
+ ->getConfigFromAnySource($key);
if (!$config) {
throw new ArcanistUsageException(
diff --git a/src/workflow/ArcanistLintWorkflow.php b/src/workflow/ArcanistLintWorkflow.php
--- a/src/workflow/ArcanistLintWorkflow.php
+++ b/src/workflow/ArcanistLintWorkflow.php
@@ -261,7 +261,8 @@
$engine = newv($engine, array());
$this->engine = $engine;
- $engine->setWorkingCopy($working_copy); // todo setConfig?
+ $engine->setWorkingCopy($working_copy);
+ $engine->setConfigurationManager($configuration_manager);
$engine->setMinimumSeverity(
$this->getArgument('severity', self::DEFAULT_SEVERITY));

File Metadata

Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/vj/34/hkqlyqqexw45ydhd
Default Alt Text
D7377.diff (2 KB)

Event Timeline