terraform-linters / tflint-plugin-sdk

Experimental: TFLint plugin SDK for building custom rules
Mozilla Public License 2.0
17 stars 14 forks source link

How to use a debugger when developing a tflint plugin? #351

Open DBX12 opened 1 week ago

DBX12 commented 1 week ago

This may seem like a stupid question, but how would one use a debugger when developing a plugin with this SDK? I would expect that I have to start the plugin with delve and have tflint connect to it, but I don't see how I could configure tflint to do so. Since it is a plugin, I cannot execute it directly since it will just say that it is a plugin and isn't meant to be executed directly.

wata727 commented 1 week ago

Unfortunately, there is currently no way to use a debugger, so log-based debugging is required.

The Terraform provider has a debugger-based debugging way, so we may be able to use the debugger by introducing a similar mechanism. https://developer.hashicorp.com/terraform/plugin/debugging#debugger-based-debugging