From 358f20a94e298196d30408b42cef26f839f4e801 Mon Sep 17 00:00:00 2001 From: Luis Gabriel Gomez Date: Sun, 4 Dec 2022 19:45:25 -0300 Subject: [PATCH] printer-linter: exit on invalid definition file paths This PR prevents silent failure with empty diagnostics if an invalid file path was provided --- printer-linter/src/terminal.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/printer-linter/src/terminal.py b/printer-linter/src/terminal.py index 6e6d1af4e5..e06ccb5e9a 100644 --- a/printer-linter/src/terminal.py +++ b/printer-linter/src/terminal.py @@ -1,5 +1,6 @@ from argparse import ArgumentParser from os import getcwd +from os import path from pathlib import Path from typing import List @@ -41,6 +42,11 @@ def main() -> None: full_body_check = {"Diagnostics": []} + for file in files: + if not path.exists(file): + print(f"Can't find the file: {file}") + return + if to_fix or to_diagnose: for file in files: diagnostics = diagnoseIssuesWithFile(file, settings)