commit 5240d3b80301204f719f804cd5c7647c1806c1d3
parent cdf3eb8c59986350882eb60a11dc973bfba3dcfa
Author: Andrew Laack <andrew@laack.co>
Date: Thu, 19 Jun 2025 23:03:24 -0500
WIP: saving changes before branch switching
Diffstat:
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/ratchets/run_tests.py b/src/ratchets/run_tests.py
@@ -238,6 +238,11 @@ def evaluate_shell_tests(
file_lines_map: Dict[str, Dict[str, List[int]]] = {}
+ # TODO:
+ # Parallelize map creation; this is heavily I/O bound.
+ # Also, check if this is the best approach. Would it
+ # just be better to run in O(n) given smaller coefficients?
+
for file_path in files:
try:
with open(file_path, "r", encoding="utf-8") as f:
diff --git a/src/ratchets/validate.py b/src/ratchets/validate.py
@@ -57,7 +57,9 @@ def validate(filename: Optional[str]) -> Optional[bool]:
if __name__ == "__main__":
"""Entry point to parse CLI inputs and evaluate .toml test file."""
parser = argparse.ArgumentParser(description="Regex ratchet validation")
- parser.add_argument("-f", "--file")
+ parser.add_argument("-t", "--toml-file")
args = parser.parse_args()
- file: Optional[str] = args.file
- validate(file)
+ file: Optional[str] = args.toml_file
+ if validate(file):
+ print("Your .toml file is valid!")
+
diff --git a/tests/test_files/test_files.py b/tests/test_files/test_files.py
@@ -5,7 +5,7 @@ import json
def test_files():
- """Tests the functionallity of TOML and file specification."""
+ """Tests the functionallity of .toml and file specification."""
# directory: Union[str, Path], paths: Optional[List[str]]
# ) -> List[Path]: