Make warnings require passing state #2
@ -17,6 +17,8 @@ components_csv_path = sys.argv[1]
|
|||||||
MIN_TEMP_C: int = -10
|
MIN_TEMP_C: int = -10
|
||||||
MAX_TEMP_C: int = 70
|
MAX_TEMP_C: int = 70
|
||||||
|
|
||||||
|
FAIL_ON_WARNING: bool = True
|
||||||
|
|
||||||
class ComponentsWarning:
|
class ComponentsWarning:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.part_number: Optional[str] = None
|
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:
|
with open("./.allspice/report.md", mode="w", encoding="utf-8") as report_file:
|
||||||
report_file.write(template.render(report_context))
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user