diff --git a/doc/whatsnew/fragments/9357.feature b/doc/whatsnew/fragments/9357.feature new file mode 100644 index 0000000000..fda71dd0aa --- /dev/null +++ b/doc/whatsnew/fragments/9357.feature @@ -0,0 +1,4 @@ +The verbose option now outputs the filenames of the files that have been checked. +Previously, it only included the number of checked and skipped files. + +Closes #9357 diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py index 615cf7c351..5f2bab90d8 100644 --- a/pylint/lint/pylinter.py +++ b/pylint/lint/pylinter.py @@ -764,6 +764,7 @@ def _lint_files( continue try: self._lint_file(fileitem, module, check_astroid_module) + self.stats.modules_names.add(fileitem.filepath) except Exception as ex: # pylint: disable=broad-except template_path = prepare_crash_report( ex, fileitem.filepath, self.crash_file_path @@ -1161,7 +1162,12 @@ def _report_evaluation(self, verbose: bool = False) -> int | None: if verbose: checked_files_count = self.stats.node_count["module"] - msg += f"\nChecked {checked_files_count} files, skipped {self.stats.skipped} files/modules" + unchecked_files_count = self.stats.undocumented["module"] + checked_files = ", ".join(self.stats.modules_names) + msg += ( + f"\nChecked {checked_files_count} files/modules ({checked_files})," + f" skipped {unchecked_files_count} files/modules" + ) if self.config.score: sect = report_nodes.EvaluationSection(msg) diff --git a/pylint/utils/linterstats.py b/pylint/utils/linterstats.py index 5509cb66aa..c4a7af5e47 100644 --- a/pylint/utils/linterstats.py +++ b/pylint/utils/linterstats.py @@ -109,6 +109,7 @@ def __init__( self.code_type_count = code_type_count or CodeTypeCount( code=0, comment=0, docstring=0, empty=0, total=0 ) + self.modules_names: set[str] = set() self.dependencies: dict[str, set[str]] = dependencies or {} self.duplicated_lines = duplicated_lines or DuplicatedLines( diff --git a/tests/test_self.py b/tests/test_self.py index 2d9bd70e88..4eda915dfc 100644 --- a/tests/test_self.py +++ b/tests/test_self.py @@ -257,7 +257,10 @@ def test_output_with_verbose(self) -> None: out=out, code=4, ) - assert "Checked 1 files, skipped 1 files/modules" in out.getvalue().strip() + stripped = out.getvalue().strip() + assert "Checked 1 files/modules" in stripped + assert "unnecessary_lambda.py" in stripped + assert "skipped 0 files/modules" in stripped def test_no_out_encoding(self) -> None: """Test redirection of stdout with non ascii characters."""