Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Verbose summary shows wrong number of skipped files #10073

Open
sblask opened this issue Nov 6, 2024 · 3 comments · May be fixed by #10141
Open

Verbose summary shows wrong number of skipped files #10073

sblask opened this issue Nov 6, 2024 · 3 comments · May be fixed by #10141
Labels
Bug 🪲 Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@sblask
Copy link

sblask commented Nov 6, 2024

Bug description

When running pylint with --verbose it prints a summary of files checked and skipped, but I find the number of skipped files is wrong. I couldn't find a way to output what files pylint thinks it has skipped, so it's hard to do any kind of verification. Minimal example:

a directory with two files:

  • empty
  • foobar.py

with empty being empty (this is to make sure pylint does not pick up another rcfile that cause the problem) and foobar.py containing:

LaLa = ""

Then when running pylint foobar.py --verbose --rcfile empty it says 1 file checked and 1 skipped which can hardly be true if there is only one input file.

Configuration

No response

Command used

pylint foobar.py --verbose --rcfile empty

Pylint output

$ pylint foobar.py --verbose --rcfile empty
Using config file empty
************* Module foobar
foobar.py:1:0: C0114: Missing module docstring (missing-module-docstring)
foobar.py:1:0: C0103: Constant name "LaLa" doesn't conform to UPPER_CASE naming style (invalid-name)


Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)
Checked 1 files, skipped 1 files

Expected behavior

Pylint should say Checked 1 files, skipped 0 files. It would also be good if there was a way to print the names of the files that were actually checked and/or skipped.

Pylint version

$ pylint --version
pylint 3.3.1
astroid 3.3.5
Python 3.13.0 (main, Nov 6 2024, 14:45:43) [Clang 16.0.0 (clang-1600.0.26.4)]

OS / Environment

MacOS, iTerm2

Additional dependencies

No response

@sblask sblask added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Nov 6, 2024
@Pierre-Sassoulas
Copy link
Member

I think it's a duplicate of #9357, and could be fixed by #9375 (but it's blocked because the the verbose output should be generated at the end but during collection instead. (And there's a mess of duplication to deal with.)

@sblask
Copy link
Author

sblask commented Nov 6, 2024

@Pierre-Sassoulas printing the files would definitely help (especially if passing many files or using --recursive), but something must be broken currently, otherwise the stats wouldn't be wrong. And it wouldn't be helpful to get:

Checked:
foobar.py
Skipped:
foobar.py

@Pierre-Sassoulas Pierre-Sassoulas added Bug 🪲 Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Nov 7, 2024
@purajit purajit linked a pull request Dec 15, 2024 that will close this issue
@purajit
Copy link

purajit commented Dec 15, 2024

EDIT: I have a PR #10141 - this should also allow for logging the skipped files, but I haven't implemented
that since it would probably be a larger discussion as to how verbose verbose should be.

I'm very confused about what exactly "skipped" is supposed to mean, according to pylint. This is
where the number comes from:

pylint/pylint/lint/pylinter.py

Lines 1146 to 1147 in cb12577

unchecked_files_count = self.stats.undocumented["module"]
msg += f"\nChecked {checked_files_count} files, skipped {unchecked_files_count} files"

Which already feels odd; why is "undocumented" being used for "skipped"? And here's the only place
where it gets populated, under if docstring is None:, which of course makes sense for undocumented,
but not for skipped:

def _check_docstring(

It was added in #9122, with no explanation for that line and no comments. This is the issue it closed, which
clearly implies that "skipped" indeed should have nothing to do with "undocumented".

Looking through the stats logic, it doesn't look like pylint has a way of tracking skipped files
right now.

@jacobtylerwalls jacobtylerwalls added this to the 3.3.4 milestone Dec 21, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug 🪲 Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants