Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13329197
D7606.diff
No One
Temporary
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
Index: src/__phutil_library_map__.php
===================================================================
--- src/__phutil_library_map__.php
+++ 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',
Index: src/configuration/ArcanistSettings.php
===================================================================
--- src/configuration/ArcanistSettings.php
+++ 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',
Index: src/lint/engine/ArcanistConfigurationDrivenLintEngine.php
===================================================================
--- src/lint/engine/ArcanistConfigurationDrivenLintEngine.php
+++ 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.
Index: src/lint/linter/ArcanistCSharpLinter.php
===================================================================
--- src/lint/linter/ArcanistCSharpLinter.php
+++ 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);
}
}
Index: src/lint/linter/ArcanistFutureLinter.php
===================================================================
--- src/lint/linter/ArcanistFutureLinter.php
+++ 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) {
Index: src/lint/linter/ArcanistLinter.php
===================================================================
--- src/lint/linter/ArcanistLinter.php
+++ 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/plain
Expires
Mon, Jun 17, 10:12 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6295121
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