Add terraform_init_upgrade

When working on different branches, terraform provider versions may
differ. Often you forget to run terraform init -upgrade before
your regular terraform commands. This rule lets you fix that.
This commit is contained in:
Felix Uhl 2022-12-15 16:59:55 +01:00
parent ceeaeab94b
commit 60c21dc5a1

View File

@ -0,0 +1,10 @@
from thefuck.shells import shell
from thefuck.utils import for_app
@for_app('terraform')
def match(command):
return 'Inconsistent dependency lock file' in command.output
def get_new_command(command):
return shell.and_('terraform init -upgrade', command.script)