-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
205 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.6.2 | ||
1.6.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[codespell] | ||
skip = ./.git,./tmp,./data,./extern,./tst,./bin,./libtool,configure,configure~,./gh-pages,./autom4te.cache,./cnf,aclocal.m4,./m4,./doc/*.log,./doc/*.html,./doc/*.txt,./doc/*.six,./doc/*.js,./doc/*.bbl,./doc/*.tex,./doc/*.bib | ||
ignore-words-list=ist,MIS,mis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: codespell | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- stable-*.* | ||
jobs: | ||
codespell: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: codespell-project/actions-codespell@v1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
This simple script adds the local variables used in a GAP tst file to the top | ||
of the file. | ||
""" | ||
import os | ||
import re | ||
import sys | ||
import textwrap | ||
|
||
import yaml | ||
from bs4 import BeautifulSoup | ||
|
||
|
||
def main(): | ||
if sys.version_info[0] < 3: | ||
raise Exception("Python 3 is required") | ||
args = sys.argv[1:] | ||
pattern1 = re.compile(r"(\w+)\s*:=") | ||
pattern2 = re.compile(r"for (\w+) in") | ||
for fname in args: | ||
lvars = [] | ||
with open(fname, "r") as f: | ||
lines = f.read() | ||
lvars.extend([x.group(1) for x in re.finditer(pattern1, lines)]) | ||
lvars.extend([x.group(1) for x in re.finditer(pattern2, lines)]) | ||
lvars = ", ".join(sorted([*{*lvars}])) | ||
lvars = [x if x[-1] != "," else x[:-1] for x in textwrap.wrap(lvars, width=72)] | ||
lvars = [""] + ["#@local " + x for x in lvars] | ||
lines = lines.split("\n") | ||
pos = next(i for i in range(len(lines)) if "START_TEST" in lines[i]) | ||
lines = lines[:pos] + lvars + lines[pos:] | ||
lines = "\n".join(lines) | ||
with open(fname, "w") as f: | ||
print(f"Writing local variables to {fname}...") | ||
f.write(lines) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
This simple script adds the "Unbind" statements to the end of a GAP tst file. | ||
""" | ||
import os | ||
import re | ||
import sys | ||
import textwrap | ||
|
||
import yaml | ||
from bs4 import BeautifulSoup | ||
|
||
|
||
def main(): | ||
if sys.version_info[0] < 3: | ||
raise Exception("Python 3 is required") | ||
args = sys.argv[1:] | ||
pattern1 = re.compile(r"(\w+)\s*:=") | ||
pattern2 = re.compile(r"for (\w+) in") | ||
for fname in args: | ||
lvars = [] | ||
with open(fname, "r") as f: | ||
lines = f.read() | ||
lvars.extend([x.group(1) for x in re.finditer(pattern1, lines)]) | ||
lvars.extend([x.group(1) for x in re.finditer(pattern2, lines)]) | ||
lvars = sorted([*{*lvars}]) | ||
lvars = [ | ||
"# Unbind local variables, auto-generated by etc/tst-unbind-local-vars.py" | ||
] + [f"gap> Unbind({lvar});" for lvar in lvars] | ||
lvars.append("") | ||
lines = lines.split("\n") | ||
pos1 = next(i for i in range(len(lines)) if "STOP_TEST" in lines[i]) - 1 | ||
try: | ||
pos0 = next( | ||
i | ||
for i in range(len(lines)) | ||
if "etc/tst-unbind-local-vars.py" in lines[i] | ||
) | ||
except StopIteration: | ||
pos0 = pos1 | ||
lines = lines[:pos0] + lvars + lines[pos1:] | ||
lines = "\n".join(lines) | ||
with open(fname, "w") as f: | ||
print(f"Writing local variables to {fname}...") | ||
f.write(lines) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.