Loading hooks/terraform_validate.py +18 −19 Original line number Diff line number Diff line Loading @@ -7,25 +7,24 @@ import sys import hooks.utils def checker(): def check(directory): def tf_validate(directory): if ( hooks.utils.check( hooks.utils.check_directory( ["terraform", "init", "-backend=false"], directory=directory ) > 0 ): return 1 if ( hooks.utils.check(["terraform", "validate"], directory=directory) hooks.utils.check_directory( ["terraform", "validate"], directory=directory ) > 0 ): return 1 return 0 return check def main(): """Main entrypoint.""" Loading @@ -36,7 +35,7 @@ def main(): os.putenv("TF_INPUT", "0") os.putenv("TF_IN_AUTOMATION", "1") return hooks.utils.bulk_check( checker, hooks.utils.unique_directories(args.file) tf_validate, hooks.utils.unique_directories(args.file) ) Loading hooks/utils.py +1 −1 Original line number Diff line number Diff line Loading @@ -85,6 +85,6 @@ def bulk_check(checker, items): returncode = 0 for item in items: check = checker(item) if check() > 0: if check > 0: returncode = 1 return returncode setup.py +2 −1 Original line number Diff line number Diff line from setuptools import setup from setuptools import setup, find_packages with open("VERSION", "r", encoding="utf-8") as fh: VERSION = fh.read().strip() Loading @@ -23,4 +23,5 @@ setup( "poetry-check=hook.poetry_check:main", ] }, packages=find_packages(), ) Loading
hooks/terraform_validate.py +18 −19 Original line number Diff line number Diff line Loading @@ -7,25 +7,24 @@ import sys import hooks.utils def checker(): def check(directory): def tf_validate(directory): if ( hooks.utils.check( hooks.utils.check_directory( ["terraform", "init", "-backend=false"], directory=directory ) > 0 ): return 1 if ( hooks.utils.check(["terraform", "validate"], directory=directory) hooks.utils.check_directory( ["terraform", "validate"], directory=directory ) > 0 ): return 1 return 0 return check def main(): """Main entrypoint.""" Loading @@ -36,7 +35,7 @@ def main(): os.putenv("TF_INPUT", "0") os.putenv("TF_IN_AUTOMATION", "1") return hooks.utils.bulk_check( checker, hooks.utils.unique_directories(args.file) tf_validate, hooks.utils.unique_directories(args.file) ) Loading
hooks/utils.py +1 −1 Original line number Diff line number Diff line Loading @@ -85,6 +85,6 @@ def bulk_check(checker, items): returncode = 0 for item in items: check = checker(item) if check() > 0: if check > 0: returncode = 1 return returncode
setup.py +2 −1 Original line number Diff line number Diff line from setuptools import setup from setuptools import setup, find_packages with open("VERSION", "r", encoding="utf-8") as fh: VERSION = fh.read().strip() Loading @@ -23,4 +23,5 @@ setup( "poetry-check=hook.poetry_check:main", ] }, packages=find_packages(), )