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

ascii-art mode doesn't permit exclusions #47

Open
jlongman opened this issue Oct 12, 2021 · 0 comments
Open

ascii-art mode doesn't permit exclusions #47

jlongman opened this issue Oct 12, 2021 · 0 comments

Comments

@jlongman
Copy link

Hey cool tool! Thanks for this!

I was playing with it and wanted to clean out some noise introduced by a CDK Construct and noticed it wasn't eliminating the types in the ascii version.

Looking here we see ciMode comes from the cmd arguments, but later we see that excludeTypes is only considered in ciMode:

  if (ciMode) {
    if (cmd.excludeTypes && Array.isArray(cmd.excludeTypes)) {
      const filteredTypes = filterConfig.resourceTypesToInclude.filter((type) =>
        shouldFilterFromCiTypeList(type, cmd.excludeTypes)
      );
      filterConfig.resourceTypesToInclude = filteredTypes;
    }
    const xml = renderTemplate(template);
    fs.writeFileSync(cmd.outputFile, xml);
    return;
  }

The ascii-art mode appears to continue silently without indicating the items are not filtered.

If you add the -c option for ci mode then it fails as an unknown option for ascii-art.

infra: (main)$ cfn-diagram  ascii-art -t /code/cdk.json -co /code/cdk.out -s -e AWS::CloudFront::Distribution -c
error: unknown option '-c'
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

No branches or pull requests

1 participant