-
-
Notifications
You must be signed in to change notification settings - Fork 541
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
Support for OpenTofu #570
Comments
Not sure it makes sense to support non-existent (at least as of yet) tool.
Yep, contributions are defo welcome: https://github.com/antonbabenko/pre-commit-terraform/blob/master/.github/CONTRIBUTING.md |
Opentofu 1.6.0 exists now in alpha 2. |
This issue has been automatically marked as stale because it has been open 30 days |
@RobertKosten Did you make any progress on a PR? |
+1. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hello everyone. Out team forked the project and plan to adopt it for OpenTofu by the end of this week. |
@kvendingoldo Please stop spamming this repository (5 comments and PR during 24 hours)! You've made a fork, but you brag about it so many times like it contains something SO BIG... it is just a fork :) Slava Ukraini! 🇺🇦 |
@antonbabenko are you planning to add the support for Opentofu? there is a stable version now. |
@egarbi An excerpt from what I replied to topicstarter in this regards in the very beginning of this thread: |
Would the preferred route be to adapt |
@adarobin Adapt. --hook-config=binary=<path_to_binary_or_binary_name> Which will add much more flexibility than just adding support for tofu |
While I support the approach, just out of curiosity (and for fun): how many more TF derivatives do you expect to appear in future? 😂 |
@MaxymVlasov as the projects start to diverge over time there might be functionality in one that does not exist in the other so that might start to make a shared hook interesting. That said, I'm willing to make an attempt at it, but I won't have time to start on it for a month or so. |
Good one :D @adarobin roger that. Please let us know when you'll start (in case nobody else will not start before) |
Yep-yep, I fully support the approach. Would've been great if there existed an option to provide such a var or parameter globally to |
By the way, should we re-open this issue as of revived interest and effort? 🤔 |
For that reason it will make more sense to develop the forked version of hook only for opentofu, that won't have any legacy terraform stuff. We kicked off the fork, but haven't deleted old terraform legacy code that is not required for opentofu. |
Right, double the effort instead of contributing 👍🏻 Defo it's the way to go...
"legacy"... okay. Could you please explain what's the modern thing about |
@kvendingoldo many of the hooks in this repo don't even rely on the terraform binary directly. In other words, there is nothing to even fork. For example, you aren't going to make a theoretical |
Yeah, we definitely can change hooks names in 2.0.0 [BREAKING CHANGES] milestone (whenever it will come) to reduce wrong perceptions. If you have any suggestions - please open a separate issue as this one is already overloaded |
Given the |
Thank you for sharing your perspective, and I truly value feedback. My primary aim is to contribute positively to the Terraform/OpenTofu community by sharing improvements that I believe can be beneficial for everyone. If you perceive my engagement in this discussion as promotion of something else, it's ok, you can have this opinion. My original intent was to provide OpenTofu support by git pre-commit hooks. I forked the repository yesterday evening and began adapting hooks for that purpose, and while the differences may currently be minimal, it addressed the specific issue I wanted to resolve collaboratively with others. If you hold reservations about the concept of forks tailored exclusively for OpenTofu without legacy code support (Terraform 0.12/0.13 and so on), I completely understand. Everyone is entitled to their opinions, and I appreciate the diverse perspectives within the community. From my point of view, I think that OpenTofu will have differences and will be better tool with real open source license. From this point of view the fork of hooks at the early stage is a good idea, because I'm not sure that it will make sense to use Terraform for new projects. Also, as I said before, this repo contains a lot of legacy code for old versions of Terraform that is useless for OpenTofu. I'll continue to work on OpenTofu hooks because first of all I'm reaching my goal at project that requires Tofu as a primary IAC tool. Welcome to contribute to OpenTofu hooks without legacy code :) |
@kvendingoldo I see and understand your perspective. It's all fine. It's opensource. Hopefully someday you'll get to the point of giving a proper respect to the source of what your repo is effectively based off of by adding sort of "courtesy of" or "forked from" to the README 😏 Cheers and good luck with your own endeavor in this area. Feel free to contribute and collaborate when you feel necessary. We're open for cooperation 🤝 |
@yermulnik no worries, all links to the original project will be saved. GitHub deleted the link to it after detach. |
Can you perhaps fix the title to avoid misleading (or not leading) people |
My company has recently switched to OpenTofu.
Only because of this hood I have to keep |
It's hardcoded in other hooks too. And I think in fact it's because hooks are tool-specific to some extent. I think it should be feasible to add hook config knob to all hooks where Else, @den-is, it should be easy to PR the Opentofu |
damn.. my bad.. :) I forgot to mention/foresee this suggestion to include in my list of future suggestions. Exactly! Because the binary name is hardcoded in other tools it is not optimal to copy-paste files to accommodate just one tool. At least while they quite similar at this moment in time. My potential imagined solution sounds like this: These pre-commit hooks have to calculate/determine and then set the correct binary for hooks... apparently, this should be done in Or another terragrunt's feature of setting TF binary |
Because there are already clones of this project that target specifically opentofu binary. But I really want to support this project 💛💙 |
Yep, the option for a user to redefine TF binary and path looks best. I can see @antonbabenko already liked this approach by adding his reaction above. Though let's see what @MaxymVlasov says as he's the main dev doing dev work on this project. |
As I wrote above in #570 (comment) :
Also, it can be done as env var too, to set 1 path for all hooks at once. |
As a general comment, in some circumstances it's useful for the user to be able to specify the explicit binary to use when invoking, eg. One way to do this is to have a default setting (in this case |
This issue has been resolved in version 1.90.0 🎉 |
It would be nice if the hooks could support using opentf in addition to terraform. I'm thinking a simple change to using
_BIN
variables and setting those depending on what can be found in thePATH
. I'd be willing to author a PR for that and help maintain that functionality in the future, if it is welcome :-)The text was updated successfully, but these errors were encountered: