1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-26 00:32:41 +01:00

Update lint engine documentation

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
This commit is contained in:
epriestley 2014-11-24 15:01:19 -08:00
parent 6a36584ae1
commit b46d4ed4ad

View file

@ -2,15 +2,21 @@
/** /**
* Manages lint execution. When you run 'arc lint' or 'arc diff', Arcanist * 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 * attempts to run lint rules using a lint engine.
* key "lint.engine". The engine must extend this class. For example:
* *
* lang=js * 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.
* "lint.engine" : "ExampleLintEngine", *
* // ... * 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 * 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 * modified in your change) and determines which linters to run on them. The
@ -24,15 +30,9 @@
* whitespace, or enforce tab vs space rules, or make sure there are enough * whitespace, or enforce tab vs space rules, or make sure there are enough
* curse words in them. * 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: * 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. * ...which will show you all the lint issues raised in the file.
* *