# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
repos:
  - repo: https://github.com/antonbabenko/pre-commit-terraform
    rev: v1.52.0
    hooks:
      - id: terraform_fmt
      - id: terraform_tflint
        args:
          - --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
      - id: terraform_validate
  - repo: local
    hooks:
      - id: terraform-readme
        name: terraform-readme
        entry: tools/autodoc/terraform_docs.sh
        language: script
        types: ['terraform']
        exclude: \.terraform\/.*$
        pass_filenames: true
        require_serial: true

# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
repos:
  - repo: https://github.com/antonbabenko/pre-commit-terraform
    rev: v1.52.0
    hooks:
      - id: terraform_fmt
      - id: terraform_tflint
        args:
          - --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
      - id: terraform_validate
  - repo: local
    hooks:
      - id: terraform-readme
        name: terraform-readme
        entry: tools/autodoc/terraform_docs.sh
        language: script
        types: ['terraform']
        exclude: \.terraform\/.*$
        pass_filenames: true
        require_serial: true
  - repo: git://github.com/dnephin/pre-commit-golang
    rev: master
    hooks:
      - id: go-fmt
      - id: go-vet
      - id: go-lint
      - id: go-imports
      - id: go-cyclo
        args: [-over=15]
      - id: validate-toml
      - id: no-go-testing
      - id: golangci-lint
      - id: go-critic
      - id: go-unit-tests
      - id: go-build
      - id: go-mod-tidy

Add suite of golang precommits
Add suite of golang precommits

Source: [pre-commit-golang](https://github.com/dnephin/pre-commit-golang)
