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.

Files not being excluded via Atom, but command line flake8 does

See original GitHub issue

This is the setup.cfg file. I know that the linter reads the file because ignore is honored so there’s something going on with the exclude. The first screenshot shows the linter raising an error in apollo/config/settings/local.py while the second screenshot clearly shows that this file was ignored. Let me know what additional info is needed.

Using Mac OS, virtualenvwrapper

[flake8]
ignore = D100, D210, D400, D413
exclude =
    .git,
    __pycache__,
    __init__.py,
    */migrations/*,
    apollo/config/settings/*.py,
    apollo/manage.py
max-line-length = 99
max-complexity = 10

Location of flake8: ~/Developer/.virtualenvs/apollo/bin/flake8

Project structure

.
├── apollo
│   ├── config
│   │   ├── __init__.py
│   │   ├── settings
│   │   │   ├── __init__.py
│   │   │   ├── base.py
│   │   │   ├── local.py
│   │   │   ├── production.py
│   │   │   ├── settings.py
│   │   │   ├── staging.py
│   │   │   └── test.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   └── manage.py
└── setup.cfg

Screenshots screen shot 2017-06-01 at 7 02 18 pm screen shot 2017-06-01 at 7 02 02 pm

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lucasdfcommented, Dec 12, 2017

I am looking into this.

0reactions
Arcanemaguscommented, Dec 22, 2017

However, in any other situation where the configuration file is not in the project’s root, Flake8 does not recognize the file.

@lucasdf Ideally these providers should be “the same as running the tool in the CLI”, unfortunately what that actually means can get really tricky. I generally follow the rules of:

  • “if you are in the directory of the file and run the CLI tool, the provider should match that”
  • “if you are in the project root (as seen by Atom) and run the CLI tool, the provider should match that”

Which one of those a provider falls under is just the start of the trickiness 😉.

I think this provider should follow the second one, unless this issue is describing a situation where that doesn’t match what running flake8 in the CLI does, in which case we may need to change it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can linter-flake8 ignore files by using a project-wide .flake8rc?
I'm using Atom and linter-flake8 for my project. I have a set of huge generated Python files and I want them ignored by...
Read more >
Configuring Flake8 — flake8 6.0.0 documentation
Each command-line option that you want to specify in your config file can be named in either of two ways: Using underscores (...
Read more >
Important notes 1.x — Borg - Deduplicating Archiver 2.0.0b5 ...
In case your OS does not provide Python >= 3.8, consider using our binary, ... cmd line arg; complement the documentation for pattern...
Read more >
How to run python script in git bash - Caritas Castellaneta
But what usually will end up in a bash or batch file, can be also done in Python. ... Although, the command's result...
Read more >
Changelog — Python 3.11.1 documentation
gh-99886: Fix a crash when an object which does not have a dictionary frees its ... tags found in configuration files when no...
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