Skip to content

Commit

Permalink
'[pre-commit.ci 🤖] Apply code format tools to PR'
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jul 1, 2024
1 parent b7986ba commit 1c66689
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ repos:
- id: trailing-whitespace

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

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "1dc9eb131c2ea4816c708e4d85820d2cc8542683" # frozen: v0.5.0
rev: "1dc9eb131c2ea4816c708e4d85820d2cc8542683" # frozen: v0.5.0
hooks:
- id: ruff
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
Expand Down
2 changes: 1 addition & 1 deletion numpydoc/docscrape_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def _str_references(self):
out += [".. only:: latex", ""]
items = []
for line in self["References"]:
m = re.match(r".. \[([a-z0-9._-]+)\]", line, re.I)
m = re.match(r".. \[([a-z0-9._-]+)\]", line, re.IGNORECASE)
if m:
items.append(m.group(1))
out += [" " + ", ".join([f"[{item}]_" for item in items]), ""]
Expand Down
6 changes: 4 additions & 2 deletions numpydoc/numpydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def rename_references(app, what, name, obj, options, lines):
references = set()
for line in lines:
line = line.strip()
m = re.match(r"^\.\. +\[(%s)\]" % app.config.numpydoc_citation_re, line, re.I)
m = re.match(
r"^\.\. +\[(%s)\]" % app.config.numpydoc_citation_re, line, re.IGNORECASE
)
if m:
references.add(m.group(1))

Expand Down Expand Up @@ -185,7 +187,7 @@ def mangle_docstrings(app, what, name, obj, options, lines):
if what == "module":
# Strip top title
pattern = "^\\s*[#*=]{4,}\\n[a-z0-9 -]+\\n[#*=]{4,}\\s*"
title_re = re.compile(pattern, re.I | re.S)
title_re = re.compile(pattern, re.IGNORECASE | re.DOTALL)
lines[:] = title_re.sub("", u_NL.join(lines)).split(u_NL)
else:
try:
Expand Down
2 changes: 1 addition & 1 deletion numpydoc/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

DIRECTIVES = ["versionadded", "versionchanged", "deprecated"]
DIRECTIVE_PATTERN = re.compile(
r"^\s*\.\. ({})(?!::)".format("|".join(DIRECTIVES)), re.I | re.M
r"^\s*\.\. ({})(?!::)".format("|".join(DIRECTIVES)), re.IGNORECASE | re.MULTILINE
)
ALLOWED_SECTIONS = [
"Parameters",
Expand Down

0 comments on commit 1c66689

Please sign in to comment.