Skip to content

Commit

Permalink
Merge pull request #3 from bagerard/fix_check_dot_warning
Browse files Browse the repository at this point in the history
fix typo in check_dot
  • Loading branch information
bagerard authored Jan 18, 2025
2 parents 5b59b04 + eee9931 commit b87efb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion graphviz_dot_hooks/check_dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
def _verify_dot_rendering(dot_filepath: str) -> Tuple[bool, Optional[str]]:
"""Trying to render it would detect syntax error, there are probably cheaper way to check this
but we aren't really looking after performance here"""
format = "svg"
with tempfile.NamedTemporaryFile(suffix=f".{format}") as tmpf:
try:
# arbitrary render as svg (more generic than png)
# but it doesn't matter much as we are mostly interested in .dot syntax
render("dot", "svg", dot_filepath, outfile=tmpf.name)
render("dot", format, dot_filepath, outfile=tmpf.name)
except CalledProcessError as ex:
return False, str(ex)

Expand Down

0 comments on commit b87efb0

Please sign in to comment.