From 2cbbb0d2b810aa892fead920258c29b39c56b9db Mon Sep 17 00:00:00 2001 From: saikrishnama <> Date: Mon, 15 Apr 2024 16:50:16 -0400 Subject: [PATCH] fix lint --- .pre-commit-config.yaml | 37 +++++++++++++++++++++---------------- .tflint.hcl | 3 +-- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c666fcd..a13f703 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,38 +3,43 @@ repos: rev: v1.88.4 hooks: - id: terraform_fmt + name: running terraform fmt + description: Checks if the terraform code format is valid. + stages: [commit] - id: terraform_docs + name: Running Terraform Docs + description: Generates terraform documentation.(Readme File) args: - '--args=--lockfile=false' - '--args=--config=.terraform-docs.yml' - id: terraform_tflint + name: terraform tflint + description: Automatic terraform linting. args: - - --args=--config=.tflint.hcl - # - '--args=--only=terraform_deprecated_index' - # - '--args=--only=terraform_deprecated_interpolation' - # - '--args=--only=terraform_deprecated_index' - # - '--args=--only=terraform_unused_declarations' - # - '--args=--only=terraform_comment_syntax' - # - '--args=--only=terraform_documented_outputs' - # - '--args=--only=terraform_documented_variables' - # - '--args=--only=terraform_typed_variables' - # - '--args=--only=terraform_module_pinned_source' - # - '--args=--only=terraform_naming_convention' - # - '--args=--only=terraform_required_version' - # - '--args=--only=terraform_required_providers' - # - '--args=--only=terraform_standard_module_structure' - # - '--args=--only=terraform_workspace_remote' - # - '--args=--only=terraform_unused_required_providers' + - config=.tflint.hcl + exclude: examples - id: terraform_validate + name: terraform validate + description: Terraform code validator. exclude: examples - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: - id: check-merge-conflict + name: check merge conflict + description: Check for files that contain merge conflict strings. - id: end-of-file-fixer + name: end of file fixer + description: Let's be sure that a new line has been added to the end of the file. - id: trailing-whitespace + name: trailing whitespace + description: Automatically remove trailing whitespace before committing. - id: detect-private-key + name: detect-private-key + description: Detect if any Private key was defined - id: detect-aws-credentials + name: detect-aws-credentials + description: find if any aws credentials are defined in module args: [--allow-missing-credentials] - id: check-yaml name: check yaml diff --git a/.tflint.hcl b/.tflint.hcl index 5c3ec3c..1faf201 100644 --- a/.tflint.hcl +++ b/.tflint.hcl @@ -3,13 +3,12 @@ plugin "aws" { enabled = true - version = "0.21.1" + version = "0.30.0" source = "github.com/terraform-linters/tflint-ruleset-aws" } config { module = true force = false - call_module_type = none } rule "terraform_required_providers" {