From 316fc0dcbb37d8072df82aaa90048f5ad43e4ce3 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 Apr 2021 17:30:44 +0000 Subject: fixing comments to break into multiple lines --- pylint/checkers/spelling.py | 2 +- tests/checkers/unittest_spelling.py | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pylint/checkers/spelling.py b/pylint/checkers/spelling.py index a1a9f6825..41e53afbe 100644 --- a/pylint/checkers/spelling.py +++ b/pylint/checkers/spelling.py @@ -278,7 +278,7 @@ class SpellingChecker(BaseTokenChecker): "default": "fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:", "type": "string", "metavar": "", - "help": "List of comma separated words that should not be considered directives if they appear and the beginning of a comment and should not be checked.", + "help": "List of comma separated words that should be considered directives if they appear and the beginning of a comment and should not be checked.", }, ), ) diff --git a/tests/checkers/unittest_spelling.py b/tests/checkers/unittest_spelling.py index d5011dba0..2d48670cb 100644 --- a/tests/checkers/unittest_spelling.py +++ b/tests/checkers/unittest_spelling.py @@ -37,9 +37,9 @@ if enchant is not None: pass -class TestSpellingChecker( - CheckerTestCase -): # pylint:disable=too-many-public-methods # This is a test case class, not sure why it would be relevant to have this pylint rule enforced for test case classes +class TestSpellingChecker(CheckerTestCase): # pylint:disable=too-many-public-methods + # This is a test case class, not sure why it would be relevant to have + # this pylint rule enforced for test case classes. CHECKER_CLASS = spelling.SpellingChecker skip_on_missing_package_or_dict = pytest.mark.skipif( @@ -325,8 +325,14 @@ class TestSpellingChecker( ("mypy", ":", "mypy directive"), ), ) - def test_skip_tool_directives_at_beginning_of_comments_but_still_raise_error_if_directive_appears_later_in_comment( # pylint:disable=unused-argument # Having the extra description parameter allows the description to show up in the pytest output as part of the test name when running parametrized tests - self, misspelled_portion_of_directive, second_portion_of_directive, description + def test_skip_tool_directives_at_beginning_of_comments_but_still_raise_error_if_directive_appears_later_in_comment( # pylint:disable=unused-argument + # Having the extra description parameter allows the description + # to show up in the pytest output as part of the test name + # when running parametrized tests. + self, + misspelled_portion_of_directive, + second_portion_of_directive, + description, ): full_comment = f"# {misspelled_portion_of_directive}{second_portion_of_directive} {misspelled_portion_of_directive}" with self.assertAddsMessages( -- cgit v1.2.1