-
-
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
per-file-ignores in config file should be treated relative to it #693
Comments
In GitLab by @asottile on Mar 7, 2019, 08:38 Odd, this does seem to be treated differently than I set up the following in
The difference appears to be here where the "filename" (actually the per-file-ignore pattern) is being normalized: Looking at a log, the value for
Looking at the log for
The fix here is to normalize the paths relative to the config file they're defined in, though I'm not quite sure where to thread that through, will take more of a sit down Thanks for the report 🎉 |
In GitLab by @blueyed on Mar 18, 2019, 02:39 Any more findings by now? (closing old tabs) |
In GitLab by @asottile on Mar 18, 2019, 07:53 nope, havnen't done anything with this since triaging -- if you want to take a stab at it by all means :) |
In GitLab by @asottile on Mar 21, 2019, 08:24 mentioned in merge request !311 |
In GitLab by @ericvw on May 20, 2019, 20:37 mentioned in merge request !321 |
In GitLab by @ericvw on May 20, 2019, 20:43 I created !321, which is an initial minimal stab to get this working. |
In GitLab by @pjacock on Aug 8, 2019, 03:47 I wonder if this is part of a larger issue with the path normalisation? i.e. new issue #562. |
In GitLab by @ericvw on Aug 29, 2019, 10:11 mentioned in merge request !337 |
In GitLab by @ericvw on Aug 31, 2019, 06:38 mentioned in merge request !351 |
In GitLab by @gbd.lin on Oct 9, 2019, 05:44 What is the current status of this issue? I'm really looking forward to using some features that will be introduced in 3.8.0, especially |
In GitLab by @asottile on Oct 9, 2019, 06:00 in process, please don't bump issues like this, use the thumbs up |
In GitLab by @pjacock on Jan 17, 2020, 24:34 #562 has been closed as a duplicate, the same symptoms but wider in scope affecting any path configuration values and sources of config files. I included some examples using a tiny plugin adding a path value. |
In GitLab by @felker on Feb 25, 2020, 09:07 We recently stumbled upon this in the Emacs |
In GitLab by @asottile on Apr 27, 2020, 13:01 this is likely to miss 3.8.0, but we will try and address this soon (the work to fix this is large, complicated, and in progress) |
In GitLab by @lewoudar on May 31, 2020, 13:03 Hi everyone, from gevent import monkey
monkey.patch_all() # noqa: E402
from .files import read_mp, write_mp Under flake8 3.7.9 when I run But under flake8 3.8.2, No I have My environment
How I install flake8: That sounds like a regression :/ |
In GitLab by @lewoudar on May 31, 2020, 13:16 Aww thanks for the reference, I will check that |
In GitLab by @tmewett on Nov 3, 2020, 08:59 Is it necessary to involve the location of the config file? With the full current working directory and the relative path of what is being scanned by flake8, is it possible to construct a full valid path for any file being scanned. This can then be matched against the configured path patterns. |
In GitLab by @asottile on Nov 3, 2020, 09:09 yes, the expectation of flake8 users is that paths in config are relative to it -- this is true for all options currently except per-file-ignores the config is not always in the current working directory |
Previous attempts to selectively disable this warning per-file failed, as flake8 does not correctly normalise paths for `per-file-ignores`. Until resolved, we disable this check as `assert` statements are extremely unlikely out of tests files. See PyCQA/flake8#693
This comment was marked as off-topic.
This comment was marked as off-topic.
…flake8 per-file-ignore Reason: per-file-ignores paths are treated relative to the current directory, not the config file. This breaks the flake8 pre-commit hook that is invoked from the project root. See PyCQA/flake8#693
…flake8 per-file-ignore Reason: per-file-ignores paths are treated relative to the current directory, not the config file. This breaks the flake8 pre-commit hook that is invoked from the project root. See PyCQA/flake8#693
…flake8 per-file-ignore Reason: per-file-ignores paths are treated relative to the current directory, not the config file. This breaks the flake8 pre-commit hook that is invoked from the project root. See PyCQA/flake8#693
* Add pre-commit hooks * Specify explicitly all exportable names from tiledbsc and remove the flake8 per-file-ignore Reason: per-file-ignores paths are treated relative to the current directory, not the config file. This breaks the flake8 pre-commit hook that is invoked from the project root. See PyCQA/flake8#693 * Lint Python scripts outside of apis/python
This comment was marked as off-topic.
This comment was marked as off-topic.
@Guillem96 OSS advice: github provides a thumbs up so you can participate without sending an email to everyone subscribed. it's also easy to check the status of an issue: is it open? yes. if you have doubts on the freshness of the issue it's very easy to just try it |
In GitLab by @blueyed on Mar 7, 2019, 07:10
With
tests/conftest.py:E402
insetup.cfg
, flake8 run intests
will still complain about the error.I think relative paths in config files should be treated relative to the config file's location.
Using flake8 3.7.7 (mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.7.2 on Linux.
The text was updated successfully, but these errors were encountered: