diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 16e158c..3d57d48 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: # ruff - python linter with fixing ability - repo: https://github.com/astral-sh/ruff-pre-commit - rev: cc575a3e5800b42ffbb5182b53d87203b2c4fc26 # frozen: v0.2.2 + rev: cc575a3e5800b42ffbb5182b53d87203b2c4fc26 # frozen: v0.2.2 hooks: - id: ruff name: ruff (fix) @@ -50,7 +50,7 @@ repos: # black - python formatter - repo: https://github.com/psf/black - rev: 6fdf8a4af28071ed1d079c01122b34c5d587207a # frozen: 24.2.0 + rev: 6fdf8a4af28071ed1d079c01122b34c5d587207a # frozen: 24.2.0 hooks: - id: black args: ["--safe"] @@ -142,7 +142,7 @@ repos: # ruff - python linter with fixing ability - repo: https://github.com/astral-sh/ruff-pre-commit - rev: cc575a3e5800b42ffbb5182b53d87203b2c4fc26 # frozen: v0.2.2 + rev: cc575a3e5800b42ffbb5182b53d87203b2c4fc26 # frozen: v0.2.2 hooks: - id: ruff name: ruff (lint) @@ -228,6 +228,6 @@ repos: # yamllint - yaml linter - repo: https://github.com/adrienverge/yamllint - rev: 81e9f98ffd059efe8aa9c1b1a42e5cce61b640c6 # frozen: v1.35.1 + rev: 81e9f98ffd059efe8aa9c1b1a42e5cce61b640c6 # frozen: v1.35.1 hooks: - id: yamllint diff --git a/docs/source/conf.py b/docs/source/conf.py index 53cd400..687935e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,4 +1,5 @@ """Configuration file for the Sphinx documentation builder.""" + from __future__ import annotations import datetime diff --git a/prep_release.py b/prep_release.py index 87c3f39..835dc5e 100644 --- a/prep_release.py +++ b/prep_release.py @@ -1,4 +1,5 @@ """Script for preparing the repo for a new release.""" + from __future__ import annotations import argparse diff --git a/src/rstcheck_core/__init__.py b/src/rstcheck_core/__init__.py index eda252c..268a633 100644 --- a/src/rstcheck_core/__init__.py +++ b/src/rstcheck_core/__init__.py @@ -1,4 +1,5 @@ """Rstcheck package.""" + from __future__ import annotations import logging diff --git a/src/rstcheck_core/_docutils.py b/src/rstcheck_core/_docutils.py index 5242888..c1767a2 100644 --- a/src/rstcheck_core/_docutils.py +++ b/src/rstcheck_core/_docutils.py @@ -1,4 +1,5 @@ """Docutils helper functions.""" + from __future__ import annotations import importlib diff --git a/src/rstcheck_core/_extras.py b/src/rstcheck_core/_extras.py index e4be310..ee49d2d 100644 --- a/src/rstcheck_core/_extras.py +++ b/src/rstcheck_core/_extras.py @@ -18,6 +18,7 @@ def print_sphinx_version(): _extras.install_guard("sphinx") print(sphinx.version_info) """ + from __future__ import annotations import importlib diff --git a/src/rstcheck_core/_sphinx.py b/src/rstcheck_core/_sphinx.py index 078ff90..d8ffe54 100644 --- a/src/rstcheck_core/_sphinx.py +++ b/src/rstcheck_core/_sphinx.py @@ -1,4 +1,5 @@ """Sphinx helper functions.""" + from __future__ import annotations import contextlib diff --git a/src/rstcheck_core/checker.py b/src/rstcheck_core/checker.py index 59f8569..11037de 100644 --- a/src/rstcheck_core/checker.py +++ b/src/rstcheck_core/checker.py @@ -1,4 +1,5 @@ """Checking functionality.""" + from __future__ import annotations import contextlib diff --git a/src/rstcheck_core/config.py b/src/rstcheck_core/config.py index 4ffd550..dceddbb 100644 --- a/src/rstcheck_core/config.py +++ b/src/rstcheck_core/config.py @@ -1,4 +1,5 @@ """Rstcheck configuration functionality.""" + from __future__ import annotations import configparser diff --git a/src/rstcheck_core/inline_config.py b/src/rstcheck_core/inline_config.py index dcae507..17bc1b3 100644 --- a/src/rstcheck_core/inline_config.py +++ b/src/rstcheck_core/inline_config.py @@ -1,4 +1,5 @@ """Inline config comment functionality.""" + from __future__ import annotations import functools diff --git a/src/rstcheck_core/runner.py b/src/rstcheck_core/runner.py index 0f84e3c..774b1f0 100644 --- a/src/rstcheck_core/runner.py +++ b/src/rstcheck_core/runner.py @@ -1,4 +1,5 @@ """Runner of rstcheck_core.""" + from __future__ import annotations import logging diff --git a/src/rstcheck_core/types.py b/src/rstcheck_core/types.py index e50f40a..cd57e1b 100644 --- a/src/rstcheck_core/types.py +++ b/src/rstcheck_core/types.py @@ -1,4 +1,5 @@ """Helper types.""" + from __future__ import annotations import pathlib diff --git a/tests/_docutils_test.py b/tests/_docutils_test.py index a948759..206f821 100644 --- a/tests/_docutils_test.py +++ b/tests/_docutils_test.py @@ -1,4 +1,5 @@ """Tests for ``_docutils`` module.""" + from __future__ import annotations import docutils.parsers.rst.directives as docutils_directives diff --git a/tests/_extras_test.py b/tests/_extras_test.py index 08fc310..8d69449 100644 --- a/tests/_extras_test.py +++ b/tests/_extras_test.py @@ -1,4 +1,5 @@ """Tests for ``_extras`` module.""" + from __future__ import annotations import importlib.metadata diff --git a/tests/_sphinx_test.py b/tests/_sphinx_test.py index 13683df..578ad6f 100644 --- a/tests/_sphinx_test.py +++ b/tests/_sphinx_test.py @@ -1,4 +1,5 @@ """Tests for ``_sphinx`` module.""" + from __future__ import annotations import typing as t diff --git a/tests/checker_test.py b/tests/checker_test.py index d634fd5..250e558 100644 --- a/tests/checker_test.py +++ b/tests/checker_test.py @@ -1,4 +1,5 @@ """Tests for ``checker`` module.""" + from __future__ import annotations import os diff --git a/tests/config_test.py b/tests/config_test.py index d43bd9c..0c03271 100644 --- a/tests/config_test.py +++ b/tests/config_test.py @@ -1,4 +1,5 @@ """Tests for ``config`` module.""" + from __future__ import annotations import logging diff --git a/tests/conftest.py b/tests/conftest.py index 087586c..9b7e969 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ """Fixtures for tests.""" + from __future__ import annotations import pathlib diff --git a/tests/inline_config_test.py b/tests/inline_config_test.py index 9924391..b8988b1 100644 --- a/tests/inline_config_test.py +++ b/tests/inline_config_test.py @@ -1,4 +1,5 @@ """Tests for ``inline_config`` module.""" + from __future__ import annotations import typing as t @@ -212,8 +213,7 @@ def __call__( # noqa: D102 source: str, source_origin: types.SourceFileOrString, warn_unknown_settings: bool = False, # noqa: FBT002 - ) -> t.Generator[str, None, None]: - ... + ) -> t.Generator[str, None, None]: ... class TestFindIgnoredFunctions: diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py index e1339a1..1afc880 100644 --- a/tests/integration_tests/conftest.py +++ b/tests/integration_tests/conftest.py @@ -1,4 +1,5 @@ """Fixtures for integration tests.""" + from __future__ import annotations import re diff --git a/tests/integration_tests/file_checker_test.py b/tests/integration_tests/file_checker_test.py index 2755cdf..e8e4ce9 100644 --- a/tests/integration_tests/file_checker_test.py +++ b/tests/integration_tests/file_checker_test.py @@ -1,4 +1,5 @@ """Integration test for the main runner.""" + from __future__ import annotations import io diff --git a/tests/integration_tests/runner_test.py b/tests/integration_tests/runner_test.py index e3cc811..7bb4f3f 100644 --- a/tests/integration_tests/runner_test.py +++ b/tests/integration_tests/runner_test.py @@ -1,4 +1,5 @@ """Integration test for the main runner.""" + from __future__ import annotations import io diff --git a/tests/runner_test.py b/tests/runner_test.py index e775135..5234f8f 100644 --- a/tests/runner_test.py +++ b/tests/runner_test.py @@ -1,4 +1,5 @@ """Tests for ``runner`` module.""" + from __future__ import annotations import contextlib diff --git a/tests/types_test.py b/tests/types_test.py index 266bff8..646763c 100644 --- a/tests/types_test.py +++ b/tests/types_test.py @@ -1,4 +1,5 @@ """Tests for ``types`` module.""" + from __future__ import annotations import re