Skip to content

Conversation

necusjz
Copy link
Member

@necusjz necusjz commented Dec 6, 2024

As #409 will drop tree.json, we don't need to verify it anymore.

Obviously, the performance will be enhanced and Git Hooks will benefits from that.

@necusjz necusjz requested a review from kairu-ms December 6, 2024 06:58
Comment on lines 181 to 190
with open(json_path, "r", encoding="utf-8", errors="ignore") as fp:
model = json.load(fp)
group, command = " ".join(node.names[:-1]), node.names[-1]
for g in model["commandGroups"]:
if g["name"] == group:
if not any(cmd["name"] == command for cmd in g["commands"]):
raise Exception(f"There is no {command} command info in {json_path}.")

break

Copy link
Collaborator

@kairu-ms kairu-ms Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why removed this? It seems the json path is the command model path right? We only remove tree.json file not all json files in aaz repo

raise Exception(f"{curr_grp} defined in {json_path} has command that doesn't exist.")

break

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One potential bug: if the model has sub command group for sub commands and this command group not defined in *.md the will not check those commands

Comment on lines 198 to 202
group.append(model["commandGroups"][0]["name"])
if " ".join(group) == curr_grp:
break

model_set.add(json_path)
model = model["commandGroups"][0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kairu-ms kairu-ms merged commit 8765a1d into Azure:dev Dec 20, 2024
3 checks passed
@kairu-ms kairu-ms mentioned this pull request Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants