[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/docs/user/userguide/ -> arcanist_hooks.diviner (source)

   1  @title Arcanist User Guide: Repository Hooks
   2  @group userguide
   3  
   4  Describes how to set up Arcanist as an SVN pre-commit hook.
   5  
   6  NOTE: This whole thing might be a little shaky and take a touch of finesse.
   7  
   8  = Installing Arcanist SVN Hooks =
   9  
  10  You can install Arcanist as an SVN pre-commit hook, to reject commits which
  11  contain lint errors. The immediate value of this is that syntax errors won't
  12  be committable, but you can block other kinds of badness with appropriate lint
  13  engines.
  14  
  15  To install Arcanist as a pre-commit hook, add this to your svn/hooks/pre-commit:
  16  
  17    #!/bin/sh
  18    set -e # Exit with an error code if this fails.
  19    /path/to/arcanist/bin/arc svn-hook-pre-commit $@ 1>&2
  20  
  21  Make sure you make this file executable, or you'll get an error for every commit
  22  with an unhelpful error message. You also need to specify the full path to PHP
  23  since SVN nukes ENV before executing scripts. Alternatively you can specify
  24  PATH explicitly.
  25  
  26  If your project is configured to run linters or lint engines which aren't part
  27  of Arcanist, specify where to load them from with ##--load-phutil-library##:
  28  
  29    --load-phutil-library=/path/to/library/root
  30  
  31  Since SVN commit hooks run without access to a working copy, you'll need to keep
  32  one checked out somewhere and reference it with ##--load-phutil-library## if you
  33  build new linters or customize lint engines. For example, your hook might
  34  look like this:
  35  
  36    #!/bin/sh
  37    set -e # Exit with an error code if this fails.
  38    /usr/local/bin/php -f /path/to/arcanist/bin/arc svn-hook-pre-commit \
  39      --load-phutil-library=/path/to/custom/lint/engine \
  40      --load-phutil-library=/path/to/custom/unittest/engine \
  41      $@ 1>&2


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1