Skip to content

Commit

Permalink
style: avoid long lines with pylint ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Oct 8, 2024
1 parent 3d91686 commit e474155
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 13 deletions.
6 changes: 4 additions & 2 deletions src/darker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
ProcessedDocument = Tuple[Path, TextDocument, TextDocument]


def format_edited_parts( # pylint: disable=too-many-arguments,too-many-positional-arguments # noqa: PLR0913
def format_edited_parts( # noqa: PLR0913
root: Path,
changed_files: Collection[Path], # pylint: disable=unsubscriptable-object
exclude: Exclusions,
Expand All @@ -68,6 +68,7 @@ def format_edited_parts( # pylint: disable=too-many-arguments,too-many-position
report_unmodified: bool,
workers: int = 1,
) -> Generator[ProcessedDocument, None, None]:
# pylint: disable=too-many-arguments,too-many-positional-arguments

Check failure on line 71 in src/darker/__main__.py

View workflow job for this annotation

GitHub Actions / Pylint

src/darker/__main__.py#L71

Unknown option value for 'disable', expected a valid pylint message and got 'too-many-positional-arguments' (unknown-option-value, W0012)
"""Black (and optional isort and flynt) formatting modified chunks in a set of files
Files inside given directories and excluded by Black's configuration are not
Expand Down Expand Up @@ -114,14 +115,15 @@ def format_edited_parts( # pylint: disable=too-many-arguments,too-many-position
yield (absolute_path_in_rev2, rev2_content, content_after_reformatting)


def _modify_and_reformat_single_file( # pylint: disable=too-many-arguments,too-many-positional-arguments # noqa: PLR0913
def _modify_and_reformat_single_file( # noqa: PLR0913
root: Path,
relative_path_in_rev2: Path,
edited_linenums_differ: EditedLinenumsDiffer,
exclude: Exclusions,
revrange: RevisionRange,
black_config: BlackConfig,
) -> ProcessedDocument:
# pylint: disable=too-many-arguments,too-many-positional-arguments

Check failure on line 126 in src/darker/__main__.py

View workflow job for this annotation

GitHub Actions / Pylint

src/darker/__main__.py#L126

Unknown option value for 'disable', expected a valid pylint message and got 'too-many-positional-arguments' (unknown-option-value, W0012)
"""Black, isort and/or flynt formatting for modified chunks in a single file
:param root: Root directory for the relative path
Expand Down
3 changes: 2 additions & 1 deletion src/darker/import_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ class IsortArgs(TypedDict, total=False):
settings_path: str


def apply_isort( # pylint: disable=too-many-arguments,too-many-positional-arguments # noqa: PLR0913
def apply_isort( # noqa: PLR0913
content: TextDocument,
src: Path,
exclude: Collection[str],
edited_linenums_differ: EditedLinenumsDiffer,
config: Optional[str] = None,
line_length: Optional[int] = None,
) -> TextDocument:
# pylint: disable=too-many-arguments,too-many-positional-arguments

Check failure on line 62 in src/darker/import_sorting.py

View workflow job for this annotation

GitHub Actions / Pylint

src/darker/import_sorting.py#L62

Unknown option value for 'disable', expected a valid pylint message and got 'too-many-positional-arguments' (unknown-option-value, W0012)
"""Run isort on the given Python source file content
:param content: The contents of the Python source code file to sort imports in
Expand Down
3 changes: 2 additions & 1 deletion src/darker/tests/test_black_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ def test_read_black_config(tmpdir, config_path, config_lines, expect):
extend_exclude=None,
force_exclude=None,
)
def test_filter_python_files( # pylint: disable=too-many-arguments,too-many-positional-arguments
def test_filter_python_files(
tmp_path, monkeypatch, exclude, extend_exclude, force_exclude, expect
):
# pylint: disable=too-many-arguments,too-many-positional-arguments

Check failure on line 158 in src/darker/tests/test_black_diff.py

View workflow job for this annotation

GitHub Actions / Pylint

src/darker/tests/test_black_diff.py#L158

Unknown option value for 'disable', expected a valid pylint message and got 'too-many-positional-arguments' (unknown-option-value, W0012)
"""``filter_python_files()`` skips excluded files correctly"""
monkeypatch.chdir(tmp_path)
names = {
Expand Down
3 changes: 2 additions & 1 deletion src/darker/tests/test_command_line.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# pylint: disable=too-many-arguments,too-many-positional-arguments,too-many-locals,use-dict-literal
# pylint: disable=too-many-arguments,too-many-positional-arguments,too-many-locals

Check failure on line 1 in src/darker/tests/test_command_line.py

View workflow job for this annotation

GitHub Actions / Pylint

src/darker/tests/test_command_line.py#L1

Unknown option value for 'disable', expected a valid pylint message and got 'too-many-positional-arguments' (unknown-option-value, W0012)
# pylint: disable=use-dict-literal

"""Unit tests for :mod:`darker.command_line` and :mod:`darker.__main__`"""

Expand Down
3 changes: 2 additions & 1 deletion src/darker/tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for `darker.config`"""

# pylint: disable=unused-argument,too-many-arguments,too-many-positional-arguments,use-dict-literal
# pylint: disable=unused-argument,too-many-arguments,too-many-positional-arguments

Check failure on line 3 in src/darker/tests/test_config.py

View workflow job for this annotation

GitHub Actions / Pylint

src/darker/tests/test_config.py#L3

Unknown option value for 'disable', expected a valid pylint message and got 'too-many-positional-arguments' (unknown-option-value, W0012)
# pylint: disable=use-dict-literal

from argparse import Namespace
from pathlib import Path
Expand Down
3 changes: 2 additions & 1 deletion src/darker/tests/test_fstring.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for :mod:`darker.fstring`"""

# pylint: disable=unused-argument,protected-access,too-many-arguments,too-many-positional-arguments
# pylint: disable=protected-access
# pylint: disable=too-many-arguments,too-many-positional-arguments,unused-argument

Check failure on line 4 in src/darker/tests/test_fstring.py

View workflow job for this annotation

GitHub Actions / Pylint

src/darker/tests/test_fstring.py#L4

Unknown option value for 'disable', expected a valid pylint message and got 'too-many-positional-arguments' (unknown-option-value, W0012)

from importlib import reload
from pathlib import Path
Expand Down
4 changes: 2 additions & 2 deletions src/darker/tests/test_git.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unit tests for :mod:`darker.git`"""

# pylint: disable=protected-access,redefined-outer-name,too-many-arguments,too-many-positional-arguments
# pylint: disable=too-many-lines,use-dict-literal
# pylint: disable=protected-access,redefined-outer-name,use-dict-literal
# pylint: disable=too-many-arguments,too-many-positional-arguments,too-many-lines

Check failure on line 4 in src/darker/tests/test_git.py

View workflow job for this annotation

GitHub Actions / Pylint

src/darker/tests/test_git.py#L4

Unknown option value for 'disable', expected a valid pylint message and got 'too-many-positional-arguments' (unknown-option-value, W0012)

import os
from pathlib import Path
Expand Down
3 changes: 2 additions & 1 deletion src/darker/tests/test_import_sorting.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for :mod:`darker.import_sorting`"""

# pylint: disable=unused-argument,protected-access,too-many-arguments,too-many-positional-arguments,use-dict-literal
# pylint: disable=protected-access,use-dict-literal
# pylint: disable=too-many-arguments,too-many-positional-arguments,unused-argument

Check failure on line 4 in src/darker/tests/test_import_sorting.py

View workflow job for this annotation

GitHub Actions / Pylint

src/darker/tests/test_import_sorting.py#L4

Unknown option value for 'disable', expected a valid pylint message and got 'too-many-positional-arguments' (unknown-option-value, W0012)

from importlib import reload
from pathlib import Path
Expand Down
6 changes: 3 additions & 3 deletions src/darker/tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Unit tests for :mod:`darker.__main__`"""

# pylint: disable=too-many-locals,use-implicit-booleaness-not-comparison,unused-argument
# pylint: disable=protected-access,redefined-outer-name,too-many-arguments,too-many-positional-arguments
# pylint: disable=use-dict-literal
# pylint: disable=too-many-locals,use-implicit-booleaness-not-comparison
# pylint: disable=protected-access,redefined-outer-name,use-dict-literal,
# pylint: disable=too-many-arguments,too-many-positional-arguments,unused-argument

Check failure on line 5 in src/darker/tests/test_main.py

View workflow job for this annotation

GitHub Actions / Pylint

src/darker/tests/test_main.py#L5

Unknown option value for 'disable', expected a valid pylint message and got 'too-many-positional-arguments' (unknown-option-value, W0012)

import random
import re
Expand Down

0 comments on commit e474155

Please sign in to comment.