5454)
5555from pylint .message import Message , MessageDefinition , MessageDefinitionStore
5656from pylint .reporters .base_reporter import BaseReporter
57+ from pylint .reporters .progress_reporters import ProgressReporter
5758from pylint .reporters .text import TextReporter
5859from pylint .reporters .ureports import nodes as report_nodes
5960from pylint .typing import (
@@ -323,8 +324,7 @@ def __init__(
323324 self .option_groups_descs [opt_group [0 ]] = opt_group [1 ]
324325 self ._option_groups : tuple [tuple [str , str ], ...] = (
325326 * option_groups ,
326- ("Messages control" , "Options controlling analysis messages" ),
327- ("Reports" , "Options related to output formatting and reporting" ),
327+ * PyLinter .option_groups_descs .items (),
328328 )
329329 self .fail_on_symbols : list [str ] = []
330330 """List of message symbols on which pylint should fail, set by --fail-on."""
@@ -354,6 +354,7 @@ def __init__(
354354 self .current_file : str | None = None
355355 self ._ignore_file = False
356356 self ._ignore_paths : list [Pattern [str ]] = []
357+ self .verbose = False
357358
358359 self .register_checker (self )
359360
@@ -685,6 +686,8 @@ def check(self, files_or_modules: Sequence[str]) -> None:
685686 sys .path = original_sys_path
686687 return
687688
689+ progress_reporter = ProgressReporter (self .verbose )
690+
688691 # 1) Get all FileItems
689692 with augmented_sys_path (extra_packages_paths ):
690693 if self .config .from_stdin :
@@ -698,18 +701,26 @@ def check(self, files_or_modules: Sequence[str]) -> None:
698701 with augmented_sys_path (extra_packages_paths ):
699702 with self ._astroid_module_checker () as check_astroid_module :
700703 # 2) Get the AST for each FileItem
701- ast_per_fileitem = self ._get_asts (fileitems , data )
704+ ast_per_fileitem = self ._get_asts (fileitems , data , progress_reporter )
702705
703706 # 3) Lint each ast
704- self ._lint_files (ast_per_fileitem , check_astroid_module )
707+ self ._lint_files (
708+ ast_per_fileitem , check_astroid_module , progress_reporter
709+ )
705710
706711 def _get_asts (
707- self , fileitems : Iterator [FileItem ], data : str | None
712+ self ,
713+ fileitems : Iterator [FileItem ],
714+ data : str | None ,
715+ progress_reporter : ProgressReporter ,
708716 ) -> dict [FileItem , nodes .Module | None ]:
709717 """Get the AST for all given FileItems."""
710718 ast_per_fileitem : dict [FileItem , nodes .Module | None ] = {}
711719
720+ progress_reporter .start_get_asts ()
721+
712722 for fileitem in fileitems :
723+ progress_reporter .get_ast_for_file (fileitem .filepath )
713724 self .set_current_module (fileitem .name , fileitem .filepath )
714725
715726 try :
@@ -743,9 +754,12 @@ def _lint_files(
743754 self ,
744755 ast_mapping : dict [FileItem , nodes .Module | None ],
745756 check_astroid_module : Callable [[nodes .Module ], bool | None ],
757+ progress_reporter : ProgressReporter ,
746758 ) -> None :
747759 """Lint all AST modules from a mapping.."""
760+ progress_reporter .start_linting ()
748761 for fileitem , module in ast_mapping .items ():
762+ progress_reporter .lint_file (fileitem .filepath )
749763 if module is None :
750764 continue
751765 try :
0 commit comments