diff --git a/rapidchecker/cli.py b/rapidchecker/cli.py index 1ae780a..0ddb82b 100644 --- a/rapidchecker/cli.py +++ b/rapidchecker/cli.py @@ -1,4 +1,5 @@ import sys +from pathlib import Path import click from pyparsing import ParseBaseException @@ -7,12 +8,12 @@ from rapidchecker.whitespace_checks import WhiteSpaceError from .check import check_format -from .io import get_sys_files, read_sys_file from .whitespace_checks import check_whitespace -def in_ignore_list(path: str, ignore_list: list[str]) -> bool: - return any(item in path for item in ignore_list) +def read_sys_file(path: str | Path) -> str: + with Path(path).open() as f: + return f.read() def check_file(file_contents: str) -> list[ParseBaseException | WhiteSpaceError]: diff --git a/rapidchecker/io.py b/rapidchecker/io.py deleted file mode 100644 index f0c10f1..0000000 --- a/rapidchecker/io.py +++ /dev/null @@ -1,14 +0,0 @@ -from collections.abc import Iterable -from pathlib import Path - - -def get_sys_files(path: str | Path) -> Iterable[Path]: - path = Path(path) - if path.suffix == ".sys": - return [path] - return path.glob("**/*.sys") - - -def read_sys_file(path: str | Path) -> str: - with Path(path).open() as f: - return f.read() diff --git a/uv.lock b/uv.lock index 123d44a..22e8238 100644 --- a/uv.lock +++ b/uv.lock @@ -286,7 +286,7 @@ wheels = [ [[package]] name = "rapidchecker" -version = "0.1.2" +version = "0.1.3" source = { virtual = "." } dependencies = [ { name = "click" },