Skip to content

Commit

Permalink
precheck script fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sctop committed Nov 19, 2023
1 parent b1f3ef4 commit 7d58484
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:

# Pre-check the json
- name: Json Precheck
run: python _scripts/json_checker.py
run: python precheck.py
2 changes: 1 addition & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

# Pre-check the json
- name: Json Precheck
run: python _scripts/json_checker.py
run: python precheck.py

# Dispatch the parser
- name: Repository Dispatch
Expand Down
24 changes: 14 additions & 10 deletions _scripts/json_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import uuid
import pprint

filepath = ".."
LOGGER = logging.getLogger()
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
ALL_UUID = []
Expand Down Expand Up @@ -72,13 +71,18 @@ def traverse_path(namespace: list):
traverse_path(namespace + [folder])


traverse_path([filepath])
def run(filepath):
traverse_path([filepath])

if len(ERROR_JSON) != 0:
print("ERROR JSON:")
pprint.pprint(ERROR_JSON)
if len(CONFLICTED_JSON) != 0:
print("CONFLICTED JSON:")
pprint.pprint(CONFLICTED_JSON)
if len(ERROR_JSON) != 0 or len(CONFLICTED_JSON) != 0:
raise AssertionError
if len(ERROR_JSON) != 0:
print("ERROR JSON:")
pprint.pprint(ERROR_JSON)
if len(CONFLICTED_JSON) != 0:
print("CONFLICTED JSON:")
pprint.pprint(CONFLICTED_JSON)
if len(ERROR_JSON) != 0 or len(CONFLICTED_JSON) != 0:
raise AssertionError


if __name__ == "__main__":
run("..")
3 changes: 3 additions & 0 deletions precheck.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import _scripts.json_checker

_scripts.json_checker.run(".")

0 comments on commit 7d58484

Please sign in to comment.