diff options
author | Ollie <46904826+ollie-iterators@users.noreply.github.com> | 2023-03-02 13:49:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-02 19:49:28 +0100 |
commit | 5337e6280e76e13d1922b03ffeba7887a00e6356 (patch) | |
tree | 712fb303a3f03615c0a5fb224668298485803dba /pylint | |
parent | 61844d87bd03be1233a431186efe5d61ccc758c9 (diff) | |
download | pylint-git-5337e6280e76e13d1922b03ffeba7887a00e6356.tar.gz |
Changing flake8 to have max-line-length of 115 (#8362)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'pylint')
-rw-r--r-- | pylint/checkers/base/basic_checker.py | 3 | ||||
-rw-r--r-- | pylint/checkers/utils.py | 4 | ||||
-rw-r--r-- | pylint/config/arguments_provider.py | 5 | ||||
-rw-r--r-- | pylint/config/config_initialization.py | 3 | ||||
-rw-r--r-- | pylint/extensions/confusing_elif.py | 3 | ||||
-rw-r--r-- | pylint/extensions/typing.py | 3 | ||||
-rw-r--r-- | pylint/lint/run.py | 3 | ||||
-rw-r--r-- | pylint/reporters/text.py | 6 | ||||
-rw-r--r-- | pylint/testutils/_primer/primer_compare_command.py | 5 | ||||
-rw-r--r-- | pylint/testutils/lint_module_test.py | 4 |
10 files changed, 27 insertions, 12 deletions
diff --git a/pylint/checkers/base/basic_checker.py b/pylint/checkers/base/basic_checker.py index 5362416fa..2a657af77 100644 --- a/pylint/checkers/base/basic_checker.py +++ b/pylint/checkers/base/basic_checker.py @@ -212,7 +212,8 @@ class BasicChecker(_BasicChecker): "the user intended to do.", ), "W0126": ( - "Using a conditional statement with potentially wrong function or method call due to missing parentheses", + "Using a conditional statement with potentially wrong function or method call due to " + "missing parentheses", "missing-parentheses-for-call-in-test", "Emitted when a conditional statement (If or ternary if) " "seems to wrongly call a function due to missing parentheses", diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index 357cc702e..6c35dc65f 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -1812,7 +1812,9 @@ def get_import_name(importnode: ImportNode, modname: str | None) -> str | None: root = importnode.root() if isinstance(root, nodes.Module): try: - return root.relative_to_absolute_name(modname, level=importnode.level) # type: ignore[no-any-return] + return root.relative_to_absolute_name( # type: ignore[no-any-return] + modname, level=importnode.level + ) except TooManyLevelsError: return modname return modname diff --git a/pylint/config/arguments_provider.py b/pylint/config/arguments_provider.py index ea229e1c3..f5aac2f1d 100644 --- a/pylint/config/arguments_provider.py +++ b/pylint/config/arguments_provider.py @@ -64,8 +64,9 @@ class _ArgumentsProvider: def level(self, value: int) -> None: # TODO: 3.0: Remove deprecated attribute warnings.warn( - "Setting the level attribute has been deprecated. It was used to display the checker in the help or not," - " and everything is displayed in the help now. It will be removed in pylint 3.0.", + "Setting the level attribute has been deprecated. It was used to display the checker " + "in the help or not, and everything is displayed in the help now. It will be removed " + "in pylint 3.0.", DeprecationWarning, stacklevel=2, ) diff --git a/pylint/config/config_initialization.py b/pylint/config/config_initialization.py index b9ac18b4d..60d2d8fee 100644 --- a/pylint/config/config_initialization.py +++ b/pylint/config/config_initialization.py @@ -112,7 +112,8 @@ def _config_initialization( # load plugin specific configuration. linter.load_plugin_configuration() - # Now that plugins are loaded, get list of all fail_on messages, and enable them + # Now that plugins are loaded, get list of all fail_on messages, and + # enable them linter.enable_fail_on_messages() linter._parse_error_mode() diff --git a/pylint/extensions/confusing_elif.py b/pylint/extensions/confusing_elif.py index d16d6c60a..ada8b5ab1 100644 --- a/pylint/extensions/confusing_elif.py +++ b/pylint/extensions/confusing_elif.py @@ -28,7 +28,8 @@ class ConfusingConsecutiveElifChecker(BaseChecker): "confusing-consecutive-elif", "Used when an elif statement follows right after an indented block which itself ends with if or elif. " "It may not be ovious if the elif statement was willingly or mistakenly unindented. " - "Extracting the indented if statement into a separate function might avoid confusion and prevent errors.", + "Extracting the indented if statement into a separate function might avoid confusion and prevent " + "errors.", ) } diff --git a/pylint/extensions/typing.py b/pylint/extensions/typing.py index 1cf7ec10c..264d0c383 100644 --- a/pylint/extensions/typing.py +++ b/pylint/extensions/typing.py @@ -127,7 +127,8 @@ class TypingChecker(BaseChecker): "R6006": ( "Type `%s` is used more than once in union type annotation. Remove redundant typehints.", "redundant-typehint-argument", - "Duplicated type arguments will be skipped by `mypy` tool, therefore should be removed to avoid confusion.", + "Duplicated type arguments will be skipped by `mypy` tool, therefore should be " + "removed to avoid confusion.", ), } options = ( diff --git a/pylint/lint/run.py b/pylint/lint/run.py index a753f7868..2232c41a3 100644 --- a/pylint/lint/run.py +++ b/pylint/lint/run.py @@ -56,7 +56,8 @@ def _query_cpu() -> int | None: ): with open("/sys/fs/cgroup/cpu/cpu.cfs_period_us", encoding="utf-8") as file: cpu_period = int(file.read().rstrip()) - # Divide quota by period and you should get num of allotted CPU to the container, rounded down if fractional. + # Divide quota by period and you should get num of allotted CPU to the container, + # rounded down if fractional. avail_cpu = int(cpu_quota / cpu_period) elif Path("/sys/fs/cgroup/cpu/cpu.shares").is_file(): with open("/sys/fs/cgroup/cpu/cpu.shares", encoding="utf-8") as file: diff --git a/pylint/reporters/text.py b/pylint/reporters/text.py index 168bb1496..c25b31f7e 100644 --- a/pylint/reporters/text.py +++ b/pylint/reporters/text.py @@ -133,7 +133,8 @@ def colorize_ansi( # TODO: 3.0: Remove deprecated typing and only accept MessageStyle as parameter if not isinstance(msg_style, MessageStyle): warnings.warn( - "In pylint 3.0, the colorize_ansi function of Text reporters will only accept a MessageStyle parameter", + "In pylint 3.0, the colorize_ansi function of Text reporters will only accept a " + "MessageStyle parameter", DeprecationWarning, stacklevel=2, ) @@ -279,7 +280,8 @@ class ColorizedTextReporter(TextReporter): list(color_mapping.values())[0], MessageStyle ): warnings.warn( - "In pylint 3.0, the ColorizedTextReporter will only accept ColorMappingDict as color_mapping parameter", + "In pylint 3.0, the ColorizedTextReporter will only accept ColorMappingDict as " + "color_mapping parameter", DeprecationWarning, stacklevel=2, ) diff --git a/pylint/testutils/_primer/primer_compare_command.py b/pylint/testutils/_primer/primer_compare_command.py index 442ffa227..acc1c9562 100644 --- a/pylint/testutils/_primer/primer_compare_command.py +++ b/pylint/testutils/_primer/primer_compare_command.py @@ -128,7 +128,10 @@ class CompareCommand(PrimerCommand): assert not self.packages[package].url.endswith( ".git" ), "You don't need the .git at the end of the github url." - comment += f"{self.packages[package].url}/blob/{new_messages['commit']}/{filepath}#L{message['line']}\n" + comment += ( + f"{self.packages[package].url}" + f"/blob/{new_messages['commit']}/{filepath}#L{message['line']}\n" + ) count += 1 print(message) if missing_messages: diff --git a/pylint/testutils/lint_module_test.py b/pylint/testutils/lint_module_test.py index fec0074d5..e139af12b 100644 --- a/pylint/testutils/lint_module_test.py +++ b/pylint/testutils/lint_module_test.py @@ -23,7 +23,9 @@ from pylint.constants import IS_PYPY from pylint.lint import PyLinter from pylint.message.message import Message from pylint.testutils.constants import _EXPECTED_RE, _OPERATORS, UPDATE_OPTION -from pylint.testutils.functional.test_file import ( # need to import from functional.test_file to avoid cyclic import + +# need to import from functional.test_file to avoid cyclic import +from pylint.testutils.functional.test_file import ( FunctionalTestFile, NoFileError, parse_python_version, |