-
Notifications
You must be signed in to change notification settings - Fork 89
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
[terraform/utils] Lint terraform variables generation #1102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ethangraham2001 , thank you for this PR. Please find small comments inline.
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--diff", action="store_true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an argument help="..."
and describe the action and make sure the exit code is mentionned.
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--diff", action="store_true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an argument help="..."
and describe the action and make sure the exit code is mentionned.
Could you please add this command to Makefile target: |
`variables.py` file to be run outside of the docker container, and copied over the necessary file needed for running the `--lint` flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ethangraham2001 !
This PR adds a lint stage for checking that locally-stored
.gen.tf
files are the same as the generated output of callingvariables.py
. This is done by adding a new--lint
flag tovariables.py
that checks for differences between the generated output the local files without writing anything out to disk -variables.py --lint
will exit with status code 0 on success, and 1 on failure. Theterraform-lint
section of the top-level makefile is updated to call this accordingly.This is intended to be used as a CI check.
Relates to issue #1084