Skip to content

Commit 99a0bf7

Browse files
Autoformat files
1 parent f9db6f2 commit 99a0bf7

File tree

2 files changed

+21
-26
lines changed

2 files changed

+21
-26
lines changed

mathicsscript/completion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def get_completions(
103103
words = []
104104

105105
def word_matches(word: str) -> bool:
106-
""" True when the word before the cursor matches. """
106+
"""True when the word before the cursor matches."""
107107

108108
if self.match_middle:
109109
return word_before_cursor in word

rst2html.py

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,47 @@
1111

1212
import re
1313

14+
1415
def yield_sphinx_only_markup(lines):
1516
"""
1617
:param file_inp: a `filename` or ``sys.stdin``?
1718
:param file_out: a `filename` or ``sys.stdout`?`
1819
1920
"""
2021
substs = [
21-
## Selected Sphinx-only Roles.
22+
# Selected Sphinx-only Roles.
2223
#
23-
(r':abbr:`([^`]+)`', r'\1'),
24-
(r':ref:`([^`]+)`', r'`\1`_'),
25-
(r':term:`([^`]+)`', r'**\1**'),
26-
(r':dfn:`([^`]+)`', r'**\1**'),
27-
(r':(samp|guilabel|menuselection):`([^`]+)`', r'``\2``'),
28-
29-
30-
## Sphinx-only roles:
24+
(r":abbr:`([^`]+)`", r"\1"),
25+
(r":ref:`([^`]+)`", r"`\1`_"),
26+
(r":term:`([^`]+)`", r"**\1**"),
27+
(r":dfn:`([^`]+)`", r"**\1**"),
28+
(r":(samp|guilabel|menuselection):`([^`]+)`", r"``\2``"),
29+
# Sphinx-only roles:
3130
# :foo:`bar` --> foo(``bar``)
3231
# :a:foo:`bar` XXX afoo(``bar``)
3332
#
34-
#(r'(:(\w+))?:(\w+):`([^`]*)`', r'\2\3(``\4``)'),
35-
(r':(\w+):`([^`]*)`', r'\1(``\2``)'),
36-
37-
38-
## Sphinx-only Directives.
33+
# (r'(:(\w+))?:(\w+):`([^`]*)`', r'\2\3(``\4``)'),
34+
(r":(\w+):`([^`]*)`", r"\1(``\2``)"),
35+
# Sphinx-only Directives.
3936
#
40-
(r'\.\. doctest', r'code-block'),
41-
(r'\.\. plot::', r'.. '),
42-
(r'\.\. seealso', r'info'),
43-
(r'\.\. glossary', r'rubric'),
44-
(r'\.\. figure::', r'.. '),
45-
46-
47-
## Other
37+
(r"\.\. doctest", r"code-block"),
38+
(r"\.\. plot::", r".. "),
39+
(r"\.\. seealso", r"info"),
40+
(r"\.\. glossary", r"rubric"),
41+
(r"\.\. figure::", r".. "),
42+
# Other
4843
#
49-
(r'\|version\|', r'x.x.x'),
44+
(r"\|version\|", r"x.x.x"),
5045
]
5146

52-
regex_subs = [ (re.compile(regex, re.IGNORECASE), sub) for (regex, sub) in substs ]
47+
regex_subs = [(re.compile(regex, re.IGNORECASE), sub) for (regex, sub) in substs]
5348

5449
def clean_line(line):
5550
try:
5651
for (regex, sub) in regex_subs:
5752
line = regex.sub(sub, line)
5853
except Exception as ex:
59-
print("ERROR: %s, (line(%s)"%(regex, sub))
54+
print("ERROR: %s, (line(%s)" % (regex, sub))
6055
raise ex
6156

6257
return line

0 commit comments

Comments
 (0)