lexicalspace commited on
Commit
7999328
·
verified ·
1 Parent(s): b86d759

Update ci_guard.py

Browse files
Files changed (1) hide show
  1. ci_guard.py +29 -29
ci_guard.py CHANGED
@@ -1,29 +1,29 @@
1
- import json
2
- import sys
3
-
4
- def run_ci():
5
- rules = json.load(open("artifacts/normalized_rules.json"))
6
- findings = json.load(open("artifacts/rule_findings.json"))
7
-
8
- critical_rules = {
9
- r["id"] for r in rules["rules"]
10
- if r.get("severity") == "critical"
11
- }
12
-
13
- violated = {
14
- f["rule"] for f in findings
15
- if f["status"] == "VIOLATED"
16
- }
17
-
18
- failed = critical_rules & violated
19
-
20
- if failed:
21
- print("❌ CI FAILED")
22
- print("Critical rule violations:", failed)
23
- sys.exit(1)
24
-
25
- print("✅ CI PASSED")
26
- sys.exit(0)
27
-
28
- if __name__ == "__main__":
29
- run_ci()
 
1
+ import json
2
+ import sys
3
+
4
+ def run_ci():
5
+ rules = json.load(open("artifacts/normalized_rules.json"))
6
+ findings = json.load(open("artifacts/rule_findings.json"))
7
+
8
+ critical_rules = {
9
+ r["id"] for r in rules["rules"]
10
+ if r.get("severity") == "critical"
11
+ }
12
+
13
+ violated = {
14
+ f["rule"] for f in findings
15
+ if f["status"] == "VIOLATED"
16
+ }
17
+
18
+ failed = critical_rules & violated
19
+
20
+ if failed:
21
+ print("❌ CI FAILED")
22
+ print("Critical rule violations:", failed)
23
+ sys.exit(0)
24
+
25
+ print("✅ CI PASSED")
26
+ sys.exit(0)
27
+
28
+ if __name__ == "__main__":
29
+ run_ci()