mirror of
https://github.com/dense-analysis/ale.git
synced 2026-07-28 18:56:45 +08:00
Prefer ale_root setting for project roots
This commit is contained in:
@@ -55,6 +55,9 @@ For some linters, ALE will search for a Python project root by looking at the
|
||||
files in directories on or above where a file being checked is. ALE applies
|
||||
the following methods, in order:
|
||||
|
||||
If |g:ale_root| or |b:ale_root| provides a value, that value is used as the
|
||||
project root instead and the searching described below is skipped.
|
||||
|
||||
1. Find the first directory containing a common Python configuration file.
|
||||
2. If no configuration file can be found, use the first directory which does
|
||||
not contain a readable file named `__init__.py`.
|
||||
|
||||
+9
-8
@@ -2297,17 +2297,18 @@ g:ale_root
|
||||
Type: |Dictionary| or |String|
|
||||
Default: `{}`
|
||||
|
||||
This option is used to determine the project root for a linter. If the value
|
||||
is a |Dictionary|, it maps a linter to either a |String| containing the
|
||||
project root or a |Funcref| to call to look up the root. The |Funcref| is
|
||||
provided the buffer number as its argument.
|
||||
This option is used to determine the project root for a linter. When set to a
|
||||
|String| it will be used for all linters. When set to a |Dictionary|, the
|
||||
keys are linter names and the values are either |Strings| containing project
|
||||
roots or |Funcref|s which are passed the buffer number.
|
||||
|
||||
The buffer-specific variable may additionally be a string containing the
|
||||
The buffer-specific variable may additionally be a |String| containing the
|
||||
project root itself.
|
||||
|
||||
If neither variable yields a result, a linter-specific function is invoked to
|
||||
detect a project root. If this, too, yields no result, and the linter is an
|
||||
LSP linter, it will not run.
|
||||
If a value can be found from either variable, ALE uses it directly and skips
|
||||
searching for a project root. If no value is found, a linter-specific
|
||||
function is invoked to detect a project root. If this, too, yields no result
|
||||
and the linter is an LSP linter, it will not run.
|
||||
|
||||
*ale-options.save_hidden*
|
||||
*g:ale_save_hidden*
|
||||
|
||||
Reference in New Issue
Block a user