Class ArcanistLintEngine
This class is stable: you may safely extend it.
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:
lang=js
{
...
"lint.engine" : "ExampleLintEngine",
...
}
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
linters themselves are responsible for actually analyzing file text and
finding warnings and errors. For example, if the modified paths include some
JS files and some Python files, you might want to run JSLint on the JS files
and PyLint on the Python files.
You can also run multiple linters on a single file. For instance, you might
run one linter on all text files to make sure they don't have trailing
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 ExampleLintEngine.
You can test an engine like this:
...which will show you all the lint issues raised in the file.
See Arcanist User Guide: Customizing Lint, Unit Tests and Workflows for more information about configuring lint engines.
Tasks
Methods
public this __construct()
This method is not documented.
protected abstract buildLinters()
This method is not documented.
protected didRunLinters(array $linters)
| parameters | array | $linters | |
| return | wild | | |
This method is not documented.
protected getCacheVersion()
This method is not documented.
public getCommitHookMode()
This method is not documented.
public getEnableAsyncLint()
This method is not documented.
public getFilePathOnDisk($path)
| parameters | wild | $path | |
| return | wild | | |
This method is not documented.
public getHookAPI()
This method is not documented.
public getLineAndCharFromOffset($path, $offset)
| parameters | wild | $path | |
| wild | $offset | |
| return | wild | | |
This method is not documented.
protected getPEP8WithTextOptions()
This method is not documented.
public getPathChangedLines($path)
| parameters | wild | $path | |
| return | wild | | |
This method is not documented.
public getPaths()
This method is not documented.
public getPostponedLinters()
This method is not documented.
protected getResultForPath($path)
| parameters | wild | $path | |
| return | wild | | |
This method is not documented.
public getResults()
This method is not documented.
public getStoppedPaths()
This method is not documented.
public getWorkingCopy()
This method is not documented.
private isRelevantMessage(ArcanistLintMessage $message)
| parameters | ArcanistLintMessage | $message | |
| return | wild | | |
This method is not documented.
public isSeverityEnabled($severity)
| parameters | wild | $severity | |
| return | wild | | |
This method is not documented.
public loadData($path)
| parameters | wild | $path | |
| return | wild | | |
This method is not documented.
public pathExists($path)
| parameters | wild | $path | |
| return | wild | | |
This method is not documented.
public run()
This method is not documented.
public this setCachedResults(array $results)
| parameters | dict<string | $results | path, dict<string version, list<dict message>>> |
| return | this | | |
This method is not documented.
public setCommitHookMode($mode)
| parameters | wild | $mode | |
| return | wild | | |
This method is not documented.
public setEnableAsyncLint($enable_async_lint)
| parameters | wild | $enable_async_lint | |
| return | wild | | |
This method is not documented.
public setFileData($data)
| parameters | wild | $data | |
| return | wild | | |
This method is not documented.
public setHookAPI(ArcanistHookAPI $hook_api)
| parameters | ArcanistHookAPI | $hook_api | |
| return | wild | | |
This method is not documented.
public setMinimumSeverity($severity)
| parameters | wild | $severity | |
| return | wild | | |
This method is not documented.
public setPathChangedLines($path, $changed)
| parameters | wild | $path | |
| wild | $changed | |
| return | wild | | |
This method is not documented.
public setPaths($paths)
| parameters | wild | $paths | |
| return | wild | | |
This method is not documented.
public setPostponedLinters(array $linters)
| parameters | array | $linters | |
| return | wild | | |
This method is not documented.
public setRepositoryVersion($version)
| parameters | wild | $version | |
| return | wild | | |
This method is not documented.
public setWorkingCopy(ArcanistWorkingCopyIdentity $working_copy)
| parameters | ArcanistWorkingCopyIdentity | $working_copy | |
| return | wild | | |
This method is not documented.
private shouldUseCache($cache_granularity, $repository_version)
| parameters | wild | $cache_granularity | |
| wild | $repository_version | |
| return | wild | | |
This method is not documented.