]> khamidou — GitHub mirrors - arcanist.git/commit
Allow global config to load libraries and set test engines
authorepriestley <git@epriestley.com>
Thu, 31 May 2012 18:41:39 +0000 (11:41 -0700)
committerepriestley <git@epriestley.com>
Thu, 31 May 2012 18:41:39 +0000 (11:41 -0700)
commit8b7a5157f8388f8222ac463798407ff9a9da6f27
tree494fc5b5f5cafe7a99e82c567a99f95709fa0241
parente214ea7b18e419153e436f0fdf81d9e59d27d665
Allow global config to load libraries and set test engines

Summary:
Khan Academy is looking into lint configuration, but doesn't use ".arcconfig" because they have a large number of repositories. Making configuration more flexible generally gives us more options for onboarding installs.

  - Currently, only project config (".arcconfig") can load libraries. Allow user config ("~/.arcrc") to load libraries as well.
  - Currently, only project config can set lint/unit engines. Allow user config to set default lint/unit engines.
  - Add some type checking to "arc set-config".
  - Add "arc set-config --show".

Test Plan:
  - **load**
    - Ran `arc set-config load xxx`, got error about format.
    - Ran `arc set-config load ["apple"]`, got warning on running 'arc' commands (no such library) but was able to run 'arc set-config' again to clear it.
    - Ran `arc set-config load ["/path/to/a/lib/src/"]`, worked.
    - Ran `arc list --trace`, verified my library loaded in addition to `.arcconfig` libraries.
    - Ran `arc list --load-phutil-library=xxx --trace`, verified only that library loaded.
    - Ran `arc list --trace --load-phutil-library=apple --trace`, got hard error about bad library.
    - Set `.arcconfig` to point at a bad library, verified hard error.
  - **lint.engine** / **unit.engine**
    - Removed lint engine from `.arcconfig`, ran "arc lint", got a run with specified engine.
    - Removed unit engine from `.arcconfig`, ran "arc unit", got a run with specified engine.
  - **--show**
    - Ran `arc set-config --show`.
  - **misc**
    - Ran `arc get-config`.

Reviewers: csilvers, btrahan, vrana

Reviewed By: csilvers

CC: aran
Differential Revision: https://secure.phabricator.com/D2618
scripts/arcanist.php
src/workflow/base/ArcanistBaseWorkflow.php
src/workflow/get-config/ArcanistGetConfigWorkflow.php
src/workflow/lint/ArcanistLintWorkflow.php
src/workflow/set-config/ArcanistSetConfigWorkflow.php
src/workflow/unit/ArcanistUnitWorkflow.php
src/workingcopyidentity/ArcanistWorkingCopyIdentity.php