Skip to content
Snippets Groups Projects
Commit b22e5f22 authored by Björn Brandenburg's avatar Björn Brandenburg
Browse files

CI: detect & remove multiline verbatim blocks

parent 73533063
No related branches found
No related tags found
1 merge request!239Draft: Use the `hunspell` spell checker in CI
......@@ -6,6 +6,7 @@ import os
import re
INLINE_CODE_RE = re.compile(r'\[[^]]*?\]')
VERBATIM_RE = re.compile(r'<<.*?>>')
def comment_ranges(src):
"Identify comments in Coq .v files."
......@@ -41,8 +42,10 @@ def process(opts, fname):
out = sys.stdout
for (a, b) in comment_ranges(src):
txt = src[a:b]
print(INLINE_CODE_RE.sub('', txt))
# out.close()
txt = txt.replace('\n', ' ')
txt = VERBATIM_RE.sub('', txt)
txt = INLINE_CODE_RE.sub('', txt)
print(txt)
def parse_args():
parser = argparse.ArgumentParser(
......
......@@ -10,7 +10,6 @@ do
#Here, sed is used to remove verbatim text (enclosed in <<>>)
for WORD in $(scripts/extract-comments.py "$SRC" \
| sed 's/<<.*>>//g' \
| hunspell -p $KNOWN_EXCEPTIONS -l -d en_US \
| sort \
| uniq)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment