10000 [pre-commit.ci] pre-commit autoupdate by pre-commit-ci[bot] · Pull Request #112 · rstcheck/rstcheck-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[pre-commit.ci] pre-commit autoupdate #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ repos:

# ruff - python linter with fixing ability
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 76e47323a83cd9795e4ff9a1de1c0d2eef610f17 # frozen: v0.11.11
rev: 7445ed19e95ffaa6aad0d9bd4123025f7039511a # frozen: v0.12.1
hooks:
- id: ruff
name: ruff (fix)
Expand Down Expand Up @@ -145,7 +145,7 @@ repos:

# ruff - python linter with fixing ability
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 76e47323a83cd9795e4ff9a1de1c0d2eef610f17 # frozen: v0.11.11
rev: 7445ed19e95ffaa6aad0d9bd4123025f7039511a # frozen: v0.12.1
hooks:
- id: ruff
name: ruff (lint)
Expand Down Expand Up @@ -205,7 +205,7 @@ repos:

# rstcheck - rst file checker
- repo: https://github.com/rstcheck/rstcheck
rev: f30c4d170a36ea3812bceb5f33004afc213bd797 # frozen: v6.2.4
rev: 27258fde1ee7d3b1e6a7bbc58f4c7b1dd0e719e5 # frozen: v6.2.5
hooks:
- id: rstcheck
additional_dependencies: [sphinx]
Expand Down
4 changes: 2 additions & 2 deletions prep_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ def _main() -> int:
if args.first_release:
release_version = "v1.0.0"
#: Get first commit
current_version = subprocess.run( # noqa: S603
current_version = subprocess.run(
["git", "rev-list", "--max-parents=0", "HEAD"], # noqa: S607
check=True,
capture_output=True,
).stdout.decode()[0:7]
else:
git_tags = (
subprocess.run( # noqa: S603
subprocess.run(
["git", "tag", "--list"], # noqa: S607
check=True,
capture_output=True,
Expand Down
40 changes: 19 additions & 21 deletions src/rstcheck_core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ class RstcheckConfigFile(pydantic.BaseModel):
:raises pydantic.ValidationError: If setting is not parsable into correct type
"""

report_level: t.Optional[ReportLevel] = None # noqa: UP007
ignore_directives: t.Optional[t.List[str]] = None # noqa: UP007,UP006
ignore_roles: t.Optional[t.List[str]] = None # noqa: UP007,UP006
ignore_substitutions: t.Optional[t.List[str]] = None # noqa: UP007,UP006
ignore_languages: t.Optional[t.List[str]] = None # noqa: UP007,UP006
ignore_messages: t.Optional[t.Pattern[str]] = None # noqa: UP007
report_level: ReportLevel | None = None
ignore_directives: t.List[str] | None = None # noqa: UP006
ignore_roles: t.List[str] | None = None # noqa: UP006
ignore_substitutions: t.List[str] | None = None # noqa: UP006
ignore_languages: t.List[str] | None = None # noqa: UP006
ignore_messages: t.Pattern[str] | None = None

@pydantic.field_validator("report_level", mode="before")
@classmethod
Expand Down Expand Up @@ -189,9 +189,9 @@ class RstcheckConfig(RstcheckConfigFile):
:raises pydantic.ValidationError: If setting is not parsable into correct type
"""

config_path: t.Optional[pathlib.Path] = None # noqa: UP007
recursive: t.Optional[bool] = None # noqa: UP007
warn_unknown_settings: t.Optional[bool] = None # noqa: UP007
config_path: pathlib.Path | None = None
recursive: bool | None = None
warn_unknown_settings: bool | None = None


class _RstcheckConfigINIFile(pydantic.BaseModel):
Expand All @@ -203,11 +203,11 @@ class _RstcheckConfigINIFile(pydantic.BaseModel):
"""

report_level: t.Union[str, int, None] = None # noqa: UP007
ignore_directives: t.Optional[str] = None # noqa: UP007
ignore_roles: t.Optional[str] = None # noqa: UP007
ignore_substitutions: t.Optional[str] = None # noqa: UP007
ignore_languages: t.Optional[str] = None # noqa: UP007
ignore_messages: t.Optional[str] = None # noqa: UP007
ignore_directives: str | None = None
ignore_roles: str | None = None
ignore_substitutions: str | None = None
ignore_languages: str | None = None
ignore_messages: str | None = None


def _load_config_from_ini_file(
Expand Down Expand Up @@ -281,10 +281,10 @@ class _RstcheckConfigTOMLFile(pydantic.BaseModel):
"""

report_level: t.Union[str, int, None] = None # noqa: UP007
ignore_directives: t.Optional[t.List[str]] = None # noqa: UP006, UP007
ignore_roles: t.Optional[t.List[str]] = None # noqa: UP006, UP007
ignore_substitutions: t.Optional[t.List[str]] = None # noqa: UP006, UP007
ignore_languages: t.Optional[t.List[str]] = None # noqa: UP006, UP007
ignore_directives: t.List[str] | None = None # noqa: UP006
ignore_roles: t.List[str] | None = None # noqa: UP006
ignore_substitutions: t.List[str] | None = None # noqa: UP006
ignore_languages: t.List[str] | None = None # noqa: UP006
ignore_messages: t.Union[t.List[str], str, None] = None # noqa: UP006, UP007


Expand Down Expand Up @@ -334,9 +334,7 @@ def _load_config_from_toml_file(
with pathlib.Path(resolved_file).open("rb") as toml_file_handle:
toml_dict = tomllib.load(toml_file_handle)

rstcheck_section: t.Optional[dict[str, t.Any]] = toml_dict.get("tool", {}).get( # noqa: UP007
"rstcheck"
)
rstcheck_section: dict[str, t.Any] | None = toml_dict.get("tool", {}).get("rstcheck")

if rstcheck_section is None:
if log_missing_section_as_warning:
Expand Down
Loading
0