- Installing Arcanist and the linters
- Changing the default editor
- Using Arcanista
- Multiple concurrent reviews on the same repo
Arcanist is a CLI tool that helps you submit your code changes for code review. You can use it to
- create, submit and update diffs (arc diff);
- land the changes after they've been reviewed (arc land - this equivalent to a "Merge");
- run unit tests and check code coverage (arc lint, arc unit)
Make sure you have php installed in your system.
mkdir -p ~/bin cd ~/bin git clone https://we.phorge.it/source/arcanist.git arcanist git clone https://hub.sealcode.org/diffusion/124/arcanist-linters.git git clone https://github.com/sealcode/arc-unit-mocha.git ln -s arcanist/bin/arc arc # Add ~/bin to your `PATH` variable, if it's not there already: echo "export PATH=\$PATH:$HOME/bin" >> ~/.bashrc echo "export PATH=\$PATH:$HOME/bin" >> ~/.zshrc # restart the terminal and check if this command: which arc # returns: /home/<your_username>/bin/arc # If it returns something else, like /usr/bin/arc, then uninstall the arcanist package provided by your package manager
# arc install-certificate https://hub.sealcode.org/
and follow the instruction. It's a one-time command that will save authorization info for the future.
Arcanist uses your shell's default text editor for diff messages. To pick your default editor, set the EDITOR env variable to an editor of your choice (you can do this in ~/.bashrc, ~/.bash_profile, or similar)
Arcanist is needed for smooth operation of the Review Workflow. Read more about how to use Arcanist in [this guide]https://hub.sealcode.org/w/sealhub_workflow/audyt-i-review/review-workflow/).
You can work on multiple tasks in the same local repository. While you're waiting for your changes on task to be reviewed, create a new branch starting from master, make some commits, and use arc diff again to submit a new revision for review.
If after running arc patch for the same diff multiple times in the same repo you see a message like this:
Branch name arcpatch-D300 already exists; trying a new name. Branch name arcpatch-D300_1 already exists; trying a new name. Branch name arcpatch-D300_2 already exists; trying a new name. Branch name arcpatch-D300_3 already exists; trying a new name. Exception Arc was unable to automagically make a name for this patch. Please clean up your working copy and try again. (Run with `--trace` for a full exception trace.)
It means that arc ran out of branch names to keep your changes in.
* alpha arcpatch-D187 arcpatch-D188 arcpatch-D196 arcpatch-D213_1 arcpatch-D213_2 arcpatch-D217 arcpatch-D300_1 arcpatch-D300_2 arcpatch-D300_3 ...
If you don't need those branches anymore, just delete them:
# git branch | cut -c3- | grep arcpatch- | xargs -n1 git branch -D
See https://secure.phabricator.com/T3277#33729 for more details
- Add --recursive flag to the git clone used for cloning pinterest linters repo, or
- In arcanist linters repo, run git submodule update --init