0

On a .python file, I see the following for :ALEInfo

:ALEInfo
 Current Filetype: python
Available Linters: ['flake8', 'mypy', 'prospector', 'pycodestyle', 'pydocstyle', 'pyflakes', 'pylint', 'pyls', 'pyre', 'vulture']
  Enabled Linters: ['flake8', 'mypy', 'pylint']

Why is pycodestyle not enabled? Is there a way I can automatically enable it for all python files? I have pycodestyle already installed with pip, from the command line I can do pycodestyle . and it works.

1

I just found out that only flake8, mypy and pylint are enabled by default. I was trying to find out before but couldn't until someone pointed to

https://github.com/w0rp/ale/blob/master/doc/ale.txt#L1438

or :help ale_linters

In order to enable new linters, I need to set:

let g:ale_linters = {'python': ['pycodestyle']}

The doc above has this part:

  The |g:ale_linters| option sets a |Dictionary| mapping a filetype to a
  |List| of linter programs to be run when checking particular filetypes.

  This |Dictionary| will be merged with a default dictionary containing the
  following values: >

  {
  \   'csh': ['shell'],
  \   'elixir': ['credo', 'dialyxir', 'dogma', 'elixir-ls'],
  \   'go': ['gofmt', 'golint', 'go vet'],
  \   'hack': ['hack'],
  \   'help': [],
  \   'perl': ['perlcritic'],
  \   'perl6': [],
  \   'python': ['flake8', 'mypy', 'pylint'],
  \   'rust': ['cargo'],
  \   'spec': [],
  \   'text': [],
  \   'vue': ['eslint', 'vls'],
  \   'zsh': ['shell'],
  \}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.