Skip to content

Improve developer experience #134

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

Open
wata727 opened this issue Mar 11, 2025 · 1 comment
Open

Improve developer experience #134

wata727 opened this issue Mar 11, 2025 · 1 comment

Comments

@wata727
Copy link
Member

wata727 commented Mar 11, 2025

The OPA ruleset is developed as a plugin for TFLint, so some features have developer experience issues. For example:

  • Creating the policy directory must be done manually with mkdir ./.tflint.d/policies, and typos in the name will be silently ignored.
  • There is no easy way to check whether the policy you created is actually activated.
  • Tests are enabled by environment variables (TFLINT_OPA_TEST=1) and do not provide detailed reporting on failure.

We need to fix these issues and provide an experience comparable to opa(1) and conftest.

One idea would be to provide a new CLI like tflint-opa and guide users to setup using that.

@KingBain
Copy link

KingBain commented Apr 29, 2025

just adding to this, its a bit of a PIA how tflint handles config paths.
as mentioned here terraform-linters/tflint#1706 (comment)

but I'm finding its the same for the policies folder. I ended to having to set the environment variable for the opa policies folder at the root of the project

export TFLINT_OPA_POLICY_DIR=$(pwd)/.tflint.d/policies
export TFLINT_CONFIG_FILE=$(pwd)/.tflint.hcl 

then
tflint --format=compact --recursive

can be run and function as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants