-
-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: gitignore support #638
Comments
In GitLab by @sigmavirus24 on Oct 20, 2018, 10:15 The behaviour here is definitely way too magical. I can understand the desire, but it's rather too implicit and we strive to be far more explicit. |
In GitLab by @sigmavirus24 on Oct 20, 2018, 10:15 closed |
In GitLab by @sigmavirus24 on Oct 20, 2018, 10:16 Also, I truly abhor how many places this project already searches out config from. Adding one more is just begging for me to not support any of them to protect my own time. |
In GitLab by @Pequex on Feb 25, 2019, 24:33 @sigmavirus24 Mostly out of curiosity... Would a |
In GitLab by @asottile on Feb 25, 2019, 08:31 @Pequex it seems the only apis given to plugins for modifying existing options right now are Another option if you want to only run on |
In GitLab by @notpeter on Jan 12, 2018, 11:29
Hi folks!
It'd be great if flake8 could support an optional mode which in addition to the build-in exclude list also supports handling .gitignore files. This is a obviously a non-trivial feature. It would require implementing a parser for gitignore (see codeskyblue/pyignore for inspiration) as well as having code which properly handles both gitignore style (globs, globstar, etc) and existing list of excludes, likely side-by-side.
Something like this could ease adoption of flake8 in existing code bases so that ignored directories (node_modules, etc) don't need to be defined in yet another spot (.gitignore, .dockerignore AND setup.cfg, etc) and enables user-specific ignores with minimal complexity.
In my mind, a minimal implementation of this would need to look for both any global gitignore (
git config --get core.excludesfile
, usually~/.gitignore
) and.gitignore
in any directory arguments provided on the flake8 command-line. For a complete implementation, it should also support sub-directory level .gitignore files, but even supporting only global and top-level gitignore would go a long way to prevent duplicated configs in many environments.I'm not expecting someone to magically implement this, but more trying to get feedback before I take a stab at it myself. Also to confirm, is flake8 the right place for this or will the underlying quality checkers (pyflakes, pycodestyle, etc) need to be updated as well?
The text was updated successfully, but these errors were encountered: