question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Flake8 plugins and configuration

See original GitHub issue

Can I use flake8 tool for linting? I looked in package.json, but did not find there the corresponding options.

if I change configurationSources to [‘flake’], then I do not see any changes and pyflakes continues to be used. I store flake8 settings in .flake8 file for all projects.

If this is important, I use lsp-mode in Emacs and LanguageClient-neovim in Neovim as clients.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:29 (10 by maintainers)

github_iconTop GitHub Comments

21reactions
sivakov512commented, Nov 14, 2017

I have a .flake8 file with this content

[flake8]
ignore = E501, E265, F811
max-line-length = 160

But I still get errors about the length of the line of more than 79 characters. A similar problem if the file is named flake8.cfg.

Why not use flake8 directly (as optional feature, for example)? I use some flake8-plugins, for example, flake8-isort and flake8-pdb and pyls do not work with them

4reactions
horseintheskycommented, Mar 31, 2021

I found the answer

If the ignore option is not in the configuration and not in the arguments, only the error codes E123/E133, E226 and E241/E242 are ignored (see the warning and error codes).

https://flake8.pycqa.org/en/2.5.5/config.html#default

@GaetanLepage maxLineLength did the trick. Here is my full config for NVIM built-in LSP

lspconfig.pyls.setup {
  cmd = {"pyls"},
  filetypes = {"python"},
  settings = {
    pyls = {
      configurationSources = {"flake8"},
      plugins = {
        jedi_completion = {enabled = true},
        jedi_hover = {enabled = true},
        jedi_references = {enabled = true},
        jedi_signature_help = {enabled = true},
        jedi_symbols = {enabled = true, all_scopes = true},
        pycodestyle = {enabled = false},
        flake8 = {
          enabled = true,
          ignore = {},
          maxLineLength = 160
        },
        mypy = {enabled = false},
        isort = {enabled = false},
        yapf = {enabled = false},
        pylint = {enabled = false},
        pydocstyle = {enabled = false},
        mccabe = {enabled = false},
        preload = {enabled = false},
        rope_completion = {enabled = false}
      }
    }
  },
  on_attach = on_attach
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Plugins For Fun and Profit — flake8 6.0.0 documentation
You can use both flake8 --select and flake8 --ignore with plugins. Some plugins register new options, so be sure to check flake8 --help...
Read more >
How to write Flake8 plugins . Automate your code reviews
In this article, you will learn how to create a Flake8 plugin. ... You need to point to that class in the setup.cfg...
Read more >
Useful Flake8 Plugins for Python Linting - DEV Community ‍ ‍
Flake8 has a powerful configuration mechanism, using .flake8 , setup.cfg , or tox.ini files. Plugins and warnings can be disabled per file (or ......
Read more >
flake8 Documentation - Read the Docs
A plugin that augments the output of Flake8 when passed to flake8 ... Flake8 supports storing its configuration in your project in one...
Read more >
flake8 - Pants build system
The Flake8 Python linter (https://flake8.pycqa.org/). Backend: pants.backend. ... [flake8:local-plugins] in your Flake8 config file. For example:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found