Skip to content

Commit

Permalink
Pyupgrade (#160)
Browse files Browse the repository at this point in the history
* Add pyupgrade to pre-commit

* Run pre-commit hook
  • Loading branch information
jarrodmillman authored Mar 22, 2022
1 parent 92568e5 commit d6dbb38
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ repos:
- id: prettier
files: \.(md|yml|yaml)
args: [--prose-wrap=preserve]

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
hooks:
- id: pyupgrade
args: [--py38-plus]
21 changes: 11 additions & 10 deletions doc/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ markup:
params:
description: "Documentation & template site for the Scientific Python Hugo Theme."
images:
- /images/logo.svg
- /images/logo.svg
navbarlogo:
image: logo.svg
text: Scientific Python Hugo Theme
Expand All @@ -21,20 +21,21 @@ params:
title: Scientific Python Theme
image: logo.svg
navbar:
- title: Get started
url: /getstarted/
- title: Features
url: /features/
- title: Shortcodes
url: /shortcodes/
- title: Get started
url: /getstarted/
- title: Features
url: /features/
- title: Shortcodes
url: /shortcodes/
keyfeatures:
features:
- title: Documented
text: The theme is documented at https://theme.scientific-python.org.
- title: Reusable
text: "The theme is being used by [scientific-python.org](https://github.com/scientific-python/scientific-python.org),
[numpy.org](https://github.com/numpy/numpy.org), and
[scipy.org](https://github.com/scipy/scipy.org)."
text: "The theme is being used by
[scientific-python.org](https://github.com/scientific-python/scientific-python.org),
[numpy.org](https://github.com/numpy/numpy.org), and
[scipy.org](https://github.com/scipy/scipy.org)."
- title: Community Maintained
text: The theme is maintained by the [Theme Team](/about/).
footer:
Expand Down
4 changes: 2 additions & 2 deletions tools/render_shortcode_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def shortcode_doc(fn):
"""
Return description, example, code
"""
with open(fn, "r") as f:
with open(fn) as f:
data = f.read()

match = re.match(
"^{{/\*.*doc: ([^\n]*)(.*?)^\*/}}$", data, re.MULTILINE | re.DOTALL
"^{{/\\*.*doc: ([^\n]*)(.*?)^\\*/}}$", data, re.MULTILINE | re.DOTALL
)

if not match:
Expand Down

0 comments on commit d6dbb38

Please sign in to comment.