Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
  • Loading branch information
DanielNoord and cdce8p committed Sep 16, 2021
1 parent 58d0e88 commit 0cf4b1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions pylint/lint/pylinter.py
Expand Up @@ -946,9 +946,11 @@ def check(self, files_or_modules: Union[Sequence[str], str]) -> None:
"""
self.initialize()
if not isinstance(files_or_modules, (list, tuple)):
# pylint: disable-next=fixme
# TODO: Update typing and docstring for 'files_or_modules' when removing the deprecation
warnings.warn(
"In pylint 3.0, the checkers check function will only accept sequence of string",
DeprecationWarning, # TODO: Update typing of files_or_modules to Sequence[str] # pylint: disable=fixme
DeprecationWarning,
)
files_or_modules = (files_or_modules,) # type: ignore
if self.config.from_stdin:
Expand Down Expand Up @@ -978,8 +980,9 @@ def check(self, files_or_modules: Union[Sequence[str], str]) -> None:

def check_single_file(self, name: str, filepath: str, modname: str) -> None:
warnings.warn(
"In pylint 3.0, the checkers check_single_file function will only accept a FileItem",
DeprecationWarning, # TODO: Replace check_single_file with check_single_file_item # pylint: disable=fixme
"In pylint 3.0, the checkers check_single_file function will be removed. "
"Use check_single_file_item instead.",
DeprecationWarning,
)
self.check_single_file_item(FileItem(name, filepath, modname))

Expand Down
3 changes: 2 additions & 1 deletion pylint/typing.py
Expand Up @@ -20,7 +20,8 @@ class FileItem(NamedTuple):
Each file item has:
- name: full name of the module
- filepath: path of the file
- modname: module name"""
- modname: module name
"""

name: str
filepath: str
Expand Down

0 comments on commit 0cf4b1f

Please sign in to comment.