Skip to content

Commit

Permalink
Merge pull request #88 from akaihola/pylint-3.3.0
Browse files Browse the repository at this point in the history
Update to Pylint 3.3.0+
  • Loading branch information
akaihola authored Jan 3, 2025
2 parents 3ead83b + 2c42cd6 commit 6bef099
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 9 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
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ These features will be included in the next release:

Added
-----
- Update to Pylint 3.3.0+ and adjust disabled messages accordingly.

Removed
-------
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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
3 changes: 2 additions & 1 deletion src/darkgraylib/argparse_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ 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
# pylint: disable=too-many-arguments,too-many-positional-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
6 changes: 4 additions & 2 deletions 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,too-many-positional-arguments,use-dict-literal

import os
import re
from argparse import ArgumentParser, Namespace
Expand Down Expand Up @@ -62,7 +64,7 @@ class OriginTrackingConfig(BaseConfig):


@pytest.mark.kwparametrize(
dict(), # pylint: disable=use-dict-literal
dict(),
dict(cwd="lvl1"),
dict(cwd="lvl1/lvl2"),
dict(cwd="has_git", expect={}),
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(
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
3 changes: 2 additions & 1 deletion src/darkgraylib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class TextDocument:
DEFAULT_ENCODING = "utf-8"
DEFAULT_NEWLINE = "\n"

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

0 comments on commit 6bef099

Please sign in to comment.