Skip to content

Commit

Permalink
Changes after black update
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p authored and Pierre-Sassoulas committed Apr 26, 2021
1 parent 316af5f commit a4fac22
Show file tree
Hide file tree
Showing 28 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion pylint/checkers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def table_lines_from_stats(stats, old_stats, columns):


def initialize(linter):
"""initialize linter with checkers in this package """
"""initialize linter with checkers in this package"""
register_plugins(linter, __path__[0])


Expand Down
2 changes: 1 addition & 1 deletion pylint/checkers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ def _check_not_in_finally(self, node, node_name, breaker_classes=()):
_parent = _node.parent

def _check_reversed(self, node):
""" check that the argument to `reversed` is a sequence """
"""check that the argument to `reversed` is a sequence"""
try:
argument = utils.safe_infer(utils.get_argument_from_call(node, position=0))
except utils.NoSuchArgumentError:
Expand Down
2 changes: 1 addition & 1 deletion pylint/checkers/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2145,6 +2145,6 @@ def _ancestors_to_call(klass_node, method="__init__"):


def register(linter):
"""required method to auto register this checker """
"""required method to auto register this checker"""
linter.register_checker(ClassChecker(linter))
linter.register_checker(SpecialMethodsChecker(linter))
2 changes: 1 addition & 1 deletion pylint/checkers/design_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,5 +498,5 @@ def _inc_branch(self, node, branchesnum=1):


def register(linter):
"""required method to auto register this checker """
"""required method to auto register this checker"""
linter.register_checker(MisdesignChecker(linter))
2 changes: 1 addition & 1 deletion pylint/checkers/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,5 +796,5 @@ def check_indent_level(self, string, expected, line_num):


def register(linter):
"""required method to auto register this checker """
"""required method to auto register this checker"""
linter.register_checker(FormatChecker(linter))
2 changes: 1 addition & 1 deletion pylint/checkers/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,5 +984,5 @@ def _check_toplevel(self, node):


def register(linter):
"""required method to auto register this checker """
"""required method to auto register this checker"""
linter.register_checker(ImportsChecker(linter))
6 changes: 3 additions & 3 deletions pylint/checkers/mapreduce_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@


class MapReduceMixin(metaclass=abc.ABCMeta):
""" A mixin design to allow multiprocess/threaded runs of a Checker """
"""A mixin design to allow multiprocess/threaded runs of a Checker"""

@abc.abstractmethod
def get_map_data(self):
""" Returns mergable/reducible data that will be examined """
"""Returns mergable/reducible data that will be examined"""

@classmethod
@abc.abstractmethod
def reduce_map_data(cls, linter, data):
""" For a given Checker, receives data for all mapped runs """
"""For a given Checker, receives data for all mapped runs"""
2 changes: 1 addition & 1 deletion pylint/checkers/newstyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,5 @@ def visit_functiondef(self, node):


def register(linter):
"""required method to auto register this checker """
"""required method to auto register this checker"""
linter.register_checker(NewStyleConflictChecker(linter))
2 changes: 1 addition & 1 deletion pylint/checkers/python3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ def _validate_encoding(self, encoding, node):

@utils.check_messages("indexing-exception")
def visit_subscript(self, node):
""" Look for indexing exceptions. """
"""Look for indexing exceptions."""
try:
for inferred in node.value.infer():
if not isinstance(inferred, astroid.Instance):
Expand Down
2 changes: 1 addition & 1 deletion pylint/checkers/raw_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,5 @@ def get_type(tokens, start_index):


def register(linter):
""" required method to auto register this checker """
"""required method to auto register this checker"""
linter.register_checker(RawMetricsChecker(linter))
4 changes: 2 additions & 2 deletions pylint/checkers/similar.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def close(self):
stats["percent_duplicated_lines"] = total and duplicated * 100.0 / total

def get_map_data(self):
""" Passthru override """
"""Passthru override"""
return Similar.get_map_data(self)

@classmethod
Expand All @@ -440,7 +440,7 @@ def reduce_map_data(cls, linter, data):


def register(linter):
"""required method to auto register this checker """
"""required method to auto register this checker"""
linter.register_checker(SimilarChecker(linter))


Expand Down
2 changes: 1 addition & 1 deletion pylint/checkers/spelling.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,5 +467,5 @@ def _check_docstring(self, node):


def register(linter):
"""required method to auto register this checker """
"""required method to auto register this checker"""
linter.register_checker(SpellingChecker(linter))
2 changes: 1 addition & 1 deletion pylint/checkers/stdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,5 +512,5 @@ def deprecated_arguments(self, method: str):


def register(linter):
"""required method to auto register this checker """
"""required method to auto register this checker"""
linter.register_checker(StdlibChecker(linter))
4 changes: 2 additions & 2 deletions pylint/checkers/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def _detect_vacuous_formatting(self, node, positional_arguments):
)

def _check_new_format(self, node, func):
"""Check the new string formatting. """
"""Check the new string formatting."""
# Skip format nodes which don't have an explicit string on the
# left side of the format operation.
# We do this because our inference engine can't properly handle
Expand Down Expand Up @@ -888,7 +888,7 @@ def process_non_raw_string_token(


def register(linter):
"""required method to auto register this checker """
"""required method to auto register this checker"""
linter.register_checker(StringFormatChecker(linter))
linter.register_checker(StringConstantChecker(linter))

Expand Down
2 changes: 1 addition & 1 deletion pylint/checkers/typecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -1950,6 +1950,6 @@ def visit_generatorexp(self, node):


def register(linter):
"""required method to auto register this checker """
"""required method to auto register this checker"""
linter.register_checker(TypeChecker(linter))
linter.register_checker(IterableChecker(linter))
2 changes: 1 addition & 1 deletion pylint/checkers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ def stringify_error(error):


def decorated_with_property(node: astroid.FunctionDef) -> bool:
"""Detect if the given function node is decorated with a property. """
"""Detect if the given function node is decorated with a property."""
if not node.decorators:
return False
for decorator in node.decorators.nodes:
Expand Down
2 changes: 1 addition & 1 deletion pylint/checkers/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2081,7 +2081,7 @@ def _check_imports(self, not_consumed):
del self._to_consume

def _check_metaclasses(self, node):
""" Update consumption analysis for metaclasses. """
"""Update consumption analysis for metaclasses."""
consumed = [] # [(scope_locals, consumed_key)]

for child_node in node.get_children():
Expand Down
4 changes: 2 additions & 2 deletions pylint/config/option_manager_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def load_command_line_configuration(self, args=None):
return args

def add_help_section(self, title, description, level=0):
"""add a dummy option section for help purpose """
"""add a dummy option section for help purpose"""
group = optparse.OptionGroup(
self.cmdline_parser, title=title.capitalize(), description=description
)
Expand All @@ -356,7 +356,7 @@ def add_help_section(self, title, description, level=0):
self.cmdline_parser.add_option_group(group)

def help(self, level=0):
"""return the usage string for available options """
"""return the usage string for available options"""
self.cmdline_parser.formatter.output_level = level
with _patch_optparse():
return self.cmdline_parser.format_help()
Expand Down
4 changes: 2 additions & 2 deletions pylint/extensions/empty_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


def is_line_commented(line):
""" Checks if a `# symbol that is not part of a string was found in line"""
"""Checks if a `# symbol that is not part of a string was found in line"""

comment_idx = line.find(b"#")
if comment_idx == -1:
Expand All @@ -14,7 +14,7 @@ def is_line_commented(line):


def comment_part_of_string(line, comment_idx):
""" checks if the symbol at comment_idx is part of a string """
"""checks if the symbol at comment_idx is part of a string"""

if (
line[:comment_idx].count(b"'") % 2 == 1
Expand Down
2 changes: 1 addition & 1 deletion pylint/lint/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _worker_check_single_file(file_item):


def _merge_mapreduce_data(linter, all_mapreduce_data):
""" Merges map/reduce data across workers, invoking relevant APIs on checkers """
"""Merges map/reduce data across workers, invoking relevant APIs on checkers"""
# First collate the data, preparing it so we can send it to the checkers for
# validation. The intent here is to collect all the mapreduce data for all checker-
# runs across processes - that will then be passed to a static method on the
Expand Down
4 changes: 2 additions & 2 deletions pylint/message/message_definition_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_message_definitions(self, msgid_or_symbol: str) -> list:
]

def get_msg_display_string(self, msgid_or_symbol: str):
"""Generates a user-consumable representation of a message. """
"""Generates a user-consumable representation of a message."""
message_definitions = self.get_message_definitions(msgid_or_symbol)
if len(message_definitions) == 1:
return repr(message_definitions[0].symbol)
Expand All @@ -79,7 +79,7 @@ def help_message(self, msgids_or_symbols: list):
continue

def list_messages(self):
"""Output full messages list documentation in ReST format. """
"""Output full messages list documentation in ReST format."""
messages = sorted(self._messages_definitions.values(), key=lambda m: m.msgid)
for message in messages:
if not message.may_be_emitted():
Expand Down
2 changes: 1 addition & 1 deletion pylint/reporters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


def initialize(linter):
"""initialize linter with reporters in this package """
"""initialize linter with reporters in this package"""
utils.register_plugins(linter, __path__[0])


Expand Down
2 changes: 1 addition & 1 deletion pylint/testutils/reporter_for_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def reset(self):
self.messages = []

def handle_message(self, msg):
"""manage message of different type and in the context of path """
"""manage message of different type and in the context of path"""
obj = msg.obj
line = msg.line
msg_id = msg.msg_id
Expand Down
4 changes: 2 additions & 2 deletions tests/benchmark/test_baseline_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def process_module(self, _astroid):


class NoWorkChecker(BaseChecker):
""" A checker that sleeps, the wall-clock time should change as we add threads """
"""A checker that sleeps, the wall-clock time should change as we add threads"""

__implements__ = (pylint.interfaces.IRawChecker,)

Expand Down Expand Up @@ -159,7 +159,7 @@ def test_baseline_benchmark_j10(self, benchmark):
)

def test_baseline_benchmark_check_parallel_j10(self, benchmark):
""" Should demonstrate times very close to `test_baseline_benchmark_j10` """
"""Should demonstrate times very close to `test_baseline_benchmark_j10`"""
linter = PyLinter(reporter=Reporter())

# Create file per worker, using all workers
Expand Down
4 changes: 2 additions & 2 deletions tests/checkers/unittest_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TestVariablesChecker(CheckerTestCase):
CHECKER_CLASS = variables.VariablesChecker

def test_bitbucket_issue_78(self):
""" Issue 78 report a false positive for unused-module """
"""Issue 78 report a false positive for unused-module"""
module = astroid.parse(
"""
from sys import path
Expand Down Expand Up @@ -205,7 +205,7 @@ def teardown_method(self):

@set_config(callbacks=("callback_", "_callback"))
def test_custom_callback_string(self):
""" Test the --calbacks option works. """
"""Test the --calbacks option works."""
node = astroid.extract_node(
"""
def callback_one(abc):
Expand Down
2 changes: 1 addition & 1 deletion tests/message/unittest_message_definition_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def test_renamed_message_register(store):


def test_multiple_child_of_old_name(store):
""" We can define multiple name with the same old name. """
"""We can define multiple name with the same old name."""

class FamillyChecker(BaseChecker):
name = "famillychecker"
Expand Down
2 changes: 1 addition & 1 deletion tests/profile/test_profile_against_externals.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _get_py_files(scanpath):
"name,git_repo", [("numpy", "https://github.com/numpy/numpy.git")]
)
def test_run(tmp_path, name, git_repo):
""" Runs pylint against external sources """
"""Runs pylint against external sources"""
checkoutdir = tmp_path / name
checkoutdir.mkdir()
os.system(f"git clone --depth=1 {git_repo} {checkoutdir}")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_self.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def test_parallel_execution(self):
)

def test_parallel_execution_bug_2674(self):
""" Tests that disabling absolute imports works the same in -j1/j2 """
"""Tests that disabling absolute imports works the same in -j1/j2"""
expected_ret_code = 0 # we are disabling the check, should pass
for jobs in (1, 2):
self._runtest(
Expand Down

0 comments on commit a4fac22

Please sign in to comment.