summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOllie <46904826+ollie-iterators@users.noreply.github.com>2023-03-02 13:49:28 -0500
committerGitHub <noreply@github.com>2023-03-02 19:49:28 +0100
commit5337e6280e76e13d1922b03ffeba7887a00e6356 (patch)
tree712fb303a3f03615c0a5fb224668298485803dba
parent61844d87bd03be1233a431186efe5d61ccc758c9 (diff)
downloadpylint-git-5337e6280e76e13d1922b03ffeba7887a00e6356.tar.gz
Changing flake8 to have max-line-length of 115 (#8362)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
-rw-r--r--examples/deprecation_checker.py6
-rw-r--r--pylint/checkers/base/basic_checker.py3
-rw-r--r--pylint/checkers/utils.py4
-rw-r--r--pylint/config/arguments_provider.py5
-rw-r--r--pylint/config/config_initialization.py3
-rw-r--r--pylint/extensions/confusing_elif.py3
-rw-r--r--pylint/extensions/typing.py3
-rw-r--r--pylint/lint/run.py3
-rw-r--r--pylint/reporters/text.py6
-rw-r--r--pylint/testutils/_primer/primer_compare_command.py5
-rw-r--r--pylint/testutils/lint_module_test.py4
-rw-r--r--setup.cfg2
-rw-r--r--tests/message/unittest_message_definition_store.py3
13 files changed, 33 insertions, 17 deletions
diff --git a/examples/deprecation_checker.py b/examples/deprecation_checker.py
index 6fb21eedd..228b7bdad 100644
--- a/examples/deprecation_checker.py
+++ b/examples/deprecation_checker.py
@@ -52,9 +52,9 @@ class DeprecationChecker(DeprecatedMixin, BaseChecker):
"""Class implementing deprecation checker."""
# DeprecatedMixin class is Mixin class implementing logic for searching deprecated methods and functions.
- # The list of deprecated methods/functions is defined by the implementing class via deprecated_methods callback.
- # DeprecatedMixin class is overriding attributes of BaseChecker hence must be specified *before* BaseChecker
- # in list of base classes.
+ # The list of deprecated methods/functions is defined by the implementing class via
+ # deprecated_methods callback. DeprecatedMixin class is overriding attributes of BaseChecker hence must
+ # be specified *before* BaseChecker in list of base classes.
# The name defines a custom section of the config for this checker.
name = "deprecated"
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,
diff --git a/setup.cfg b/setup.cfg
index 80fced5a2..1f188de83 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -19,7 +19,7 @@ ignore =
B028,
# Flake8 is less lenient than pylint and does not make any exceptions
# (for docstrings, strings and comments in particular).
-max-line-length=120
+max-line-length=115
# Required for flake8-typing-imports (v1.12.0)
# The plugin doesn't yet read the value from pyproject.toml
min_python_version = 3.7.2
diff --git a/tests/message/unittest_message_definition_store.py b/tests/message/unittest_message_definition_store.py
index d36b1b42a..eb323a2e6 100644
--- a/tests/message/unittest_message_definition_store.py
+++ b/tests/message/unittest_message_definition_store.py
@@ -26,7 +26,8 @@ from pylint.typing import MessageDefinitionTuple
"W1234": ("message one", "msg-symbol-one", "msg description"),
"W4321": ("message two", "msg-symbol-two", "msg description"),
},
- r"Inconsistent checker part in message id 'W4321' (expected 'x12xx' because we already had ['W1234']).",
+ r"Inconsistent checker part in message id 'W4321' (expected 'x12xx' because we"
+ r" already had ['W1234']).",
),
(
{