Skip to content

refactor hcl parser / update commands&outputs for options docs #293

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

Merged
merged 7 commits into from
May 6, 2020

Conversation

boranx
Copy link
Member

@boranx boranx commented Apr 2, 2020

I've just gone through the documentation and found some outdated areas.
This PR updates the documentation

@boranx boranx changed the title update outputs&commands for options docs chore: update outputs&commands for options docs Apr 2, 2020
@boranx boranx changed the title chore: update outputs&commands for options docs chore: update commands&outputs for options docs Apr 2, 2020
docs/options.md Outdated
```

The `--input` flag can also be a good way to see how different input types would be parsed:

```console
conftest parse examples/hcl2/terraform.tf -i hcl2
conftest parse examples/hcl/terraform.tf -i hcl
Copy link
Member

Choose a reason for hiding this comment

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

I think it would better showcase the input flag if the input in the example wasn't the default behavior. If conftest sees a .hcl or .tf file, -i hcl is to be assumed (which is now the hcl2 parser).

I would actually love to see us renaming the terraform parser to hcl, because thats what its really doing.

Then in the examples, we could have hcl and/or hcl2 and/or terraform-hcl1 and/or terraform-hcl2. Not advocating for every single combination, but thats the idea anyway. HCL and HCL2 being the things we parse, and Terraform being an example, but Terraform can be written using HCL1 or HCL2.

Copy link
Member Author

@boranx boranx Apr 4, 2020

Choose a reason for hiding this comment

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

generally agreed, but better to rename terraform to hcl1 instead of hcl. Because the hcl input references to the hcl2. Using hcl here could be confusing

@jpreese
Copy link
Member

jpreese commented Apr 3, 2020

Thanks for putting this together, @boranx!

@boranx boranx changed the title chore: update commands&outputs for options docs refactor hcl parser Apr 4, 2020
@boranx boranx changed the title refactor hcl parser refactor hcl parser / update commands&outputs for options docs Apr 4, 2020
@boranx
Copy link
Member Author

boranx commented Apr 4, 2020

hi @jpreese

so the changes so far:

  • terraform parser is replaced with hcl1
  • testdata/ folder has been removed
  • docs are updated(current version is not working since we don't have hcl2 folder anymore)
  • unknown_extension folder has been created to show the input flag can be used with unknown file types

@jpreese jpreese merged commit 91a97a2 into open-policy-agent:master May 6, 2020
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