diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3aa308b..7bc39d4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ exclude: | repos: - repo: https://github.com/pycontribs/mirrors-prettier # keep it before yamllint - rev: v3.3.2 + rev: v3.6.2 hooks: - id: prettier always_run: true @@ -15,7 +15,7 @@ repos: - prettier-plugin-toml - prettier-plugin-sort-json - repo: https://github.com/pre-commit/pre-commit-hooks.git - rev: v4.6.0 + rev: v6.0.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -26,24 +26,24 @@ repos: - id: debug-statements language_version: python3 - repo: https://github.com/adrienverge/yamllint.git - rev: v1.35.1 + rev: v1.38.0 hooks: - id: yamllint files: \.(yaml|yml)$ types: [file, yaml] entry: yamllint --strict - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.10" + rev: "v0.16.8" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - - repo: https://github.com/psf/black - rev: 24.4.2 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.5.1 hooks: - id: black language_version: python3 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.0 + rev: v2.3.1 hooks: - id: mypy # empty args needed in order to match mypy cli behavior @@ -54,7 +54,7 @@ repos: - packaging - rich>=11.0.0 - repo: https://github.com/pycqa/pylint - rev: v3.2.3 + rev: v4.0.8 hooks: - id: pylint # see https://github.com/PyCQA/pylint/issues/6535 diff --git a/src/enrich/logging.py b/src/enrich/logging.py index 0060d26..76a094d 100644 --- a/src/enrich/logging.py +++ b/src/enrich/logging.py @@ -19,7 +19,7 @@ class FluidLogRender: # pylint: disable=too-few-public-methods """Renders log by not using columns and avoiding any wrapping.""" # pylint: disable=too-many-arguments - def __init__( # noqa: PLR0913 + def __init__( self, show_time: bool = False, show_level: bool = False, diff --git a/test/test_console.py b/test/test_console.py index 43d8ad3..4184c43 100644 --- a/test/test_console.py +++ b/test/test_console.py @@ -4,9 +4,10 @@ import sys import pytest -from enrich.console import Console, should_do_markup from pytest_mock import MockFixture # pylint: disable=wrong-import-order +from enrich.console import Console, should_do_markup + def test_rich_console_ex() -> None: """Validate that ConsoleEx can capture output from print() calls.""" diff --git a/test/test_logging.py b/test/test_logging.py index e089c55..be48980 100644 --- a/test/test_logging.py +++ b/test/test_logging.py @@ -7,6 +7,7 @@ import re import pytest + from enrich.console import Console from enrich.logging import RichHandler @@ -50,7 +51,7 @@ def rich_logger_fixture() -> tuple[logging.Logger, RichHandler]: def test_logging(rich_logger: tuple[logging.Logger, RichHandler]) -> None: """Test that logger does not wrap.""" - (logger, rich_handler) = rich_logger + logger, rich_handler = rich_logger text = 10 * "x" # a long text that would likely wrap on a normal console logger.error("%s %s", text, 123)