mercari / hcledit

Go package to edit HCL configuration
MIT License
44 stars 13 forks source link

add customedit function #93

Closed drlau closed 1 year ago

drlau commented 1 year ago

WHAT

This PR adds a CustomEdit function to allow custom functions to be run on the file, to support more detailed edits.

WHY

There are cases where the existing functions do not support the required use case. This includes cases where there's identical provider blocks and we only want to modify one. To support future use cases as well where this may be an issue, I went with a custom function approach. This will require users to know more low level details, but this is meant for more advanced use cases anyway. As such, this will not be added to the CLI tool.

drlau commented 1 year ago

It appears https://golangci.com/ has stopped working. Since testing is working, will ignore it.