Skip to content

Add --build-graph option#1411

Merged
miparnisari merged 3 commits intoaws-cloudformation:masterfrom
miparnisari:cmd-graph
Apr 3, 2020
Merged

Add --build-graph option#1411
miparnisari merged 3 commits intoaws-cloudformation:masterfrom
miparnisari:cmd-graph

Conversation

@miparnisari
Copy link
Copy Markdown
Contributor

@miparnisari miparnisari commented Mar 10, 2020

#1391

Description of changes:
Add support for cfn-lint -t mytemplate.json -g. If pydot or pygraphviz are installed, it will output the graph in the same directory as the template linted: mytemplate.json.dot, and then run the linter. If neither of those modules are found, it will print an error but the linting will continue.

TO DO:

  • add test
  • make sure that self._get_argument_value('build_graph', False, False) is correct
  • mytemplate.json.dot looks ugly -> i'm marking this as done but i'm open to ideas

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Copy Markdown
Contributor

@PatMyron PatMyron left a comment

Choose a reason for hiding this comment

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

Not a big deal, but still creates an empty .dot file if those dependencies are missing 🤷‍♂️

This is awesome though!

@miparnisari
Copy link
Copy Markdown
Contributor Author

miparnisari commented Mar 13, 2020

Not a big deal, but still creates an empty .dot file if those dependencies are missing 🤷‍♂️

Ah good catch... it's because of networkx/networkx#3865. Will change the code to protect against this.

@miparnisari miparnisari requested a review from PatMyron March 28, 2020 05:38
@miparnisari miparnisari marked this pull request as ready for review March 28, 2020 05:39
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