Skip to content

Commit 379cbb8

Browse files
committed
Configure snippet-fmt
1 parent 6904e52 commit 379cbb8

File tree

4 files changed

+43
-24
lines changed

4 files changed

+43
-24
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exclude: ^$
55

66
repos:
77
- repo: https://github.com/repo-helper/pyproject-parser
8-
rev: v0.4.1
8+
rev: v0.4.2
99
hooks:
1010
- id: reformat-pyproject
1111

@@ -51,7 +51,7 @@ repos:
5151
- id: flake2lint
5252

5353
- repo: https://github.com/pre-commit/pygrep-hooks
54-
rev: v1.8.0
54+
rev: v1.9.0
5555
hooks:
5656
- id: python-no-eval
5757
- id: rst-backticks
@@ -72,7 +72,12 @@ repos:
7272
- id: remove-crlf
7373
- id: forbid-crlf
7474

75-
- repo: https://github.com/repo-helper/formate
75+
- repo: https://github.com/python-formate/snippet-fmt
76+
rev: v0.1.3
77+
hooks:
78+
- id: snippet-fmt
79+
80+
- repo: https://github.com/python-formate/formate
7681
rev: v0.4.9
7782
hooks:
7883
- id: formate

README.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,16 @@ This avoids having to manually compile (and keep updated) a mapping like:
124124
.. code-block:: python
125125
126126
intersphinx_mapping = {
127-
"attrs": ('https://www.attrs.org/en/stable/', None),
128-
"Flask": ('https://flask.palletsprojects.com/en/1.1.x/', None),
129-
"matplotlib": ('https://matplotlib.org/stable/', None),
130-
"numpy": ('https://numpy.org/doc/stable/', None),
131-
"pandas": ('https://pandas.pydata.org/docs/', None),
132-
"Pyramid": ('https://docs.pylonsproject.org/projects/pyramid/en/latest/', None),
133-
"scikit-learn": ('https://scikit-learn.org/stable/', None),
134-
"scipy": ('https://docs.scipy.org/doc/scipy/reference/', None),
135-
"Sphinx": ('https://www.sphinx-doc.org/en/stable/', None),
136-
}
127+
"attrs": ("https://www.attrs.org/en/stable/", None),
128+
"Flask": ("https://flask.palletsprojects.com/en/1.1.x/", None),
129+
"matplotlib": ("https://matplotlib.org/stable/", None),
130+
"numpy": ("https://numpy.org/doc/stable/", None),
131+
"pandas": ("https://pandas.pydata.org/docs/", None),
132+
"Pyramid": ("https://docs.pylonsproject.org/projects/pyramid/en/latest/", None),
133+
"scikit-learn": ("https://scikit-learn.org/stable/", None),
134+
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
135+
"Sphinx": ("https://www.sphinx-doc.org/en/stable/", None),
136+
}
137137
# Source: https://gist.github.com/bskinn/0e164963428d4b51017cebdb6cda5209
138138
139139

doc-source/index.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ seed_intersphinx_mapping
6060
:workflow: mypy
6161
:alt: mypy status
6262

63-
.. |requires| requires-io-shield::
63+
.. |requires| image:: https://dependency-dash.herokuapp.com/github/sphinx-toolbox/seed_intersphinx_mapping/badge.svg
64+
:target: https://dependency-dash.herokuapp.com/github/sphinx-toolbox/seed_intersphinx_mapping/
6465
:alt: Requirements Status
6566

6667
.. |coveralls| coveralls-shield::
@@ -134,16 +135,16 @@ This avoids having to manually compile (and keep updated) a mapping like:
134135
.. code-block:: python
135136
136137
intersphinx_mapping = {
137-
"attrs": ('https://www.attrs.org/en/stable/', None),
138-
"Flask": ('https://flask.palletsprojects.com/en/1.1.x/', None),
139-
"matplotlib": ('https://matplotlib.org/stable/', None),
140-
"numpy": ('https://numpy.org/doc/stable/', None),
141-
"pandas": ('https://pandas.pydata.org/docs/', None),
142-
"Pyramid": ('https://docs.pylonsproject.org/projects/pyramid/en/latest/', None),
143-
"scikit-learn": ('https://scikit-learn.org/stable/', None),
144-
"scipy": ('https://docs.scipy.org/doc/scipy/reference/', None),
145-
"Sphinx": ('https://www.sphinx-doc.org/en/stable/', None),
146-
}
138+
"attrs": ("https://www.attrs.org/en/stable/", None),
139+
"Flask": ("https://flask.palletsprojects.com/en/1.1.x/", None),
140+
"matplotlib": ("https://matplotlib.org/stable/", None),
141+
"numpy": ("https://numpy.org/doc/stable/", None),
142+
"pandas": ("https://pandas.pydata.org/docs/", None),
143+
"Pyramid": ("https://docs.pylonsproject.org/projects/pyramid/en/latest/", None),
144+
"scikit-learn": ("https://scikit-learn.org/stable/", None),
145+
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
146+
"Sphinx": ("https://www.sphinx-doc.org/en/stable/", None),
147+
}
147148
# Source: https://gist.github.com/bskinn/0e164963428d4b51017cebdb6cda5209
148149
149150
.. note::

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,16 @@ namespace_packages = true
131131
check_untyped_defs = true
132132
warn_unused_ignores = true
133133
no_implicit_optional = true
134+
135+
[tool.snippet-fmt]
136+
directives = [ "code-block",]
137+
138+
[tool.snippet-fmt.languages.python]
139+
reformat = true
140+
141+
[tool.snippet-fmt.languages.TOML]
142+
reformat = true
143+
144+
[tool.snippet-fmt.languages.ini]
145+
146+
[tool.snippet-fmt.languages.json]

0 commit comments

Comments
 (0)