- enable configuration overrides for ArcanistConfigurationDrivenLintEngine
Here is a sample subclass that we plan on using at disqus.
<?php final class DisqusConfigurationDrivenLintEngine extends ArcanistConfigurationDrivenLintEngine { public $defaultConfig = ' { "linters": { "jshint": { "type": "script-and-regex", "include": "(\\\\.js$)" }, "text": { "type": "text", "include": "(\\\\.*)", "severity": {} }, "filename": { "type": "filename", "include": "(.*)" }, "spelling": { "type": "spelling", "include": "(.*)" }, "flake8": { "options": "--ignore=W391,W292,W293,E501,E225,E121,E123,E124,E127,E128,F999,F821 --exclude=*/contrib/*" } } }'; public function getLintConfigDefaults() { return json_decode($this->defaultConfig, true); } public function getLintConfigOverrides() { $working_copy = $this->getWorkingCopy(); $overrides = $working_copy->getConfig( "linters", "{}" ); return json_decode($overrides, true); } public function getLinterConfig() { // from .arclint try { $config = parent::getLinterConfig(); } catch (Exception $e) { $config = array(); } // form this class $defaults = $this->getLintConfigDefaults(); // from .arcconfig $overrides = $this->getLintConfigOverrides(); return array_merge($defaults, $config, $overrides); } }