From 0017f984bb9bded6bbb5c3a6608222ea3b22e2f9 Mon Sep 17 00:00:00 2001
From: B13nch3n <b13nch3n_01@theb-si.de>
Date: Thu, 18 Aug 2022 15:34:50 +0200
Subject: [PATCH] Exite non-zero on failed validation.

---
 validation/validate-mmcif-file.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/validation/validate-mmcif-file.py b/validation/validate-mmcif-file.py
index fbea4b7..94ddd44 100755
--- a/validation/validate-mmcif-file.py
+++ b/validation/validate-mmcif-file.py
@@ -695,6 +695,12 @@ def _main():
         print(f"Writing results of CifCheck to '{opts.out_file}'")
     cifcheck.make_json_output()
 
+    if cifcheck.got_issues():
+        # If CifCheck found issues with the mmCIF file, exit with code 2. Exit
+        # code 1 is reserved for general issues running the command, like "file
+        # not found".
+        sys.exit(2)
+
 
 if __name__ == "__main__":
     _main()
-- 
GitLab