Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Fixed for v4.3.10 #565

Merged
merged 6 commits into from
Jan 4, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added linter check to ensure list styles are type paragraph
  • Loading branch information
chrismaddalena committed Dec 21, 2024
commit 05376541082ba4d9255331967d369b7502af3df9
9 changes: 9 additions & 0 deletions ghostwriter/modules/reportwriter/base/docx.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,15 @@ def lint(cls, template_loc: str, p_style: str | None) -> Tuple[List[str], List[s
if style == "CodeBlock":
if document_styles[style].type != WD_STYLE_TYPE.PARAGRAPH:
warnings.append("CodeBlock style is not a paragraph style (see documentation)")
if style == "Bullet List":
if document_styles[style].type != WD_STYLE_TYPE.PARAGRAPH:
warnings.append("Bullet List style is not a paragraph style (see documentation)")
if style == "Number List":
if document_styles[style].type != WD_STYLE_TYPE.PARAGRAPH:
warnings.append("Number List style is not a paragraph style (see documentation)")
if style == "List Paragraph":
if document_styles[style].type != WD_STYLE_TYPE.PARAGRAPH:
warnings.append("List Paragraph style is not a paragraph style (see documentation)")
if "Table Grid" not in document_styles:
errors.append("Template is missing a required style (see documentation): Table Grid")
if p_style and p_style not in document_styles:
Expand Down
Loading