-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
Pre-commit hook doesn't respect configuration files #155
Comments
In GitLab by @wjanssen on Sep 27, 2016, 10:26 I'm seeing this as well. Linux 16.04, Python 2.7.12, Flake8 2.5.4 (pep8: 1.7.0, mccabe: 0.5.2, pyflakes: 1.1.0) CPython 2.7.12 on Linux |
In GitLab by @wjanssen on Sep 27, 2016, 10:27 Running flake8 on the command-line also seems to ignore setup.cfg and .flake8. |
In GitLab by @phdru on Sep 30, 2016, 08:32 My |
In GitLab by @sergioalonso on Oct 30, 2016, 15:45 Mentioned in merge request !131 |
In GitLab by @sigmavirus24 on Nov 8, 2016, 19:13 Mentioned in merge request !136 |
In GitLab by @sigmavirus24 on Nov 8, 2016, 19:14 Could y'all test the wheel generated by the CI in !136. I believe this will fix the issue y'all found here. Thanks again for reporting this! |
In GitLab by @Stavros on Nov 9, 2016, 08:09 !136 works in that it respects the configuration file. It fails in that it still allows the commit to happen, even though there are errors. Is there a ticket related to that that I can comment on? This ticket can probably be resolved, if the other testers' results are similar to mine. |
In GitLab by @phdru on Nov 9, 2016, 08:19 Currently I cannot reproduce the problem with flake8 3.0.4. |
In GitLab by @sigmavirus24 on Nov 9, 2016, 08:23 @Stavros, we lost our documentation for configuring the git hook to prevent commits, try configuring "flake8.strict" to be true via git-config. We will read flake8 config values from your project's git configuration. |
In GitLab by @Stavros on Nov 9, 2016, 08:26 @sigmavirus24 That worked, thank you. What do you mean by "lost the documentation", though? Did the documentation mention a way to do this when adding the hook, or...? |
In GitLab by @sigmavirus24 on Nov 9, 2016, 08:33 See #249, @Stavros. The 2.x version of Flake8's docs mentioned using |
In GitLab by @Stavros on Nov 9, 2016, 08:37 Ah, I see, thanks. Would it not be less surprising to have the strict behaviour on by default? My reasoning is that, if I care enough to add a hook, I care enough to fix the errors. I can issue a MR if you agree. |
In GitLab by @sigmavirus24 on Nov 9, 2016, 09:56 @Stavros I do not agree, mainly since the time for backwards incompatible changes was when 3.0 was released. Not months later. |
In GitLab by @sigmavirus24 on Nov 9, 2016, 10:02 Status changed to closed by commit 7320cce |
In GitLab by @sigmavirus24 on Nov 9, 2016, 15:09 Mentioned in commit sigmavirus24/flake8@5b1d84f |
In GitLab by @sigmavirus24 on Nov 13, 2016, 12:51 Mentioned in merge request !147 |
In GitLab by @sigmavirus24 on Nov 13, 2016, 12:59 Mentioned in commit 7800351 |
In GitLab by @cmdelatorre on Jan 28, 2018, 16:39 Hi there, just checking: this issue wasn't fixed, right? $ python --version
Python 3.5.2
$ flake8 --version
3.5.0 (mccabe: 0.6.1, pycodestyle: 2.3.1, pyflakes: 1.6.0) CPython 3.5.2 on Linux In any case, I solved it by replacing the hook that flake8 creates with a somewhat simpler one (which respects my custom settings): #!/bin/sh
flake8
|
In GitLab by @roganov on Mar 13, 2018, 02:18 Does not work for me as well. Can this be reopened please? |
In GitLab by @pbaranay on Sep 13, 2016, 12:58
My project has a couple settings defined in our
.flake8
file, such as:When running
flake8
directly the options are respected, as one expects. However, I recently usedflake8 --install-hook=git
to install the flake8 pre-commit hook. It seems that the flake8 application which is run via the hook does not pick up these settings:I'm not sure if this is intended behavior or a bug. In either case, I'd appreciate some guidance on how to alter the hook to handle simple options.
Thanks for your help.
P.S. I tried duplicating my
.flake8
file into the other possible configuration filenames (tox.ini
andsetup.cfg
) and did not observe any change in behavior.====
The text was updated successfully, but these errors were encountered: