-
-
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
Generated warnings depending on file arguments order #689
Comments
Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore): No, this is not expected, it's probably a bug. Could you provide your config file and some files which reproduces the issue for you? I tried with some dummy files, but I always get the same output. |
Original comment by Matt Gilson (BitBucket: mgilson1): I'm trying to reproduce this one simply (outside of my source tree), but I'm having a bit of trouble. It seems that there's something going on with my packages and subpackages in our project. I'll keep trying to distill it down to a minimal amount of code that I can pass on. (I unfortunately can't post my actual code at the moment as it is proprietary). If I can't distill it, I guess you'll have to close this one as "Not Reproducible", but maybe another use will find this in a google search with a code sample that can reproduce this one. |
Original comment by Matt Gilson (BitBucket: mgilson1): To reproduce, unpack the tarball, then:
|
Original comment by Matt Gilson (BitBucket: mgilson1): And if it matters, here's my pylint version/build info:
|
The issue is still present. I am able to reproduce it using the files in the attached archive (mymodule.zip). Steps to reproduce:
Expected behaviour: Pylint version:
I've observed this to happen only if imports are using the
I have also seen this with the |
Have the same issue. |
I have the same issue with: $ pylint --version
pylint 2.9.5
astroid 2.6.5
Python 3.9.6 (default, Jun 29 2021,
[Clang 12.0.5 (clang-1205.0.22.9)] |
Very simple repro: a.py:
b.py:
Run this in your shell:
|
What I am seeing is based on this example from the comments & it looks like the original reported issue is no longer an issue but something else is now occurring in the output formatting. The emitted messages are the same but they end up outputted in a different section in the report: (venv310) Marks-MacBook-Air-2:mymodule markbyrne$ pylint mybase.py override.py
************* Module mymodule.mybase
mybase.py:5:0: C0115: Missing class docstring (missing-class-docstring)
************* Module mymodule.override
override.py:7:4: C0103: Attribute name "myInvalidName" doesn't conform to snake_case naming style (invalid-name)
mybase.py:5:0: R0903: Too few public methods (1/2) (too-few-public-methods)
override.py:5:0: C0116: Missing function or method docstring (missing-function-docstring)
override.py:6:4: C0104: Disallowed name "foo" (disallowed-name)
------------------------------------------------------------------
Your code has been rated at 2.86/10 (previous run: 2.86/10, +0.00)
(venv310) Marks-MacBook-Air-2:mymodule markbyrne$ pylint override.py mybase.py
************* Module mymodule.override
override.py:5:0: C0116: Missing function or method docstring (missing-function-docstring)
override.py:6:4: C0104: Disallowed name "foo" (disallowed-name)
************* Module mymodule.mybase
mybase.py:5:0: C0115: Missing class docstring (missing-class-docstring)
override.py:7:4: C0103: Attribute name "myInvalidName" doesn't conform to snake_case naming style (invalid-name)
mybase.py:5:0: R0903: Too few public methods (1/2) (too-few-public-methods)
------------------------------------------------------------------
Your code has been rated at 2.86/10 (previous run: 2.86/10, +0.00) |
Originally reported by: Anonymous
I'm using pylint as part of an automated commit hook in git to check if any file that was changed is non-conformant. My git-hook looks something like:
Here, the bash array
${PY_FILES_CHANGED}
is populated with the filenames of python files based on the files in the current commit. Today I ran into a strange error. My commit consisted of 2 files in the same directory (package) -- though I'm not sure if pylint cares about that.Is this expected behavior?
The text was updated successfully, but these errors were encountered: