Add PyLS linter#1097
Conversation
|
|
||
| function! ale_linters#python#pyls#GetProjectRoot(buffer) abort | ||
| " Start with more generic files | ||
| for l:possible_filename in ['setup.cfg', 'tox.ini', 'flake8.cfg', 'pycodestyle.cfg'] |
There was a problem hiding this comment.
I recommend using ale#python#FindProjectRoot here, and you could maybe modify that function so it will look for other configuration files. Then the behavior of searching for Python project roots will be consistent everywhere.
There was a problem hiding this comment.
PyLS only checks for that set of files
There was a problem hiding this comment.
I could probably use python#FindProjectRoot, but it wouldn't be accurate
There was a problem hiding this comment.
I recommend it. One important difference is that it uses a bread-first search for configuration files instead of depth-first search, so foo/bar/baz/tox.ini will be preferred over foo/setup.cfg.
There was a problem hiding this comment.
Yeah, that's a good point. Some people have multiple per-module configs.
I'll just add more filenames to python#FindProjectRoot.
Add more config types to ale#python#FindProjectRoot
| \ 'lsp': 'stdio', | ||
| \ 'executable_callback': 'ale_linters#python#pyls#GetExecutable', | ||
| \ 'command_callback': 'ale_linters#python#pyls#GetExecutable', | ||
| \ 'language_callback': 'ale_linters#python#pyls#GetLanguage', |
There was a problem hiding this comment.
I'll add support at some point for just writing 'language': 'python'. I can see that coming up quite a bit.
There was a problem hiding this comment.
Yeah, that would be nice. Is there anything else I should do?
| " Author: aurieh <me@aurieh.me> | ||
| " Description: A language server for Python | ||
|
|
||
| call ale#Set('python_pyls_executable', 'pyls') |
There was a problem hiding this comment.
I just noticed one thing missing, could you add a documentation entry for this new option?
There was a problem hiding this comment.
On that note, is there a vim plugin that helps with doc file alignment? Doing it by hand is kinda confusing.
There was a problem hiding this comment.
There's a fixer for it. See :ALEFixSuggest when editing a help file.
There was a problem hiding this comment.
Oh that's really cool, thanks for letting me know.
| Type: |String| | ||
| Default: `pyls` | ||
|
|
||
| See |ale-intergrations-local-executables| |
There was a problem hiding this comment.
woops, that's a typo, Imma rebase this
|
Cheers! 🍻 |
No description provided.