Skip to content

Commit df1fdf2

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6a33884 commit df1fdf2

3 files changed

Lines changed: 33 additions & 35 deletions

File tree

.pre-commit-config.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repos:
2727

2828
# file checking out-of-the-box hooks
2929
- repo: https://github.com/pre-commit/pre-commit-hooks
30-
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
30+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
3131
hooks:
3232
- id: check-case-conflict
3333
- id: check-shebang-scripts-are-executable
@@ -49,7 +49,7 @@ repos:
4949

5050
# ruff - python linter with fixing ability
5151
- repo: https://github.com/astral-sh/ruff-pre-commit
52-
rev: 5ba58aca0bd5bc7c0e1c0fc45af2e88d6a2bde83 # frozen: v0.14.10
52+
rev: 5ba58aca0bd5bc7c0e1c0fc45af2e88d6a2bde83 # frozen: v0.14.10
5353
hooks:
5454
- id: ruff
5555
name: ruff (fix)
@@ -59,7 +59,7 @@ repos:
5959

6060
# blacken-docs - black for python code in docs (rst/md/tex)
6161
- repo: https://github.com/asottile/blacken-docs
62-
rev: dda8db18cfc68df532abf33b185ecd12d5b7b326 # frozen: 1.20.0
62+
rev: dda8db18cfc68df532abf33b185ecd12d5b7b326 # frozen: 1.20.0
6363
hooks:
6464
- id: blacken-docs
6565
args: ["--line-length=100", "--target-version=py312"]
@@ -104,7 +104,7 @@ repos:
104104

105105
# code unspecific out-of-the-box hooks
106106
- repo: https://github.com/pre-commit/pre-commit-hooks
107-
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
107+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
108108
hooks:
109109
- id: end-of-file-fixer
110110
stages: [pre-commit]
@@ -134,7 +134,7 @@ repos:
134134

135135
# code unspecific out-of-the-box hooks
136136
- repo: https://github.com/pre-commit/pre-commit-hooks
137-
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
137+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
138138
hooks:
139139
- id: check-merge-conflict
140140
- id: detect-private-key
@@ -145,7 +145,7 @@ repos:
145145

146146
# ruff - python linter with fixing ability
147147
- repo: https://github.com/astral-sh/ruff-pre-commit
148-
rev: 5ba58aca0bd5bc7c0e1c0fc45af2e88d6a2bde83 # frozen: v0.14.10
148+
rev: 5ba58aca0bd5bc7c0e1c0fc45af2e88d6a2bde83 # frozen: v0.14.10
149149
hooks:
150150
- id: ruff
151151
name: ruff (lint)
@@ -156,7 +156,7 @@ repos:
156156

157157
# python specific out-of-the-box hooks
158158
- repo: https://github.com/pre-commit/pre-commit-hooks
159-
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
159+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
160160
hooks:
161161
- id: debug-statements
162162
- id: fix-encoding-pragma
@@ -180,7 +180,7 @@ repos:
180180

181181
# pylint - python linter
182182
- repo: https://github.com/PyCQA/pylint/
183-
rev: e16f942166511d6fb4427e503a734152fae0c4fe # frozen: v4.0.4
183+
rev: e16f942166511d6fb4427e503a734152fae0c4fe # frozen: v4.0.4
184184
hooks:
185185
- id: pylint
186186
name: spell-check (pylint+pyenchant)
@@ -195,7 +195,7 @@ repos:
195195

196196
# shellscript (via PyPI package)
197197
- repo: https://github.com/shellcheck-py/shellcheck-py
198-
rev: 745eface02aef23e168a8afb6b5737818efbea95 # frozen: v0.11.0.1
198+
rev: 745eface02aef23e168a8afb6b5737818efbea95 # frozen: v0.11.0.1
199199
hooks:
200200
- id: shellcheck
201201

@@ -205,7 +205,7 @@ repos:
205205

206206
# rstcheck - rst file checker
207207
- repo: https://github.com/rstcheck/rstcheck
208-
rev: 27258fde1ee7d3b1e6a7bbc58f4c7b1dd0e719e5 # frozen: v6.2.5
208+
rev: 27258fde1ee7d3b1e6a7bbc58f4c7b1dd0e719e5 # frozen: v6.2.5
209209
hooks:
210210
- id: rstcheck
211211
additional_dependencies: [sphinx]
@@ -218,7 +218,7 @@ repos:
218218

219219
# markdownlint - md file checker
220220
- repo: https://github.com/DavidAnson/markdownlint-cli2
221-
rev: 7339935a3036f096ee0d7f1f047a9ec41707d4c1 # frozen: v0.20.0
221+
rev: 7339935a3036f096ee0d7f1f047a9ec41707d4c1 # frozen: v0.20.0
222222
hooks:
223223
- id: markdownlint-cli2
224224

@@ -228,7 +228,7 @@ repos:
228228

229229
# JSON specific out-of-the-box hooks
230230
- repo: https://github.com/pre-commit/pre-commit-hooks
231-
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
231+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
232232
hooks:
233233
- id: check-toml
234234
- id: check-yaml

prep_release.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ def _main() -> int:
140140
if args.first_release:
141141
release_version = "v1.0.0"
142142
#: Get first commit
143-
current_version = subprocess.run( # noqa: S603
143+
current_version = subprocess.run(
144144
["git", "rev-list", "--max-parents=0", "HEAD"], # noqa: S607
145145
check=True,
146146
capture_output=True,
147147
).stdout.decode()[0:7]
148148
else:
149149
git_tags = (
150-
subprocess.run( # noqa: S603
150+
subprocess.run(
151151
["git", "tag", "--list"], # noqa: S607
152152
check=True,
153153
capture_output=True,

src/rstcheck_core/config.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ class RstcheckConfigFile(pydantic.BaseModel):
8686
:raises pydantic.ValidationError: If setting is not parsable into correct type
8787
"""
8888

89-
report_level: t.Optional[ReportLevel] = None # noqa: UP007
90-
ignore_directives: t.Optional[t.List[str]] = None # noqa: UP007,UP006
91-
ignore_roles: t.Optional[t.List[str]] = None # noqa: UP007,UP006
92-
ignore_substitutions: t.Optional[t.List[str]] = None # noqa: UP007,UP006
93-
ignore_languages: t.Optional[t.List[str]] = None # noqa: UP007,UP006
94-
ignore_messages: t.Optional[t.Pattern[str]] = None # noqa: UP007
89+
report_level: ReportLevel | None = None
90+
ignore_directives: t.List[str] | None = None # noqa: UP006
91+
ignore_roles: t.List[str] | None = None # noqa: UP006
92+
ignore_substitutions: t.List[str] | None = None # noqa: UP006
93+
ignore_languages: t.List[str] | None = None # noqa: UP006
94+
ignore_messages: t.Pattern[str] | None = None
9595

9696
@pydantic.field_validator("report_level", mode="before")
9797
@classmethod
@@ -189,9 +189,9 @@ class RstcheckConfig(RstcheckConfigFile):
189189
:raises pydantic.ValidationError: If setting is not parsable into correct type
190190
"""
191191

192-
config_path: t.Optional[pathlib.Path] = None # noqa: UP007
193-
recursive: t.Optional[bool] = None # noqa: UP007
194-
warn_unknown_settings: t.Optional[bool] = None # noqa: UP007
192+
config_path: pathlib.Path | None = None
193+
recursive: bool | None = None
194+
warn_unknown_settings: bool | None = None
195195

196196

197197
class _RstcheckConfigINIFile(pydantic.BaseModel):
@@ -203,11 +203,11 @@ class _RstcheckConfigINIFile(pydantic.BaseModel):
203203
"""
204204

205205
report_level: t.Union[str, int, None] = None # noqa: UP007
206-
ignore_directives: t.Optional[str] = None # noqa: UP007
207-
ignore_roles: t.Optional[str] = None # noqa: UP007
208-
ignore_substitutions: t.Optional[str] = None # noqa: UP007
209-
ignore_languages: t.Optional[str] = None # noqa: UP007
210-
ignore_messages: t.Optional[str] = None # noqa: UP007
206+
ignore_directives: str | None = None
207+
ignore_roles: str | None = None
208+
ignore_substitutions: str | None = None
209+
ignore_languages: str | None = None
210+
ignore_messages: str | None = None
211211

212212

213213
def _load_config_from_ini_file(
@@ -281,10 +281,10 @@ class _RstcheckConfigTOMLFile(pydantic.BaseModel):
281281
"""
282282

283283
report_level: t.Union[str, int, None] = None # noqa: UP007
284-
ignore_directives: t.Optional[t.List[str]] = None # noqa: UP006, UP007
285-
ignore_roles: t.Optional[t.List[str]] = None # noqa: UP006, UP007
286-
ignore_substitutions: t.Optional[t.List[str]] = None # noqa: UP006, UP007
287-
ignore_languages: t.Optional[t.List[str]] = None # noqa: UP006, UP007
284+
ignore_directives: t.List[str] | None = None # noqa: UP006
285+
ignore_roles: t.List[str] | None = None # noqa: UP006
286+
ignore_substitutions: t.List[str] | None = None # noqa: UP006
287+
ignore_languages: t.List[str] | None = None # noqa: UP006
288288
ignore_messages: t.Union[t.List[str], str, None] = None # noqa: UP006, UP007
289289

290290

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

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

341339
if rstcheck_section is None:
342340
if log_missing_section_as_warning:

0 commit comments

Comments
 (0)