Skip to content

Commit 1c66689

Browse files
'[pre-commit.ci 🤖] Apply code format tools to PR'
1 parent b7986ba commit 1c66689

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

‎.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ repos:
1818
- id: trailing-whitespace
1919

2020
- repo: https://github.com/pre-commit/mirrors-prettier
21-
rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8
21+
rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8
2222
hooks:
2323
- id: prettier
2424
types_or: [yaml, toml, markdown, css, scss, javascript, json]
2525
args: [--prose-wrap=preserve]
2626

2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: "1dc9eb131c2ea4816c708e4d85820d2cc8542683" # frozen: v0.5.0
28+
rev: "1dc9eb131c2ea4816c708e4d85820d2cc8542683" # frozen: v0.5.0
2929
hooks:
3030
- id: ruff
3131
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]

‎numpydoc/docscrape_sphinx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def _str_references(self):
329329
out += [".. only:: latex", ""]
330330
items = []
331331
for line in self["References"]:
332-
m = re.match(r".. \[([a-z0-9._-]+)\]", line, re.I)
332+
m = re.match(r".. \[([a-z0-9._-]+)\]", line, re.IGNORECASE)
333333
if m:
334334
items.append(m.group(1))
335335
out += [" " + ", ".join([f"[{item}]_" for item in items]), ""]

‎numpydoc/numpydoc.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ def rename_references(app, what, name, obj, options, lines):
5858
references = set()
5959
for line in lines:
6060
line = line.strip()
61-
m = re.match(r"^\.\. +\[(%s)\]" % app.config.numpydoc_citation_re, line, re.I)
61+
m = re.match(
62+
r"^\.\. +\[(%s)\]" % app.config.numpydoc_citation_re, line, re.IGNORECASE
63+
)
6264
if m:
6365
references.add(m.group(1))
6466

@@ -185,7 +187,7 @@ def mangle_docstrings(app, what, name, obj, options, lines):
185187
if what == "module":
186188
# Strip top title
187189
pattern = "^\\s*[#*=]{4,}\\n[a-z0-9 -]+\\n[#*=]{4,}\\s*"
188-
title_re = re.compile(pattern, re.I | re.S)
190+
title_re = re.compile(pattern, re.IGNORECASE | re.DOTALL)
189191
lines[:] = title_re.sub("", u_NL.join(lines)).split(u_NL)
190192
else:
191193
try:

‎numpydoc/validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
DIRECTIVES = ["versionadded", "versionchanged", "deprecated"]
2525
DIRECTIVE_PATTERN = re.compile(
26-
r"^\s*\.\. ({})(?!::)".format("|".join(DIRECTIVES)), re.I | re.M
26+
r"^\s*\.\. ({})(?!::)".format("|".join(DIRECTIVES)), re.IGNORECASE | re.MULTILINE
2727
)
2828
ALLOWED_SECTIONS = [
2929
"Parameters",

0 commit comments

Comments
 (0)