terraform-plugin-docs icon indicating copy to clipboard operation
terraform-plugin-docs copied to clipboard

feat: improve error experience, linting, and more

Open lrstanley opened this issue 3 years ago • 2 comments

Hello! This PR has quite a few error related improvements, as well as fixes recommended from golangci-lint. If you'd like me to move the lint related fixes into another PR, I can do that as well.

List of changes:

  • Wrapped quite a few errors, which helps track down the specific logic that had an issue, if a user receives an error.
  • Configure tfexec to redirect stderr returned from the terraform CLI, back to the user. This will give context to errors like "configuration is invalid" where you can't tell what the error is.
    • This will very likely help users in these issues (it helped me when I received the same error):
      • https://github.com/hashicorp/terraform-plugin-docs/issues/169
      • https://github.com/hashicorp/terraform-plugin-docs/issues/167
      • https://github.com/hashicorp/terraform-plugin-docs/issues/136
  • Migrated away from io/ioutil as it has been deprecated since Go 1.16.
  • Fixed a few cases where errors were being masked and not properly handled.
  • Added a golangci-lint configuration file (.golang-ci.yml), which will help with https://github.com/hashicorp/terraform-plugin-docs/issues/144.
  • Simplified and cleaned up quite a few things based off recommendations from golangci-lint.

If there are any adjustments you'd like me to make, I'd be happy to!

lrstanley avatar Aug 12 '22 04:08 lrstanley

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Aug 12 '22 04:08 hashicorp-cla

Any updates?

arslanbekov avatar Aug 31 '22 17:08 arslanbekov