-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Do not remove preceding ./
from ignore-paths
option input
#5491
Comments
Please refer to the documentation for this setting here: https://pylint.pycqa.org/en/latest/technical_reference/features.html
|
The documentation does not specify what gets passed in to the regexp. Is it always an absolute path? It would be best, IMHO, if the path was always relative to the project root (location of Regardless, why is there a difference in behavior between passing |
In a regex |
I know. |
Let me rephrase my question: My file
In this case, I would expect the path string to either be However, the issue at hand is:
How is the argument-as-passed-in processed so that it suddenly doesn't match the same regexp? I can reproduce the same problem one directory up:
|
No it matches against the path provided in the command. So if doing
I think We remove the
This is because of the normalisation and perhaps something we should take into account. I'm wondering if we can add |
This is all related to my last point in the previous comment which I just posted after you posted this: This is indeed something that should be fixed! I'll reopen and rename the issue! For future reference: |
./
from ignore-paths
option input
Hi @DanielNoord, so any suggestions to fix this issue? I think maybe we could use If OK, I can try it fix it as my first pull request. :-) |
The changes that cause this were introduced in #5201. I think the tests that were added to I honestly don't know what the best approach is here (and must warn that it might be a difficult issue for a first PR to a project).
Approach 2 does risk being non backwards compatible if people rely on us not normalising so that might be an issue... |
Thanks for the detailed explanation. I will further look into it. Actually, I was blocked by the issue. As the release of v2.13.0, I try to use |
Hi @huxuan, are you still working on this ? (Not any obligation it's only so potential contributor know if they can do this issue without stepping on your toes :) ) |
Hi @Pierre-Sassoulas, I am not working on it. Thanks for your consideration. |
Bug description
When run as
pylint test.py --ignore-paths=./test.py
, Pylint (correctly?) ignores the file and produces no output.When run as
pylint ./test.py --ignore-paths=./test.py
, the filetest.py
is NOT ignored and it is instead checked.Configuration
Empty configuration.
Command used
Pylint output
Expected behavior
(no output)
Pylint version
I'm seeing the same behavior since version 2.12
OS / Environment
No response
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: