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.

flake8 ignores --config args

See original GitHub issue

With the following config

    -   id: flake8
        args: ['--config=setup.cfg']

Any settings in setup.cfg are never read. Adding additional settings e.g. args: ['--config=setup.cfg', '--max-line-length=500'] will set max line length to 500 but will ignore anything set in setup.cfg.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
dwaynebaileycommented, Apr 29, 2016

It will also selectively ignore and choose some of your other settings so something more like this should work:

    -   id: flake8
        args: ['--config=setup.cfg', '--ignore=E129,E2']
        exclude: ...
3reactions
asottilecommented, Apr 29, 2016

Ah yes I’ve found this as well.

If you have this config:

[flake8]
exclude = foo/

and you run flake8 foo/bar.py it’ll still try and lint foo/bar.py

What we’ve been doing in our repos is not using flake8’s exclude but instead use pre-commit’s exclude:

   -  id: flake8
      exclude: ...
Read more comments on GitHub >

github_iconTop Results From Across the Web

flake8 not picking up config file - Stack Overflow
For anyone running into this more recently: I turns out flake8 4.x no longer supports loading .config/flake8 , and seems to have no...
Read more >
Full Listing of Options and Their Descriptions - Flake8
Ignore any config files and use Flake8 as if there were no config files found. Command-line example: flake8 --isolated dir/. This can not...
Read more >
Ignoring Errors with Flake8 — flake8 3.1.1 documentation
By default, Flake8 has a list of error codes that it ignores. The list used by a version of Flake8 may be different...
Read more >
Configuring Flake8 — flake8 6.0.0 documentation
Flake8 supports storing its configuration in your project in one of setup.cfg , tox.ini , or .flake8 . Values set at the command...
Read more >
Configuration — flake8 2.5.5 documentation
If the ignore option is not in the configuration and not in the arguments, only the error codes E123/E133 , E226 and E241/E242...
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