@@ -637,23 +637,12 @@ def _discover_files(self, files_or_modules: Sequence[str]) -> Iterator[str]:
637
637
else :
638
638
yield something
639
639
640
- def check (self , files_or_modules : Sequence [str ] | str ) -> None :
640
+ def check (self , files_or_modules : Sequence [str ]) -> None :
641
641
"""Main checking entry: check a list of files or modules from their name.
642
642
643
643
files_or_modules is either a string or list of strings presenting modules to check.
644
644
"""
645
- # 1) Initialize
646
645
self .initialize ()
647
-
648
- # 2) Gather all files
649
- if not isinstance (files_or_modules , (list , tuple )):
650
- # TODO: 3.0: Remove deprecated typing and update docstring
651
- warnings .warn (
652
- "In pylint 3.0, the checkers check function will only accept sequence of string" ,
653
- DeprecationWarning ,
654
- stacklevel = 2 ,
655
- )
656
- files_or_modules = (files_or_modules ,) # type: ignore[assignment]
657
646
if self .config .recursive :
658
647
files_or_modules = tuple (self ._discover_files (files_or_modules ))
659
648
if self .config .from_stdin :
@@ -669,7 +658,7 @@ def check(self, files_or_modules: Sequence[str] | str) -> None:
669
658
}
670
659
)
671
660
672
- # TODO: Move the parallel invocation into step 5 of the checking process
661
+ # TODO: Move the parallel invocation into step 3 of the checking process
673
662
if not self .config .from_stdin and self .config .jobs > 1 :
674
663
original_sys_path = sys .path [:]
675
664
check_parallel (
@@ -681,7 +670,7 @@ def check(self, files_or_modules: Sequence[str] | str) -> None:
681
670
sys .path = original_sys_path
682
671
return
683
672
684
- # 3 ) Get all FileItems
673
+ # 1 ) Get all FileItems
685
674
with augmented_sys_path (extra_packages_paths ):
686
675
if self .config .from_stdin :
687
676
fileitems = self ._get_file_descr_from_stdin (files_or_modules [0 ])
@@ -693,10 +682,10 @@ def check(self, files_or_modules: Sequence[str] | str) -> None:
693
682
# The contextmanager also opens all checkers and sets up the PyLinter class
694
683
with augmented_sys_path (extra_packages_paths ):
695
684
with self ._astroid_module_checker () as check_astroid_module :
696
- # 4 ) Get the AST for each FileItem
685
+ # 2 ) Get the AST for each FileItem
697
686
ast_per_fileitem = self ._get_asts (fileitems , data )
698
687
699
- # 5 ) Lint each ast
688
+ # 3 ) Lint each ast
700
689
self ._lint_files (ast_per_fileitem , check_astroid_module )
701
690
702
691
def _get_asts (
0 commit comments