Skip to content

Conversation

@tsenay
Copy link

@tsenay tsenay commented Aug 4, 2022

I want to create a pre-commit hook for my diagrams. For this use case, it's convenient to allow to set filename and output format via environment variable to make execution predictable.

Thomas Senay added 2 commits August 4, 2022 09:25
if not self._validate_outformat(outformat):
raise ValueError(f'"{outformat}" is not a valid output format')
self.outformat = outformat
self.outformat = os.environ.get('DIAGRAMS_OUTFORMAT', outformat)
Copy link
Owner

Choose a reason for hiding this comment

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

There is a chance to read an invalid outformat in this case.

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