Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F84835
D7606.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D7606.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -205,7 +205,7 @@
'ArcanistBundleTestCase' => 'ArcanistTestCase',
'ArcanistCSSLintLinter' => 'ArcanistExternalLinter',
'ArcanistCSSLintLinterTestCase' => 'ArcanistArcanistLinterTestCase',
- 'ArcanistCSharpLinter' => 'ArcanistFutureLinter',
+ 'ArcanistCSharpLinter' => 'ArcanistLinter',
'ArcanistCallConduitWorkflow' => 'ArcanistBaseWorkflow',
'ArcanistCapabilityNotSupportedException' => 'Exception',
'ArcanistChooseInvalidRevisionException' => 'Exception',
diff --git a/src/configuration/ArcanistSettings.php b/src/configuration/ArcanistSettings.php
--- a/src/configuration/ArcanistSettings.php
+++ b/src/configuration/ArcanistSettings.php
@@ -40,6 +40,13 @@
'specified by the current project.',
'example' => '"ExampleLintEngine"',
),
+ 'lint.limit' => array(
+ 'type' => 'int',
+ 'help' =>
+ 'The number of operations to run in parallel when performing '.
+ 'lint on a code base. Adjust this to suite your platform '.
+ 'and CPU capacity.'
+ ),
'unit.engine' => array(
'type' => 'string',
'legacy' => 'unit_engine',
diff --git a/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php b/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php
--- a/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php
+++ b/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php
@@ -47,6 +47,9 @@
$linter = clone $linters[$type];
$linter->setEngine($this);
+ $linter->setParallelisationLimit(
+ $this->getConfigurationManager()
+ ->getConfigFromAnySource('lint.limit', 8));
$more = $linter->getLinterConfigurationOptions();
} else {
// We'll raise an error below about the invalid "type" key.
diff --git a/src/lint/linter/ArcanistCSharpLinter.php b/src/lint/linter/ArcanistCSharpLinter.php
--- a/src/lint/linter/ArcanistCSharpLinter.php
+++ b/src/lint/linter/ArcanistCSharpLinter.php
@@ -13,6 +13,7 @@
private $loaded;
private $discoveryMap;
private $futures;
+ private $limit;
const SUPPORTED_VERSION = 1;
@@ -33,6 +34,10 @@
return $options;
}
+ public function setParallelisationLimit($limit) {
+ $this->limit = $limit;
+ }
+
public function setLinterConfigurationValue($key, $value) {
switch ($key) {
case 'discovery':
@@ -184,7 +189,7 @@
public function didRunLinters() {
if ($this->futures) {
- foreach (Futures($this->futures) as $future) {
+ foreach (Futures($this->futures)->limit($this->limit) as $future) {
$this->resolveFuture($future);
}
}
diff --git a/src/lint/linter/ArcanistFutureLinter.php b/src/lint/linter/ArcanistFutureLinter.php
--- a/src/lint/linter/ArcanistFutureLinter.php
+++ b/src/lint/linter/ArcanistFutureLinter.php
@@ -3,12 +3,17 @@
abstract class ArcanistFutureLinter extends ArcanistLinter {
private $futures;
+ private $limit;
abstract protected function buildFutures(array $paths);
abstract protected function resolveFuture($path, Future $future);
+ public function setParallelisationLimit($limit) {
+ $this->limit = $limit;
+ }
+
protected function getFuturesLimit() {
- return 8;
+ return $this->limit;
}
public function willLintPaths(array $paths) {
diff --git a/src/lint/linter/ArcanistLinter.php b/src/lint/linter/ArcanistLinter.php
--- a/src/lint/linter/ArcanistLinter.php
+++ b/src/lint/linter/ArcanistLinter.php
@@ -308,6 +308,9 @@
);
}
+ public function setParallelisationLimit($limit) {
+ }
+
public function setLinterConfigurationValue($key, $value) {
$sev_map = array(
'error' => ArcanistLintSeverity::SEVERITY_ERROR,
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/sw/eq/mgewbhjg77bsn5fx
Default Alt Text
D7606.diff (3 KB)
Attached To
Mode
D7606: Add 'lint.limit' option and use it in linters
Attached
Detach File
Event Timeline
Log In to Comment