Changeset View
Changeset View
Standalone View
Standalone View
src/configuration/ArcanistSettings.php
| <?php | <?php | ||||
| final class ArcanistSettings extends Phobject { | final class ArcanistSettings extends Phobject { | ||||
| private function getOptions() { | private function getOptions() { | ||||
| return array( | $legacy_builtins = array( | ||||
| 'default' => array( | 'default' => array( | ||||
| 'type' => 'string', | 'type' => 'string', | ||||
| 'help' => pht( | 'help' => pht( | ||||
| 'The URI of a Phabricator install to connect to by default, if '. | 'The URI of a Phabricator install to connect to by default, if '. | ||||
| '%s is run in a project without a Phabricator URI or run outside '. | '%s is run in a project without a Phabricator URI or run outside '. | ||||
| 'of a project.', | 'of a project.', | ||||
| 'arc'), | 'arc'), | ||||
| 'example' => '"http://phabricator.example.com/"', | 'example' => '"http://phabricator.example.com/"', | ||||
| ▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | $legacy_builtins = array( | ||||
| 'arc.land.onto.default' => array( | 'arc.land.onto.default' => array( | ||||
| 'type' => 'string', | 'type' => 'string', | ||||
| 'help' => pht( | 'help' => pht( | ||||
| 'The name of the default branch to land changes onto when '. | 'The name of the default branch to land changes onto when '. | ||||
| '`%s` is run.', | '`%s` is run.', | ||||
| 'arc land'), | 'arc land'), | ||||
| 'example' => '"develop"', | 'example' => '"develop"', | ||||
| ), | ), | ||||
| 'arc.lint.cache' => array( | |||||
| 'type' => 'bool', | |||||
| 'help' => pht( | |||||
| 'Enable the lint cache by default. When enabled, `%s` attempts to '. | |||||
| 'use cached results if possible. Currently, the cache is not always '. | |||||
| 'invalidated correctly and may cause `%s` to report incorrect '. | |||||
| 'results, particularly while developing linters. This is probably '. | |||||
| 'worth enabling only if your linters are very slow.', | |||||
| 'arc lint', | |||||
| 'arc lint'), | |||||
| 'default' => false, | |||||
| 'example' => 'false', | |||||
| ), | |||||
| 'history.immutable' => array( | 'history.immutable' => array( | ||||
| 'type' => 'bool', | 'type' => 'bool', | ||||
| 'legacy' => 'immutable_history', | 'legacy' => 'immutable_history', | ||||
| 'help' => pht( | 'help' => pht( | ||||
| 'If true, %s will never change repository history (e.g., through '. | 'If true, %s will never change repository history (e.g., through '. | ||||
| 'amending or rebasing). Defaults to true in Mercurial and false in '. | 'amending or rebasing). Defaults to true in Mercurial and false in '. | ||||
| 'Git. This setting has no effect in Subversion.', | 'Git. This setting has no effect in Subversion.', | ||||
| 'arc'), | 'arc'), | ||||
| ▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | $legacy_builtins = array( | ||||
| 'example' => 'false', | 'example' => 'false', | ||||
| ), | ), | ||||
| 'aliases' => array( | 'aliases' => array( | ||||
| 'type' => 'aliases', | 'type' => 'aliases', | ||||
| 'help' => pht( | 'help' => pht( | ||||
| 'Configured command aliases. Use "arc alias" to define aliases.'), | 'Configured command aliases. Use "arc alias" to define aliases.'), | ||||
| ), | ), | ||||
| ); | ); | ||||
| $settings = ArcanistSetting::getAllSettings(); | |||||
| foreach ($settings as $key => $setting) { | |||||
| $settings[$key] = $setting->getLegacyDictionary(); | |||||
| } | |||||
| $results = $settings + $legacy_builtins; | |||||
| ksort($results); | |||||
| return $results; | |||||
| } | } | ||||
| private function getOption($key) { | private function getOption($key) { | ||||
| return idx($this->getOptions(), $key, array()); | return idx($this->getOptions(), $key, array()); | ||||
| } | } | ||||
| public function getAllKeys() { | public function getAllKeys() { | ||||
| return array_keys($this->getOptions()); | return array_keys($this->getOptions()); | ||||
| ▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines | |||||