- Fix E501 line too long errors by splitting long strings - Fix F841 unused variable errors by removing unused assignments - Add noqa: E402 comments for intentional module imports after sys.path modifications Co-authored-by: ArtemFilin1990 <221041513+ArtemFilin1990@users.noreply.github.com>
29 lines
670 B
Python
29 lines
670 B
Python
"""CLI entrypoint for validating CSV datasets."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
REPO_ROOT = Path(__file__).resolve().parents[2]
|
|
if str(REPO_ROOT) not in sys.path:
|
|
sys.path.insert(0, str(REPO_ROOT))
|
|
|
|
from scripts.validate.csv_validator import validate_all # noqa: E402
|
|
|
|
|
|
def main() -> int:
|
|
repo_root = Path(__file__).resolve().parents[2]
|
|
schema_dir = repo_root / "schemas"
|
|
errors = validate_all(schema_dir)
|
|
if errors:
|
|
for message in errors:
|
|
print(message)
|
|
return 1
|
|
print("All datasets validated successfully.")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|