Skip to content

Commit

Permalink
Keep table aligned when generating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
drdavella committed Jan 4, 2024
1 parent 7c3ddd5 commit a29515a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/codemodder/scripts/generate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,20 @@ def generate_docs(codemod):
]
markdown_references = "\n".join(formatted_references) or "N/A"

# A bit of a hack but keeps the table aligned
spacing = " " * (len(codemod.review_guidance) - 19)
spacers = "-" * (len(codemod.review_guidance) - 19)

output = f"""---
title: {codemod.summary}
sidebar_position: 1
---
## {codemod.id}
| Importance | Review Guidance | Requires Scanning Tool |
|------------|----------------------------|---------------------|
| {codemod_data.importance} | {codemod.review_guidance} | {codemod_data.need_sarif} |
| Importance | Review Guidance {spacing}| Requires Scanning Tool |
|------------|---------------------{spacers}|------------------------|
| {codemod_data.importance:10} | {codemod.review_guidance:19} | {codemod_data.need_sarif:22} |
{codemod.description}
If you have feedback on this codemod, [please let us know](mailto:[email protected])!
Expand Down

0 comments on commit a29515a

Please sign in to comment.