diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 15b0f93..7a1a1b7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.9 + rev: v0.2.1 hooks: - id: ruff - args: [--fix, --exit-non-zero-on-fix] + args: [--exit-non-zero-on-fix] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black @@ -28,23 +28,16 @@ repos: - id: mypy args: [--strict, --pretty, --show-error-codes] additional_dependencies: - [ - platformdirs, - pytest, - rapidfuzz, - types-freezegun, - types-python-slugify, - urllib3, - ] + [platformdirs, pytest, python-slugify, rapidfuzz, types-freezegun, urllib3] - repo: https://github.com/tox-dev/pyproject-fmt - rev: 1.5.3 + rev: 1.7.0 hooks: - id: pyproject-fmt additional_dependencies: [tox] - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.15 + rev: v0.16 hooks: - id: validate-pyproject diff --git a/pyproject.toml b/pyproject.toml index 5ac240e..9c58fe6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,6 +64,9 @@ version.source = "vcs" local_scheme = "no-local-version" [tool.ruff] +fix = true + +[tool.ruff.lint] select = [ "C4", # flake8-comprehensions "E", # pycodestyle errors @@ -71,12 +74,12 @@ select = [ "F", # pyflakes errors "I", # isort "ISC", # flake8-implicit-str-concat + "LOG", # flake8-logging "PGH", # pygrep-hooks "RUF100", # unused noqa (yesqa) "UP", # pyupgrade "W", # pycodestyle warnings "YTT", # flake8-2020 - # "LOG", # TODO: enable flake8-logging when it's not in preview anymore ] extend-ignore = [ "E203", # Whitespace before ':' @@ -85,7 +88,7 @@ extend-ignore = [ "E241", # Multiple spaces after ',' ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["pepotron"] required-imports = ["from __future__ import annotations"] diff --git a/src/pepotron/__init__.py b/src/pepotron/__init__.py index 0034c42..c5e398d 100644 --- a/src/pepotron/__init__.py +++ b/src/pepotron/__init__.py @@ -1,6 +1,7 @@ """ CLI to open PEPs in your browser """ + from __future__ import annotations import importlib.metadata diff --git a/src/pepotron/_cache.py b/src/pepotron/_cache.py index dbaba9c..d3ffbd8 100644 --- a/src/pepotron/_cache.py +++ b/src/pepotron/_cache.py @@ -1,6 +1,7 @@ """ Cache functions """ + from __future__ import annotations import datetime as dt diff --git a/src/pepotron/cli.py b/src/pepotron/cli.py index e6bfbc6..bbd4a5f 100644 --- a/src/pepotron/cli.py +++ b/src/pepotron/cli.py @@ -1,6 +1,7 @@ """ pepotron: CLI to open PEPs in your browser """ + from __future__ import annotations import argparse diff --git a/tests/test_cache.py b/tests/test_cache.py index 14ff6cb..446f812 100644 --- a/tests/test_cache.py +++ b/tests/test_cache.py @@ -1,6 +1,7 @@ """ Unit tests for _cache """ + from __future__ import annotations import tempfile diff --git a/tests/test_pepotron.py b/tests/test_pepotron.py index b6c67ad..c6e8f37 100644 --- a/tests/test_pepotron.py +++ b/tests/test_pepotron.py @@ -1,6 +1,7 @@ """ Unit tests """ + from __future__ import annotations from collections import namedtuple