]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Update lint engine documentation
authorepriestley <git@epriestley.com>
Mon, 24 Nov 2014 23:01:19 +0000 (15:01 -0800)
committerepriestley <git@epriestley.com>
Mon, 24 Nov 2014 23:01:19 +0000 (15:01 -0800)
Summary: Fixes T6627. This class documentation is out of date and somewhat misleading in the modern environment.

Test Plan: Read it.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T6627

Differential Revision: https://secure.phabricator.com/D10899

src/lint/engine/ArcanistLintEngine.php

index f32f640a9316042e60be27c55fb955ef68729a0f..ffe54cab27814f5b86bce8cf5fdcc1e665474890 100644 (file)
@@ -2,15 +2,21 @@
 
 /**
  * Manages lint execution. When you run 'arc lint' or 'arc diff', Arcanist
- * checks your .arcconfig to see if you have specified a lint engine in the
- * key "lint.engine". The engine must extend this class. For example:
+ * attempts to run lint rules using a lint engine.
  *
- *   lang=js
- *   {
- *     // ...
- *     "lint.engine" : "ExampleLintEngine",
- *     // ...
- *   }
+ * Lint engines are high-level strategic classes which do not contain any
+ * actual linting rules. Linting rules live in `Linter` classes. The lint
+ * engine builds and configures linters.
+ *
+ * Most modern linters can be configured with an `.arclint` file, which is
+ * managed by the builtin @{class:ArcanistConfigurationDrivenLintEngine}.
+ * Consult the documentation for more information on these files.
+ *
+ * In the majority of cases, you do not need to write a custom lint engine.
+ * For example, to add new rules for a new language, write a linter instead.
+ * However, if you have a very advanced or specialized use case, you can write
+ * a custom lint engine by extending this class; custom lint engines are more
+ * powerful but much more complex than the builtin engines.
  *
  * The lint engine is given a list of paths (generally, the paths that you
  * modified in your change) and determines which linters to run on them. The
  * whitespace, or enforce tab vs space rules, or make sure there are enough
  * curse words in them.
  *
- * Because lint engines are pretty custom to the rules of a project, you will
- * generally need to build your own. Fortunately, it's pretty easy (and you
- * can use the prebuilt //linters//, you just need to write a little glue code
- * to tell Arcanist which linters to run). For a simple example of how to build
- * a lint engine, see @{class:ExampleLintEngine}.
- *
  * You can test an engine like this:
  *
- *   arc lint --engine ExampleLintEngine --lintall some_file.py
+ *   arc lint --engine YourLintEngineClassName --lintall some_file.py
  *
  * ...which will show you all the lint issues raised in the file.
  *