Skip to content

Commit 0a042a8

Browse files
Fix some typoes before adding typing for checker registering
1 parent 10798c9 commit 0a042a8

File tree

5 files changed

+14
-22
lines changed

5 files changed

+14
-22
lines changed

examples/custom.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# This is our checker class.
88
# Checkers should always inherit from `BaseChecker`.
99
class MyAstroidChecker(BaseChecker):
10-
"""Add class member attributes to the class locals dictionary."""
10+
"""Add class member attributes to the class local's dictionary."""
1111

1212
# This class variable defines the type of checker that we are implementing.
1313
# In this case, we are implementing an AST checker.
@@ -31,8 +31,7 @@ class MyAstroidChecker(BaseChecker):
3131
options = (
3232
# Each option definition has a name which is used on the command line
3333
# and in config files, and a dictionary of arguments
34-
# (similar to those to those to
35-
# argparse.ArgumentParser.add_argument).
34+
# (similar to argparse.ArgumentParser.add_argument).
3635
(
3736
"store-locals-indicator",
3837
{
@@ -48,10 +47,7 @@ class MyAstroidChecker(BaseChecker):
4847
def visit_call(self, node: nodes.Call) -> None:
4948
"""Called when a :class:`.nodes.Call` node is visited.
5049
51-
See :mod:`astroid` for the description of available nodes.
52-
53-
:param node: The node to check.
54-
"""
50+
See :mod:`astroid` for the description of available nodes."""
5551
if not (
5652
isinstance(node.func, nodes.Attribute)
5753
and isinstance(node.func.expr, nodes.Name)

pylint/checkers/classes/special_methods_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def _safe_infer_call_result(node, caller, context=None):
2525
Safely infer the return value of a function.
2626
2727
Returns None if inference failed or if there is some ambiguity (more than
28-
one node has been inferred). Otherwise returns inferred value.
28+
one node has been inferred). Otherwise, returns inferred value.
2929
"""
3030
try:
3131
inferit = node.infer_call_result(caller, context=context)

pylint/checkers/refactoring/implicit_booleaness_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def _check_use_implicit_booleaness_not_comparison(
149149
node.left
150150
) or utils.is_empty_dict_literal(node.left)
151151

152-
# Check both left hand side and right hand side for literals
152+
# Check both left-hand side and right-hand side for literals
153153
for operator, comparator in node.ops:
154154
is_right_empty_literal = utils.is_base_container(
155155
comparator

pylint/interfaces.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,15 @@ def implements(
6464
obj: "BaseChecker",
6565
interface: Union[Type["Interface"], Tuple[Type["Interface"], ...]],
6666
) -> bool:
67-
"""Return whether the given object (maybe an instance or class) implements
68-
the interface.
69-
"""
67+
"""Does the given object (maybe an instance or class) implements the interface."""
7068
kimplements = getattr(obj, "__implements__", ())
7169
if not isinstance(kimplements, (list, tuple)):
7270
kimplements = (kimplements,)
7371
return any(issubclass(i, interface) for i in kimplements)
7472

7573

7674
class IChecker(Interface):
77-
"""This is a base interface, not designed to be used elsewhere than for
78-
sub interfaces definition.
79-
"""
75+
"""Base interface, not to be used elsewhere than for sub interfaces definition."""
8076

8177
def open(self):
8278
"""called before visiting project (i.e. set of modules)"""
@@ -86,12 +82,12 @@ def close(self):
8682

8783

8884
class IRawChecker(IChecker):
89-
"""interface for checker which need to parse the raw file"""
85+
"""Interface for checker which need to parse the raw file"""
9086

9187
def process_module(self, node: nodes.Module) -> None:
9288
"""process a module
9389
94-
the module's content is accessible via ``astroid.stream``
90+
The module's content is accessible via ``astroid.stream``
9591
"""
9692

9793

@@ -101,7 +97,7 @@ class ITokenChecker(IChecker):
10197
def process_tokens(self, tokens):
10298
"""Process a module.
10399
104-
tokens is a list of all source code tokens in the file.
100+
Tokens is a list of all source code tokens in the file.
105101
"""
106102

107103

tests/test_check_parallel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class ParallelTestChecker(BaseChecker, MapReduceMixin):
8282
8383
On non-parallel builds: it works on all the files in a single run.
8484
85-
On parallel builds: lint.parallel calls ``open`` once per file.
85+
On parallel builds: ``lint.parallel`` calls ``open`` once per file.
8686
8787
So if files are treated by separate processes, no messages will be
8888
raised from the individual process, all messages will be raised
@@ -274,7 +274,7 @@ def test_sequential_checkers_work(self) -> None:
274274
"""Tests original basic types of checker works as expected in -jN
275275
276276
This means that a sequential checker should return the same data for a given
277-
file-stream irrespective of whether its run in -j1 or -jN
277+
file-stream irrespective of whether it's run in -j1 or -jN
278278
"""
279279
linter = PyLinter(reporter=Reporter())
280280

@@ -443,7 +443,7 @@ def test_compare_workers_to_single_proc(self, num_files, num_jobs, num_checkers)
443443

444444
file_infos = _gen_file_datas(num_files)
445445

446-
# Loop for single-proc and mult-proc so we can ensure the same linter-config
446+
# Loop for single-proc and mult-proc, so we can ensure the same linter-config
447447
for do_single_proc in range(2):
448448
linter = PyLinter(reporter=Reporter())
449449

@@ -515,7 +515,7 @@ def test_map_reduce(self, num_files, num_jobs, num_checkers):
515515
# with the number of files.
516516
file_infos = _gen_file_datas(num_files)
517517

518-
# Loop for single-proc and mult-proc so we can ensure the same linter-config
518+
# Loop for single-proc and mult-proc, so we can ensure the same linter-config
519519
for do_single_proc in range(2):
520520
linter = PyLinter(reporter=Reporter())
521521

0 commit comments

Comments
 (0)