From b6f6d84c25169744f43db6d0ee296ee44eb78d91 Mon Sep 17 00:00:00 2001 From: Yining Date: Fri, 27 Jan 2023 12:24:18 +1100 Subject: add: pycln as a python linter and fixer (#4415) this commit adds pycln as a Python linter and fixer, together with some tests and documentation. It addresses #4340 pycln repo: https://github.com/hadialqattan/pycln --- doc/ale-python.txt | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) (limited to 'doc/ale-python.txt') diff --git a/doc/ale-python.txt b/doc/ale-python.txt index 07f54db8..aad64b1d 100644 --- a/doc/ale-python.txt +++ b/doc/ale-python.txt @@ -580,6 +580,78 @@ g:ale_python_prospector_auto_poetry *g:ale_python_prospector_auto_poetry* if true. This is overridden by a manually-set executable. +=============================================================================== +pycln *ale-python-pycln* + +g:ale_python_pycln_change_directory *g:ale_python_pycln_change_directory* + *b:ale_python_pycln_change_directory* + Type: |Number| + Default: `1` + + If set to `1`, `pycln` will be run from a detected project root, per + |ale-python-root|. if set to `0` or no project root detected, + `pycln` will be run from the buffer's directory. + + +g:ale_python_pycln_executable *g:ale_python_pycln_executable* + *b:ale_python_pycln_executable* + Type: |String| + Default: `'pycln'` + + See |ale-integrations-local-executables| + + Set this to `'pipenv'` to invoke `'pipenv` `run` `pycln'`. + Set this to `'poetry'` to invoke `'poetry` `run` `pycln'`. + + +g:ale_python_pycln_options *g:ale_python_pycln_options* + *b:ale_python_pycln_options* + Type: |String| + Default: `''` + + This variable can be changed to add command-line arguments to the pycln + invocation. + + For example, to select/enable and/or disable some error codes, + you may want to set > + let g:ale_python_pycln_options = '--expand-stars' + + +g:ale_python_pycln_config_file *g:ale_python_pycln_config_file* + *b:ale_python_pycln_config_file* + Type: |String| + Default: `''` + + Use this variable to set the configuration file. + If `'--config' ` is found in the |g:ale_python_pycln_options|, then that + option value will override the value in this variable. + +g:ale_python_pycln_use_global *g:ale_python_pycln_use_global* + *b:ale_python_pycln_use_global* + Type: |Number| + Default: `get(g:, 'ale_use_global_executables', 0)` + + See |ale-integrations-local-executables| + + +g:ale_python_pycln_auto_pipenv *g:ale_python_pycln_auto_pipenv* + *b:ale_python_pycln_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_pycln_auto_poetry *g:ale_python_pycln_auto_poetry* + *b:ale_python_pycln_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. + + =============================================================================== pycodestyle *ale-python-pycodestyle* -- cgit v1.2.3