Skip to content

Commit

Permalink
chore: silence pylint messages
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Jan 3, 2025
1 parent 7b9afd4 commit 26b2b72
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
pip install -U \
defusedxml \
pygments \
"pylint<3.3.0" \
"pylint>=3.3.0" \
"pytest>=6.2.0" \
requests \
requests-cache \
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test =
mypy
Pygments>=2.4.0
pydocstyle
pylint<3.3.0
pylint>=3.3.0
pytest>=6.2.0
pytest-kwparametrize>=0.0.3
requests_cache>=0.7
Expand Down
4 changes: 3 additions & 1 deletion src/darkgraylib/argparse_helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Custom formatter and action for argparse."""

# pylint: disable=too-many-arguments,too-many-positional-arguments

import logging
import re
import sys
Expand Down Expand Up @@ -194,7 +196,7 @@ def generate_options_for_readme(parser: ArgumentParser) -> str:
class LogLevelAction(Action): # pylint: disable=too-few-public-methods
"""Support for command line actions which increment/decrement the log level"""

def __init__( # pylint: disable=too-many-arguments
def __init__(
self,
option_strings: List[str],
dest: str,
Expand Down
5 changes: 4 additions & 1 deletion src/darkgraylib/tests/test_command_line.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""Unit tests for `darkgraylib.command_line` and `darkgraylib.main`."""

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

import os
from pathlib import Path
from unittest.mock import Mock, patch
Expand Down Expand Up @@ -350,7 +353,7 @@ def test_parse_command_line(
def test_parse_command_line_load_config_hook_called(tmp_path, monkeypatch):
"""The load configuration hook is called correctly."""
monkeypatch.chdir(tmp_path)
with Path("pyproject.toml").open("w") as pyproject:
with Path("pyproject.toml").open("w", encoding="utf-8") as pyproject:
toml.dump({"tool": {"darkgraylib": {"revision": "main"}}}, pyproject)
hook_mock = Mock()

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

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

import os
import re
from argparse import ArgumentParser, Namespace
Expand Down Expand Up @@ -352,7 +354,7 @@ class OriginTrackingConfig(BaseConfig):
confpath=None,
expect={"config": "no_pyp"},
)
def test_load_config_path( # pylint: disable=too-many-arguments
def test_load_config_path( # pylint: disable=too-many-positional-arguments
tmp_path, monkeypatch, srcs, cwd, confpath, expect
):
"""``load_config()`` finds and loads configuration based on source file paths"""
Expand Down
2 changes: 2 additions & 0 deletions src/darkgraylib/tests/test_diff.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Unit tests for `darkgraylib.diff`"""

# pylint: disable=use-dict-literal

import pytest

from darkgraylib.diff import diff_and_get_opcodes, map_unmodified_lines
Expand Down
2 changes: 2 additions & 0 deletions src/darkgraylib/tests/test_files.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Tests for the `darkgraylib.files` module."""

# pylint: disable=redefined-outer-name

import os
from contextlib import contextmanager
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/darkgraylib/tests/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# pylint: disable=no-member # context managers misfire Pylint's member-checking
# pylint: disable=redefined-outer-name # fixtures misfire Pylint's redefinition checks
# pylint: disable=use-dict-literal # dict() ok with kwparametrize
# pylint: disable=too-many-arguments,too-many-positional-arguments

import os
import re
Expand Down
4 changes: 2 additions & 2 deletions src/darkgraylib/tests/test_highlighting.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unit tests for :mod:`darkgraylib.highlighting`"""

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

import os
import sys
Expand Down
2 changes: 2 additions & 0 deletions src/darkgraylib/tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Unit tests for the `darkgraylib.main` module."""

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

import sys
from pathlib import Path

Expand Down
3 changes: 3 additions & 0 deletions src/darkgraylib/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Unit tests for `darkgraylib.utils`."""

# pylint: disable=redefined-outer-name,use-dict-literal

import os
from pathlib import Path

Expand All @@ -25,6 +27,7 @@ def textdocument_factory(request):
which it creates a temporary file) and the ``TextDocument.from_bytes()``
classmethods.
"""
# pylint: disable=comparison-with-callable
if request.param == TextDocument.from_file:

def factory(content):
Expand Down
4 changes: 3 additions & 1 deletion src/darkgraylib/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Miscellaneous utility functions"""

# pylint: disable=too-many-arguments,too-many-positional-arguments

import io
import sys
import tokenize
Expand Down Expand Up @@ -44,7 +46,7 @@ class TextDocument:
DEFAULT_ENCODING = "utf-8"
DEFAULT_NEWLINE = "\n"

def __init__( # pylint: disable=too-many-arguments
def __init__(
self,
string: str = None,
lines: Iterable[str] = None,
Expand Down

0 comments on commit 26b2b72

Please sign in to comment.