54
54
)
55
55
from pylint .message import Message , MessageDefinition , MessageDefinitionStore
56
56
from pylint .reporters .base_reporter import BaseReporter
57
+ from pylint .reporters .progress_reporters import ProgressReporter
57
58
from pylint .reporters .text import TextReporter
58
59
from pylint .reporters .ureports import nodes as report_nodes
59
60
from pylint .typing import (
@@ -323,8 +324,7 @@ def __init__(
323
324
self .option_groups_descs [opt_group [0 ]] = opt_group [1 ]
324
325
self ._option_groups : tuple [tuple [str , str ], ...] = (
325
326
* option_groups ,
326
- ("Messages control" , "Options controlling analysis messages" ),
327
- ("Reports" , "Options related to output formatting and reporting" ),
327
+ * PyLinter .option_groups_descs .items (),
328
328
)
329
329
self .fail_on_symbols : list [str ] = []
330
330
"""List of message symbols on which pylint should fail, set by --fail-on."""
@@ -354,6 +354,7 @@ def __init__(
354
354
self .current_file : str | None = None
355
355
self ._ignore_file = False
356
356
self ._ignore_paths : list [Pattern [str ]] = []
357
+ self .verbose = False
357
358
358
359
self .register_checker (self )
359
360
@@ -685,6 +686,8 @@ def check(self, files_or_modules: Sequence[str]) -> None:
685
686
sys .path = original_sys_path
686
687
return
687
688
689
+ progress_reporter = ProgressReporter (self .verbose )
690
+
688
691
# 1) Get all FileItems
689
692
with augmented_sys_path (extra_packages_paths ):
690
693
if self .config .from_stdin :
@@ -698,18 +701,26 @@ def check(self, files_or_modules: Sequence[str]) -> None:
698
701
with augmented_sys_path (extra_packages_paths ):
699
702
with self ._astroid_module_checker () as check_astroid_module :
700
703
# 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 )
702
705
703
706
# 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
+ )
705
710
706
711
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 ,
708
716
) -> dict [FileItem , nodes .Module | None ]:
709
717
"""Get the AST for all given FileItems."""
710
718
ast_per_fileitem : dict [FileItem , nodes .Module | None ] = {}
711
719
720
+ progress_reporter .start_get_asts ()
721
+
712
722
for fileitem in fileitems :
723
+ progress_reporter .get_ast_for_file (fileitem .filepath )
713
724
self .set_current_module (fileitem .name , fileitem .filepath )
714
725
715
726
try :
@@ -743,9 +754,12 @@ def _lint_files(
743
754
self ,
744
755
ast_mapping : dict [FileItem , nodes .Module | None ],
745
756
check_astroid_module : Callable [[nodes .Module ], bool | None ],
757
+ progress_reporter : ProgressReporter ,
746
758
) -> None :
747
759
"""Lint all AST modules from a mapping.."""
760
+ progress_reporter .start_linting ()
748
761
for fileitem , module in ast_mapping .items ():
762
+ progress_reporter .lint_file (fileitem .filepath )
749
763
if module is None :
750
764
continue
751
765
try :
0 commit comments