diff --git a/.divinerconfig b/.divinerconfig index 9d8afb0a1b..e20237a757 100644 --- a/.divinerconfig +++ b/.divinerconfig @@ -1,6 +1,6 @@ { "name" : "Phabricator", - "src_base" : "https://github.com/facebook/phabricator/blob/master", + "src_base" : "https://secure.phabricator.com/diffusion/P/browse/origin:master", "groups" : { "intro" : "Introduction", "config" : "Configuration", diff --git a/src/docs/userguide/arcanist_lint_unit.diviner b/src/docs/userguide/arcanist_lint_unit.diviner index 4fbb8655ab..bb7648d661 100644 --- a/src/docs/userguide/arcanist_lint_unit.diviner +++ b/src/docs/userguide/arcanist_lint_unit.diviner @@ -3,28 +3,27 @@ Explains how to build new classes to control how Arcanist behaves. -NOTE: TODO: This document is pretty trash, follow at your own risk. - = Overview = Arcanist has some basic configuration options available in the ##.arcconfig## -file (see @{article:Setting Up .arcconfig}), but it can't handle everything. If -you want to customize Arcanist at a deeper level, you need to build new classes. -For instance: +file (see @{article:Arcanist User Guide: Configuring a New Project}), but it +can't handle everything. If you want to customize Arcanist at a deeper level, +you need to build new classes. For instance: - if you want to configure linters, or add new linters, you need to create a - new class which extends @{class:ArcanistLintEngine}. + new class which extends @{class@arcanist:ArcanistLintEngine}. - if you want to integrate with a unit testing framework, you need to create a - new class which extends @{class:ArcanistBaseUnitTestEngine}. + new class which extends @{class@arcanist:ArcanistBaseUnitTestEngine}. - if you you want to change how workflows behave, or add new workflows, you - need to create a new class which extends @{class:ArcanistConfiguration}. + need to create a new class which extends + @{class@arcanist:ArcanistConfiguration}. Arcanist works through a sort of dependency-injection approach. For example, Arcanist does not run lint rules by default, but you can set **lint_engine** in your ##.arcconfig## to the name of a class which extends -@{class:ArcanistLintEngine}. When running from inside your project, Arcanist -will load this class and call methods on it in order to run lint. To make this -work, you need to do three things: +@{class@arcanist:ArcanistLintEngine}. When running from inside your project, +Arcanist will load this class and call methods on it in order to run lint. To +make this work, you need to do three things: - actually write the class; - add the library where the class exists to your ##.arcconfig##; @@ -33,7 +32,31 @@ work, you need to do three things: = Write the Class = -(TODO) +Start by creating a new phutil library -- this is a directory which will contain +class files for Arcanist to load. You can either put it inside your project, or +outside (if you want to share lint rules between several projects, for +instance). To create a new library, run ##arc liberate##: + + $ arc liberate path/to/new/library + +This will prompt you to name your library and create a new directory on disk. +Create a new ##lint/## directory in this library (or ##unit/##, or whatever you +want). This creates a module. Put ##CustomArcanistLintEngine.php## inside the +##lint/## directory: + + lang=php +