mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-25 16:22:42 +01:00
Merge branch 'master' of github.com:facebook/arcanist
This commit is contained in:
commit
0ac9b6c27b
3 changed files with 67 additions and 2 deletions
|
@ -40,12 +40,19 @@ foreach ($args as $key => $arg) {
|
||||||
} else if ($arg == '--trace') {
|
} else if ($arg == '--trace') {
|
||||||
unset($args[$key]);
|
unset($args[$key]);
|
||||||
$config_trace_mode = true;
|
$config_trace_mode = true;
|
||||||
|
} else if ($arg == '--no-ansi') {
|
||||||
|
unset($args[$key]);
|
||||||
|
PhutilConsoleFormatter::disableANSI(true);
|
||||||
} else if (preg_match('/^--load-phutil-library=(.*)$/', $arg, $matches)) {
|
} else if (preg_match('/^--load-phutil-library=(.*)$/', $arg, $matches)) {
|
||||||
unset($args[$key]);
|
unset($args[$key]);
|
||||||
$load['?'] = $matches[1];
|
$load['?'] = $matches[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!posix_isatty(STDOUT)) {
|
||||||
|
PhutilConsoleFormatter::disableANSI(true);
|
||||||
|
}
|
||||||
|
|
||||||
$args = array_values($args);
|
$args = array_values($args);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
53
src/docs/arcconfig.diviner
Normal file
53
src/docs/arcconfig.diviner
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
@title Setting Up .arcconfig
|
||||||
|
@group config
|
||||||
|
|
||||||
|
This document describes how to configure Arcanist projects with ##.arcconfig##
|
||||||
|
files.
|
||||||
|
|
||||||
|
= .arcconfig Basics =
|
||||||
|
|
||||||
|
Arcanist uses ##.arcconfig## files to determine a number of things about project
|
||||||
|
configuration. For instance, these are things it figures out from
|
||||||
|
##.arcconfig##:
|
||||||
|
|
||||||
|
- where the logical root directory of a project is;
|
||||||
|
- which server Arcanist should send diffs to for code review; and
|
||||||
|
- which lint rules should be applied.
|
||||||
|
|
||||||
|
An ##.arcconfig## file is a JSON file which you check into your project's root.
|
||||||
|
A simple, valid file looks something like this:
|
||||||
|
|
||||||
|
{
|
||||||
|
"project_id" : "some_project_name",
|
||||||
|
"conduit_uri" : "https://phabricator.example.com/api/"
|
||||||
|
}
|
||||||
|
|
||||||
|
Here's what these options mean:
|
||||||
|
|
||||||
|
- **project_id**: a human-readable string identifying the project
|
||||||
|
- **conduit_uri**: the Conduit API URI for the Phabricator installation that
|
||||||
|
Arcanist should send diffs to for review. Generally, if you access
|
||||||
|
Phabricator at ##https://phabricator.example.com/##, the **conduit_uri** is
|
||||||
|
##https://phabricator.example.com/api/##. Be mindful about "http" vs
|
||||||
|
"https".
|
||||||
|
|
||||||
|
For an exhaustive list of available options, see below.
|
||||||
|
|
||||||
|
= Advanced .arcconfig =
|
||||||
|
|
||||||
|
Other options include:
|
||||||
|
|
||||||
|
- **lint_engine**: the name of a subclass of @{class:ArcanistLintEngine},
|
||||||
|
which should be used to apply lint rules to this project. See (TODO).
|
||||||
|
- **unit_engine**: the name of a subclass of
|
||||||
|
@{class:ArcanistBaseUnitTestEngine.php}, which should be used to apply unit
|
||||||
|
test rules to this project. See (TODO).
|
||||||
|
- **arcanist_configuration**: the name of a subclass of
|
||||||
|
@{class:ArcanistConfiguration} which can add new command flags for this
|
||||||
|
project or provide entirely new commands.
|
||||||
|
- **remote_hooks_installed**: tells Arcanist that you've set up remote hooks
|
||||||
|
in the master repository (see @{article:Installing Arcanist SVN Hooks} for
|
||||||
|
SVN, or (TODO) for git).
|
||||||
|
- **copyright_holder**: used by @{class:ArcanistLicenseLinter} to apply
|
||||||
|
license notices to source files.
|
||||||
|
- **phutil_libraries**: map of additional Phutil libraries to load at startup.
|
|
@ -199,7 +199,12 @@ EOTEXT
|
||||||
$engine->setFileData($data);
|
$engine->setFileData($data);
|
||||||
$engine->setCommitHookMode(true);
|
$engine->setCommitHookMode(true);
|
||||||
|
|
||||||
|
try {
|
||||||
$results = $engine->run();
|
$results = $engine->run();
|
||||||
|
} catch (ArcanistNoEffectException $no_effect) {
|
||||||
|
// Nothing to do, bail out.
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
$renderer = new ArcanistLintRenderer();
|
$renderer = new ArcanistLintRenderer();
|
||||||
$failures = array();
|
$failures = array();
|
||||||
|
@ -226,6 +231,6 @@ EOTEXT
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 99;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue