diff options
author | Jon Parise <jon@indelible.org> | 2022-02-07 22:54:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-08 15:54:25 +0900 |
commit | 8b1ea33cc0cb18bec3bf19d1131b322b313cea4e (patch) | |
tree | 754da607ffda3bf955187e6194e4b182fa3ebfde /doc | |
parent | 2428d4d81d964a3be83bea649c882012acd4b210 (diff) | |
download | ale-8b1ea33cc0cb18bec3bf19d1131b322b313cea4e.zip |
Add a unimport linter for Python files (#4058)
Unimport (https://github.com/hakancelik96/unimport/) is a linter,
formatter for finding and removing unused import statements.
This introduces linting support, although fixer support could come
later.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ale-python.txt | 52 | ||||
-rw-r--r-- | doc/ale-supported-languages-and-tools.txt | 1 | ||||
-rw-r--r-- | doc/ale.txt | 1 |
3 files changed, 54 insertions, 0 deletions
diff --git a/doc/ale-python.txt b/doc/ale-python.txt index 7486d0b4..2f9f5d29 100644 --- a/doc/ale-python.txt +++ b/doc/ale-python.txt @@ -1067,6 +1067,58 @@ g:ale_python_reorder_python_imports_use_global =============================================================================== +unimport *ale-python-unimport* + +`unimport` will be run from a detected project root, per |ale-python-root|. + + +g:ale_python_unimport_auto_pipenv *g:ale_python_unimport_auto_pipenv* + *b:ale_python_unimport_auto_pipenv* + Type: |Number| + Default: `0` + + Detect whether the file is inside a pipenv, and set the executable to `pipenv` + if true. This is overridden by a manually-set executable. + + +g:ale_python_unimport_auto_poetry *g:ale_python_unimport_auto_poetry* + *b:ale_python_unimport_auto_poetry* + Type: |Number| + Default: `0` + + Detect whether the file is inside a poetry, and set the executable to `poetry` + if true. This is overridden by a manually-set executable. + + +g:ale_python_unimport_executable *g:ale_python_mypy_executable* + *b:ale_python_unimport_executable* + Type: |String| + Default: `'unimport'` + + See |ale-integrations-local-executables| + + Set this to `'pipenv'` to invoke `'pipenv` `run` `unimport'`. + Set this to `'poetry'` to invoke `'poetry` `run` `unimport'`. + + +g:ale_python_unimport_options *g:ale_python_mypy_options* + *b:ale_python_unimport_options* + Type: |String| + Default: `''` + + This variable can be changed to add command-line arguments to the unimport + invocation. + + +g:ale_python_unimport_use_global *g:ale_python_mypy_use_global* + *b:ale_python_unimport_use_global* + Type: |Number| + Default: `get(g:, 'ale_use_global_executables', 0)` + + See |ale-integrations-local-executables| + + +=============================================================================== vulture *ale-python-vulture* g:ale_python_vulture_change_directory *g:ale_python_vulture_change_directory* diff --git a/doc/ale-supported-languages-and-tools.txt b/doc/ale-supported-languages-and-tools.txt index ee950592..67efc6ec 100644 --- a/doc/ale-supported-languages-and-tools.txt +++ b/doc/ale-supported-languages-and-tools.txt @@ -463,6 +463,7 @@ Notes: * `pyre` * `pyright` * `reorder-python-imports` + * `unimport` * `vulture`!! * `yapf` * QML diff --git a/doc/ale.txt b/doc/ale.txt index 9ce54f12..6dbfb6d0 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -3081,6 +3081,7 @@ documented in additional help files. pyre..................................|ale-python-pyre| pyright...............................|ale-python-pyright| reorder-python-imports................|ale-python-reorder_python_imports| + unimport..............................|ale-python-unimport| vulture...............................|ale-python-vulture| yapf..................................|ale-python-yapf| qml.....................................|ale-qml-options| |