Skip to content

Commit

Permalink
Improve policy generation
Browse files Browse the repository at this point in the history
  • Loading branch information
xiwenc committed Sep 8, 2024
1 parent 68dbef6 commit 5bd36ea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/generate-policies-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,19 @@ def generate_policy_docs(policy_file: str, output_file: str):
del policy["title"]
del policy["description"]
del policy["remediation"]
del policy["custom"]

with open(output_file, "w") as f:
f.write(f"# {title}\n")
f.write(f"{remediation}\n")
f.write(f"## Metadata\n")
f.write(f"## Description\n")
f.write(f"{description}\n")
f.write(f"## Remediation\n")
f.write(f"{remediation}\n")
f.write(f"## Metadata\n")
f.write(f"```yaml\n")
f.write(f"{yaml.dump(policy)}\n")
f.write(f"```\n")
f.write(f"## Test script\n")
f.write(f"## Test cases\n")
f.write(f"```rego\n")
f.write(f"{get_test_file(policy_file)}\n")
f.write(f"```\n")
Expand Down

0 comments on commit 5bd36ea

Please sign in to comment.