Make warnings require passing state #2

Open
allspice-kyle wants to merge 4 commits from strict_error_check into develop
Showing only changes of commit beb23072ec - Show all commits

View File

@ -17,6 +17,8 @@ components_csv_path = sys.argv[1]
MIN_TEMP_C: int = -10
MAX_TEMP_C: int = 70
FAIL_ON_WARNING: bool = True
class ComponentsWarning:
def __init__(self):
self.part_number: Optional[str] = None
@ -115,3 +117,7 @@ template = template_env.get_template("report.template.md")
with open("./.allspice/report.md", mode="w", encoding="utf-8") as report_file:
report_file.write(template.render(report_context))
if FAIL_ON_WARNING and report_context["warning_count"] > 0:
logger.error('FAIL_ON_WARNING set to "True". Please resolve all warnings.')
exit(1)