diff --git a/.editorconfig b/.editorconfig index 50b04ac6f..e54d215db 100644 --- a/.editorconfig +++ b/.editorconfig @@ -40,5 +40,8 @@ trim_trailing_whitespace = false [**/inputs-crlf/variables.tf] end_of_line = crlf +[**/outputs-crlf/outputs.tf] +end_of_line = crlf + [Makefile] indent_style = tab diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..87b717516 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,25 @@ +version: 2 +updates: +- package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + # setting this to 0 means only allowing security updates, see https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#open-pull-requests-limit + open-pull-requests-limit: 0 + +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 3 + +- package-ecosystem: docker + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 1 +- package-ecosystem: docker + directory: "/scripts/release" + schedule: + interval: daily + open-pull-requests-limit: 1 diff --git a/.github/scripts/Makefile b/.github/scripts/Makefile new file mode 100644 index 000000000..2e736bbf2 --- /dev/null +++ b/.github/scripts/Makefile @@ -0,0 +1,66 @@ +# Copyright 2024 The terraform-docs Authors. +# +# Licensed under the MIT license (the "License"); you may not +# use this file except in compliance with the License. +# +# You may obtain a copy of the License at the LICENSE file in +# the root directory of this source tree. + +# Project variables +PROJECT_NAME := terraform-docs +PROJECT_OWNER := terraform-docs +DESCRIPTION := generate documentation from Terraform modules in various output formats +PROJECT_URL := https://github.com/$(PROJECT_OWNER)/$(PROJECT_NAME) +LICENSE := MIT + +# Build variables +COMMIT_HASH ?= $(shell git rev-parse --short HEAD 2>/dev/null) +CUR_VERSION ?= $(shell git describe --tags --exact-match 2>/dev/null || git describe --tags 2>/dev/null || echo "v0.0.0-$(COMMIT_HASH)") + +########### +##@ Release + +.PHONY: contributors +contributors: OLD_VERSION ?= "" +contributors: NEW_VERSION ?= "" +contributors: ## generate contributors list + @ $(MAKE) --no-print-directory log-$@ + @ ./contributors.sh "$(OLD_VERSION)" "$(NEW_VERSION)" "1" + +PATTERN = + +# if the last relase was alpha, beta or rc, 'release' target has to used with current +# cycle release. For example if latest tag is v0.8.0-rc.2 and v0.8.0 GA needs to get +# released the following should be executed: "make release version=0.8.0" +.PHONY: release +release: VERSION ?= $(shell echo $(CUR_VERSION) | sed 's/^v//' | awk -F'[ .]' '{print $(PATTERN)}') +release: ## Prepare release + @ $(MAKE) --no-print-directory log-$@ + @ ./release.sh "$(VERSION)" "$(CUR_VERSION)" "1" + +.PHONY: patch +patch: PATTERN = '\$$1\".\"\$$2\".\"\$$3+1' +patch: release ## Prepare Patch release + +.PHONY: minor +minor: PATTERN = '\$$1\".\"\$$2+1\".0\"' +minor: release ## Prepare Minor release + +.PHONY: major +major: PATTERN = '\$$1+1\".0.0\"' +major: release ## Prepare Major release + +######################################################################## +## Self-Documenting Makefile Help ## +## https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html ## +######################################################################## + +######## +##@ Help + +.PHONY: help +help: ## Display this help + @awk -v "col=\033[36m" -v "nocol=\033[0m" ' BEGIN { FS = ":.*##" ; printf "Usage:\n make %s%s\n", col, nocol } /^[a-zA-Z_-]+:.*?##/ { printf " %s%-12s%s %s\n", col, $$1, nocol, $$2 } /^##@/ { printf "\n%s%s%s\n", nocol, substr($$0, 5), nocol } ' $(MAKEFILE_LIST) + +log-%: + @grep -h -E '^$*:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN { FS = ":.*?## " }; { printf "\033[36m==> %s\033[0m\n", $$2 }' diff --git a/.github/scripts/contributors.sh b/.github/scripts/contributors.sh new file mode 100755 index 000000000..a3161d0da --- /dev/null +++ b/.github/scripts/contributors.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +# +# Copyright 2024 The terraform-docs Authors. +# +# Licensed under the MIT license (the "License"); you may not +# use this file except in compliance with the License. +# +# You may obtain a copy of the License at the LICENSE file in +# the root directory of this source tree. + +set -o errexit +set -o pipefail + +if [ -n "$(git status --short)" ]; then + echo "Error: There are untracked/modified changes, commit or discard them before the release." + exit 1 +fi + +OLD_VERSION=${1//v/} +NEW_VERSION=${2//v/} +FROM_MAKEFILE=$3 + +# get closest GA tag, ignore alpha, beta and rc tags +function getClosestVersion() { + for t in $(git tag --sort=-creatordate); do + tag="$t" + if [[ "$tag" == *"-alpha"* ]] || [[ "$tag" == *"-beta"* ]] || [[ "$tag" == *"-rc"* ]]; then + continue + fi + if [ "$tag" == "v${NEW_VERSION}" ]; then + continue + fi + break + done + echo "${tag//v/}" +} +CLOSEST_VERSION=$(getClosestVersion) + +if [ -z "$OLD_VERSION" ]; then + OLD_VERSION="${CLOSEST_VERSION}" +fi + +if [ -z "$OLD_VERSION" ] || [ -z "$NEW_VERSION" ]; then + if [ -z "${FROM_MAKEFILE}" ]; then + echo "Error: refs are missing. e.g. contributors " + else + echo "Error: refs are missing. e.g. 'make contributors OLD_VERSION=x.y.z NEW_VERSION=a.b.c'" + fi + exit 1 +fi + +touch contributors.list + +git log "v${OLD_VERSION}..v${NEW_VERSION}" | +grep ^Author: | +sed 's/ <.*//; s/^Author: //' | +sort | +uniq | +while read -r line; do + name=$(printf %s "$line" | iconv -f utf-8 -t ascii//translit | jq -sRr @uri) + handle=$(curl -fsSL "https://api.github.com/search/users?q=in:name%20${name}" | jq -r '.items[0].login') + if [ "$handle" == "null" ]; then + echo "- @${name}" >> contributors.list + else + echo "- @${handle}" >> contributors.list + fi + sleep 5 +done diff --git a/.github/scripts/release.sh b/.github/scripts/release.sh new file mode 100755 index 000000000..98a7af416 --- /dev/null +++ b/.github/scripts/release.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash +# +# Copyright 2021 The terraform-docs Authors. +# +# Licensed under the MIT license (the "License"); you may not +# use this file except in compliance with the License. +# +# You may obtain a copy of the License at the LICENSE file in +# the root directory of this source tree. + +set -o errexit +set -o pipefail + +if [ -n "$(git status --short)" ]; then + echo "Error: There are untracked/modified changes, commit or discard them before the release." + exit 1 +fi + +RELEASE_FULL_VERSION=${1//v/} +CURRENT_FULL_VERSION=${2//v/} +FROM_MAKEFILE=$3 + +if [ -z "${RELEASE_FULL_VERSION}" ]; then + if [ -z "${FROM_MAKEFILE}" ]; then + echo "Error: VERSION is missing. e.g. ./release.sh " + else + echo "Error: missing value for 'version'. e.g. 'make release VERSION=x.y.z'" + fi + exit 1 +fi + +if [ -z "${CURRENT_FULL_VERSION}" ]; then + COMMIT_HASH=$(git rev-parse --short HEAD 2>/dev/null) + CURRENT_FULL_VERSION=$(git describe --tags --exact-match 2>/dev/null || git describe --tags 2>/dev/null || echo "v0.0.1-${COMMIT_HASH}") +fi +CURRENT_FULL_VERSION=${CURRENT_FULL_VERSION//v/} + +if [ "${RELEASE_FULL_VERSION}" == "${CURRENT_FULL_VERSION}" ]; then + echo "Error: provided version (v${RELEASE_FULL_VERSION}) already exists." + exit 1 +fi + +if [ "$(git describe --tags "v${RELEASE_FULL_VERSION}" 2>/dev/null)" ]; then + echo "Error: provided version (v${RELEASE_FULL_VERSION}) already exists." + exit 1 +fi + +# get closest GA tag, ignore alpha, beta and rc tags +function getClosestVersion() { + for t in $(git tag --sort=-creatordate); do + tag="$t" + if [[ "$tag" == *"-alpha"* ]] || [[ "$tag" == *"-beta"* ]] || [[ "$tag" == *"-rc"* ]]; then + continue + fi + break + done + echo "${tag//v/}" +} +CLOSEST_VERSION=$(getClosestVersion) + +echo "Release Version: v${RELEASE_FULL_VERSION}" +echo "Closest Version: v${CLOSEST_VERSION}" + +RELEASE_VERSION=$(echo $RELEASE_FULL_VERSION | cut -d"-" -f1) +RELEASE_IDENTIFIER=$(echo $RELEASE_FULL_VERSION | cut -d"-" -f2) + +if [[ $RELEASE_VERSION == $RELEASE_IDENTIFIER ]]; then + RELEASE_IDENTIFIER="" +fi + +# Set the released version in README and installation.md +if [[ $RELEASE_IDENTIFIER == "" ]]; then + sed -i -E "s|${CLOSEST_VERSION}|${RELEASE_VERSION}|g" ../../README.md + sed -i -E "s|${CLOSEST_VERSION}|${RELEASE_VERSION}|g" ../../docs/user-guide/installation.md + + echo "Modified: README.md" + echo "Modified: docs/user-guide/installation.md" +fi + +# Set the released version and identifier in version.go +sed -i -E "s|coreVersion([[:space:]]*)= \"(.*)\"|coreVersion\1= \"${RELEASE_VERSION}\"|g" ../../internal/version/version.go +sed -i -E "s|prerelease([[:space:]]*)= \"(.*)\"|prerelease\1= \"${RELEASE_IDENTIFIER}\"|g" ../../internal/version/version.go + +echo "Modified: internal/version/version.go" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 105aa2794..dac45254d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,7 +7,7 @@ on: pull_request: env: - GO_VERSION: "1.16.4" + GO_VERSION: "1.24.2" REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} jobs: @@ -16,10 +16,10 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} @@ -31,10 +31,10 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} @@ -42,7 +42,7 @@ jobs: run: make test - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.out @@ -52,10 +52,10 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} @@ -73,7 +73,7 @@ jobs: - name: Check License headers run: | - GO111MODULE=off go get github.com/google/addlicense + go install github.com/google/addlicense@latest addlicense -check $(find . -type f -name "*.go") addlicense -check $(find . -type f -name "*.sh") @@ -88,34 +88,37 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Login to Docker - uses: docker/login-action@v1 + uses: docker/login-action@v3 if: env.REGISTRY_USERNAME != '' with: registry: quay.io username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - - name: Build 'dev' Docker image - if: "!contains(github.ref, 'refs/heads/master')" - run: make docker - env: - DOCKER_TAG: ${{ github.sha }} - - - name: Build and push 'edge' Docker image + - name: Build and push Docker image if: env.REGISTRY_USERNAME != '' && contains(github.ref, 'refs/heads/master') - run: make docker push - env: - DOCKER_TAG: edge + uses: docker/build-push-action@v6 + with: + outputs: "type=registry,push=true" + platforms: linux/amd64,linux/arm64 + push: true + tags: quay.io/${{ github.event.repository.name }}/terraform-docs:edge publish: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Prepare docs if: contains(github.ref, 'refs/heads/master') diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 0676c1e75..3b73ffacd 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -6,7 +6,7 @@ on: - master env: - GO_VERSION: "1.16.4" + GO_VERSION: "1.24.2" jobs: analyze: @@ -14,15 +14,15 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v3 with: languages: go @@ -30,4 +30,4 @@ jobs: run: make build - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml new file mode 100644 index 000000000..2accf6b1b --- /dev/null +++ b/.github/workflows/prepare-release.yml @@ -0,0 +1,62 @@ +name: prepare-release +run-name: prepare release v${{ github.event.inputs.version }} + +on: + workflow_dispatch: + inputs: + version: + description: "The version to be released" + required: true + type: string + +jobs: + release: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: master + fetch-depth: 0 + token: ${{ secrets.COMMITTER_TOKEN }} + + - name: Get variables + run: | + release_version="${{ inputs.version }}" + echo "release_version=${release_version//v/}" >> "$GITHUB_ENV" + + - name: Prepare v${{ env.release_version }} Release + run: | + make -C .github/scripts release VERSION=${{ env.release_version }} + + - name: Generate commit message + id: commit-message + run: | + if [[ ${{ env.release_version }} == *"-alpha"* ]]; then + echo "release_commit_message=chore: bump version to v${{ env.release_version }}" >> "$GITHUB_ENV" + else + echo "release_commit_message=Release version v${{ env.release_version }}" >> "$GITHUB_ENV" + fi + + - name: Push v${{ env.release_version }} Changes + uses: stefanzweifel/git-auto-commit-action@v5 + env: + GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }} + with: + file_pattern: "README.md docs/user-guide/installation.md internal/version/version.go" + commit_message: "${{ env.release_commit_message }}" + commit_user_name: terraform-docs-bot + commit_user_email: bot@terraform-docs.io + commit_author: "terraform-docs-bot " + + - name: Cut v${{ env.release_version }} Release + if: "!contains(env.release_version, '-alpha')" # skip when starting new release cycle + run: | + git config --global user.name terraform-docs-bot + git config --global user.email bot@terraform-docs.io + + git tag --annotate --message "v${{ env.release_version }} Release" "v${{ env.release_version }}" + git push origin "v${{ env.release_version }}" diff --git a/.github/workflows/prerelease.yaml b/.github/workflows/prerelease.yaml index 5af970f2c..b9b0c8de4 100644 --- a/.github/workflows/prerelease.yaml +++ b/.github/workflows/prerelease.yaml @@ -6,7 +6,7 @@ on: - "v*.*.*-*" env: - GO_VERSION: "1.16.4" + GO_VERSION: "1.24.2" REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} jobs: @@ -15,24 +15,25 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v6 if: env.REGISTRY_USERNAME != '' with: - version: latest - args: release --rm-dist --skip-publish --skip-sign + distribution: goreleaser + version: 1.26.2 + args: release --clean --skip=publish --skip=sign - name: Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: files: dist/terraform-docs-v* @@ -46,16 +47,22 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set version output id: vars - run: echo ::set-output name=tag::${GITHUB_REF:11} # tag name without leading 'v' + run: echo "release_tag=${GITHUB_REF:11}" >> "$GITHUB_ENV" # tag name without leading 'v' + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Login to Docker - uses: docker/login-action@v1 + uses: docker/login-action@v3 if: env.REGISTRY_USERNAME != '' with: registry: quay.io @@ -63,8 +70,11 @@ jobs: password: ${{ secrets.REGISTRY_PASSWORD }} - name: Build and push Docker image - run: make docker push - env: - DOCKER_TAG: ${{ steps.vars.outputs.tag }} - REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + uses: docker/build-push-action@v6 + with: + outputs: "type=registry,push=true" + platforms: linux/amd64,linux/arm64 + push: true + tags: quay.io/${{ github.event.repository.name }}/terraform-docs:${{ steps.vars.outputs.tag }} + + diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 04a7beb7a..68a33e524 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,7 +7,7 @@ on: - "!v*.*.*-*" env: - GO_VERSION: "1.16.4" + GO_VERSION: "1.24.2" REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} jobs: @@ -16,17 +16,29 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Generate Contributors list + id: contributors + run: | + make -C .github/scripts contributors NEW_VERSION=${GITHUB_REF:11} + echo "contributors_list=$(cat .github/scripts/contributors.list | sed -z 's/\n/\\n/g')" >> "$GITHUB_ENV" + - name: Login to Docker - uses: docker/login-action@v1 + uses: docker/login-action@v3 if: env.REGISTRY_USERNAME != '' with: registry: quay.io @@ -34,40 +46,80 @@ jobs: password: ${{ secrets.REGISTRY_PASSWORD }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v6 if: env.REGISTRY_USERNAME != '' with: - version: latest - args: release --rm-dist --skip-sign + distribution: goreleaser + version: 1.26.2 + args: release --clean --skip=sign env: GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }} - - - name: Set version output - id: vars - run: echo ::set-output name=tag::${GITHUB_REF:11} # tag name without leading 'v' - - - name: Update Chocolatey package - run: ./scripts/release/update-choco.sh "${{ steps.vars.outputs.tag }}" - - - name: Update Chocolatey package - uses: drud/action-cross-commit@master - with: - source-folder: scripts/release/chocolatey-package - destination-repository: https://${{ secrets.COMMITTER_USERNAME }}:${{ secrets.COMMITTER_TOKEN }}@github.com/terraform-docs/chocolatey-package - destination-folder: . - destination-branch: main - git-user: terraform-docs-bot - git-user-email: bot@terraform-docs.io - git-commit-message: "Chocolatey update for terraform-docs version v${{ steps.vars.outputs.tag }}" - excludes: README.md:LICENSE:DCO:.git:.github + Contributors: ${{ env.contributors_list }} homebrew: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" + needs: [assets] steps: - name: Bump Homebrew formula version - uses: dawidd6/action-homebrew-bump-formula@v3.8.0 - if: "!contains(github.ref, '-')" # skip prereleases + uses: dawidd6/action-homebrew-bump-formula@v3.11.0 with: token: ${{ secrets.COMMITTER_TOKEN }} formula: terraform-docs + + chocolatey: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + needs: [assets] + steps: + - name: Update Chocolatey package + run: | + # get closest GA tag, ignore alpha, beta and rc tags + function getClosestVersion() { + for t in $(git tag --sort=-creatordate); do + tag="$t" + if [[ "$tag" == *"-alpha"* ]] || [[ "$tag" == *"-beta"* ]] || [[ "$tag" == *"-rc"* ]]; then + continue + fi + if [ "$tag" == "${GITHUB_REF:11}" ]; then + continue + fi + break + done + echo "${tag//v/}" + } + CLOSEST_VERSION=$(getClosestVersion) + + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.COMMITTER_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/terraform-docs/chocolatey-package/dispatches \ + -d "{\ + \"event_type\": \"trigger-workflow\", \ + \"client_payload\": {\ + \"current-version\": \"${CLOSEST_VERSION}\", \ + \"release-version\": \"${GITHUB_REF:11}\" \ + }\ + }" + + gh-actions: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + needs: [assets] + steps: + - name: Update GitHub Actions + run: | + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.COMMITTER_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/terraform-docs/chocolatey-package/dispatches \ + -d "{\ + \"event_type\": \"trigger-workflow\", \ + \"client_payload\": {\ + \"release-version\": \"${GITHUB_REF:11}\" \ + }\ + }" diff --git a/.gitignore b/.gitignore index af3ec5fcf..c2893b06d 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,6 @@ dist/ # website site/ + +# contributors.list +contributors.list diff --git a/.golangci.yml b/.golangci.yml index 5bfffb40b..ff10e07e5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,20 +1,19 @@ run: timeout: 10m - deadline: 5m - - tests: true + tests: false output: - format: tab + formats: + - format: tab linters-settings: - govet: - # report about shadowed variables - check-shadowing: true + # govet: + # # report about shadowed variables + # check-shadowing: true - golint: - # minimal confidence for issues, default is 0.8 - min-confidence: 0.8 + # golint: + # # minimal confidence for issues, default is 0.8 + # min-confidence: 0.8 gofmt: # simplify code: gofmt with `-s` option, true by default @@ -29,9 +28,9 @@ linters-settings: # minimal code complexity to report, 30 by default (but we recommend 10-20) min-complexity: 10 - maligned: - # print struct with more effective memory layout or not, false by default - suggest-new: true + # maligned: + # # print struct with more effective memory layout or not, false by default + # suggest-new: true dupl: # tokens count to trigger issue, 150 by default @@ -52,7 +51,7 @@ linters-settings: # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: # if it's called for subdir of a project it can't find funcs usages. All text editor integrations # with golangci-lint call it on a directory with the changed file. - check-exported: false + exported-fields-are-used: false unparam: # Inspect exported functions, default is false. Set to true if no external program/library imports your code. @@ -91,6 +90,7 @@ linters-settings: locale: US linters: + disable-all: true enable: - megacheck - govet @@ -100,7 +100,7 @@ linters: - goimports - gofmt # We enable this as well as goimports for its simplify mode. - prealloc - - golint + # - golint # deprecated as of upgrading to 1.55.2 - unconvert - misspell - nakedret @@ -123,6 +123,15 @@ issues: - scopelint - unparam - goconst + - path: (.*).go + linters: + - typecheck + + # G306: Expect WriteFile permissions to be 0600 or less + # mainly seen in internal/cli/wrtier.go + - text: "G306:" + linters: + - gosec # - text: "should have a package comment" # linters: @@ -142,8 +151,8 @@ issues: # Default is false. new: false - # Maximum issues count per one linter. Set to 0 to disable. Default is 50. - max-per-linter: 0 + # # Maximum issues count per one linter. Set to 0 to disable. Default is 50. + # max-issues-per-linter: 0 # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. max-same-issues: 0 diff --git a/.goreleaser.yml b/.goreleaser.yml index 80599f180..287ec06a2 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -38,21 +38,68 @@ checksum: snapshot: name_template: "{{ .Tag }}-dev" +release: + github: + owner: terraform-docs + name: terraform-docs + header: | + ## Notable Updates + footer: | + ## Docker images + + - `docker pull quay.io/terraform-docs/terraform-docs:latest` + - `docker pull quay.io/terraform-docs/terraform-docs:{{ .RawVersion }}` + + ## Contributors + + Very special thanks to the contributors. + + {{ .Env.Contributors }} + changelog: sort: asc filters: exclude: - "^docs:" - "^test:" + - "^Merge pull request" + groups: + - title: Dependency updates + regexp: '^.*?(.+)\(deps\)!?:.+$' + order: 300 + - title: "Features" + regexp: '^.*?feat(\(.+\))??!?:.+$' + order: 100 + - title: "Security updates" + regexp: '^.*?sec(\(.+\))??!?:.+$' + order: 150 + - title: "Bug Fixes" + regexp: '^.*?(fix|refactor)(\(.+\))??!?:.+$' + order: 200 + - title: "Chores" + order: 9999 dockers: - dockerfile: scripts/release/Dockerfile image_templates: - - "quay.io/terraform-docs/terraform-docs:latest" - - "quay.io/terraform-docs/terraform-docs:{{ .RawVersion }}" + - "quay.io/terraform-docs/terraform-docs:latest-amd64" + - "quay.io/terraform-docs/terraform-docs:{{ .RawVersion }}-amd64" + use: buildx + build_flag_templates: + - "--pull" + - "--platform=linux/amd64" + - dockerfile: scripts/release/Dockerfile + image_templates: + - "quay.io/terraform-docs/terraform-docs:latest-arm64" + - "quay.io/terraform-docs/terraform-docs:{{ .RawVersion }}-arm64" + use: buildx + build_flag_templates: + - "--pull" + - "--platform=linux/arm64" + goarch: arm64 brews: - - tap: + - repository: owner: terraform-docs name: homebrew-tap commit_author: @@ -64,20 +111,15 @@ brews: test: | system "#{bin}/terraform-docs version" -scoop: - bucket: - owner: terraform-docs - name: scoop-bucket - commit_author: - name: terraform-docs-bot - email: bot@terraform-docs.io - commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}" - url_template: "https://github.com/terraform-docs/terraform-docs/releases/download/{{ .Tag }}/{{ .ArtifactName }}" - homepage: "https://github.com/terraform-docs/" - description: "Generate documentation from Terraform modules in various output formats" - license: MIT - -# Uncomment these lines if you want to experiment with other -# parts of the release process without releasing new binaries. -# release: -# disable: true +scoops: + - repository: + owner: terraform-docs + name: scoop-bucket + commit_author: + name: terraform-docs-bot + email: bot@terraform-docs.io + commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}" + url_template: "https://github.com/terraform-docs/terraform-docs/releases/download/{{ .Tag }}/{{ .ArtifactName }}" + homepage: "https://github.com/terraform-docs/" + description: "Generate documentation from Terraform modules in various output formats" + license: MIT diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 92243bb1d..d1b723576 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ us on [Slack]. ## Development Requirements -- [Go] 1.16+ +- [Go] 1.22+ - [goimports] - [golangci-lint] diff --git a/Dockerfile b/Dockerfile index e1990f98e..c672e88df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ # You may obtain a copy of the License at the LICENSE file in # the root directory of this source tree. -FROM golang:1.16.6-alpine AS builder +FROM docker.io/library/golang:1.24.2-alpine AS builder RUN apk add --update --no-cache make @@ -21,8 +21,11 @@ RUN make build ################ -FROM alpine:3.14.0 +FROM docker.io/library/alpine:3.21.3 -COPY --from=builder /go/src/terraform-docs/bin/linux-amd64/terraform-docs /usr/local/bin/ +# Mitigate CVE-2023-5363 +RUN apk add --no-cache --upgrade "openssl>=3.1.4-r1" + +COPY --from=builder /go/src/terraform-docs/bin/linux-*/terraform-docs /usr/local/bin/ ENTRYPOINT ["terraform-docs"] diff --git a/Makefile b/Makefile index 09e7e27b2..2bf7a9713 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ DOCKER_IMAGE := quay.io/$(PROJECT_OWNER)/$(PROJECT_NAME) DOCKER_TAG ?= $(DEFAULT_TAG) # Binary versions -GOLANGCI_VERSION := v1.38.0 +GOLANGCI_VERSION := v1.55.2 .PHONY: all all: clean verify checkfmt lint test build @@ -69,7 +69,7 @@ lint: ## Run linter .PHONY: staticcheck staticcheck: ## Run staticcheck @ $(MAKE) --no-print-directory log-$@ - $(GO) run honnef.co/go/tools/cmd/staticcheck -- ./... + $(GO) run honnef.co/go/tools/cmd/staticcheck@2025.1.1 -- ./... .PHONY: test test: ## Run tests @@ -109,45 +109,19 @@ docs: ## Generate document of formatter commands @ $(MAKE) --no-print-directory log-$@ $(GORUN) ./scripts/docs/generate.go -########### -##@ Release - -PATTERN = - -# if the last relase was alpha, beta or rc, 'release' target has to used with current -# cycle release. For example if latest tag is v0.8.0-rc.2 and v0.8.0 GA needs to get -# released the following should be executed: "make release version=0.8.0" -.PHONY: release -release: VERSION ?= $(shell echo $(CUR_VERSION) | sed 's/^v//' | awk -F'[ .]' '{print $(PATTERN)}') -release: ## Prepare release - @ $(MAKE) --no-print-directory log-$@ - @ ./scripts/release/release.sh "$(VERSION)" "$(CUR_VERSION)" "1" - -.PHONY: patch -patch: PATTERN = '\$$1\".\"\$$2\".\"\$$3+1' -patch: release ## Prepare Patch release - -.PHONY: minor -minor: PATTERN = '\$$1\".\"\$$2+1\".0\"' -minor: release ## Prepare Minor release - -.PHONY: major -major: PATTERN = '\$$1+1\".0.0\"' -major: release ## Prepare Major release - ########### ##@ Helpers .PHONY: goimports goimports: ## Install goimports ifeq (, $(shell which goimports)) - GO111MODULE=off $(GO) get -u golang.org/x/tools/cmd/goimports + $(GO) install golang.org/x/tools/cmd/goimports@latest endif .PHONY: golangci golangci: ## Install golangci ifeq (, $(shell which golangci-lint)) - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell $(GO) env GOPATH)/bin $(GOLANGCI_VERSION) + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell $(GO) env GOPATH)/bin $(GOLANGCI_VERSION) endif .PHONY: tools @@ -165,27 +139,7 @@ tools: ## Install required tools .PHONY: help help: ## Display this help - @awk \ - -v "col=\033[36m" -v "nocol=\033[0m" \ - ' \ - BEGIN { \ - FS = ":.*##" ; \ - printf "Usage:\n make %s%s\n", col, nocol \ - } \ - /^[a-zA-Z_-]+:.*?##/ { \ - printf " %s%-12s%s %s\n", col, $$1, nocol, $$2 \ - } \ - /^##@/ { \ - printf "\n%s%s%s\n", nocol, substr($$0, 5), nocol \ - } \ - ' $(MAKEFILE_LIST) + @awk -v "col=\033[36m" -v "nocol=\033[0m" ' BEGIN { FS = ":.*##" ; printf "Usage:\n make %s%s\n", col, nocol } /^[a-zA-Z_-]+:.*?##/ { printf " %s%-12s%s %s\n", col, $$1, nocol, $$2 } /^##@/ { printf "\n%s%s%s\n", nocol, substr($$0, 5), nocol } ' $(MAKEFILE_LIST) log-%: - @grep -h -E '^$*:.*?## .*$$' $(MAKEFILE_LIST) | \ - awk \ - 'BEGIN { \ - FS = ":.*?## " \ - }; \ - { \ - printf "\033[36m==> %s\033[0m\n", $$2 \ - }' + @grep -h -E '^$*:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN { FS = ":.*?## " }; { printf "\033[36m==> %s\033[0m\n", $$2 }' diff --git a/README.md b/README.md index 83d350f8a..a2ab6673c 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,6 @@ ![terraform-docs-teaser](./images/terraform-docs-teaser.png) -Sponsored by [Scalr - Terraform Automation & Collaboration Software](https://scalr.com/?utm_source=terraform-docs) - -Scalr - Terraform Automation & Collaboration Software - ## What is terraform-docs A utility to generate documentation from Terraform modules in various output formats. @@ -43,10 +39,10 @@ Stable binaries are also available on the [releases] page. To install, download binary for your platform from "Assets" and place this into your `$PATH`: ```bash -curl -Lo ./terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.16.0/terraform-docs-v0.16.0-$(uname)-amd64.tar.gz +curl -Lo ./terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.20.0/terraform-docs-v0.20.0-$(uname)-amd64.tar.gz tar -xzf terraform-docs.tar.gz chmod +x terraform-docs -mv terraform-docs /usr/local/terraform-docs +mv terraform-docs /usr/local/bin/terraform-docs ``` **NOTE:** Windows releases are in `ZIP` format. @@ -55,12 +51,12 @@ The latest version can be installed using `go install` or `go get`: ```bash # go1.17+ -go install github.com/terraform-docs/terraform-docs@v0.16.0 +go install github.com/terraform-docs/terraform-docs@v0.20.0 ``` ```bash # go1.16 -GO111MODULE="on" go get github.com/terraform-docs/terraform-docs@v0.16.0 +GO111MODULE="on" go get github.com/terraform-docs/terraform-docs@v0.20.0 ``` **NOTE:** please use the latest Go to do this, minimum `go1.16` is required. @@ -92,14 +88,14 @@ terraform-docs can be run as a container by mounting a directory with `.tf` files in it and run the following command: ```bash -docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.16.0 markdown /terraform-docs +docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.20.0 markdown /terraform-docs ``` If `output.file` is not enabled for this module, generated output can be redirected back to a file: ```bash -docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.16.0 markdown /terraform-docs > doc.md +docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.20.0 markdown /terraform-docs > doc.md ``` **NOTE:** Docker tag `latest` refers to _latest_ stable released version and `edge` @@ -119,7 +115,7 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.ref }} @@ -146,7 +142,7 @@ in the root of your Git repo with at least the following content: ```yaml repos: - repo: https://github.com/terraform-docs/terraform-docs - rev: "v0.16.0" + rev: "v0.20.0" hooks: - id: terraform-docs-go args: ["markdown", "table", "--output-file", "README.md", "./mymodule/path"] @@ -184,6 +180,7 @@ footer-from: "" recursive: enabled: false path: modules + include-main: true sections: hide: [] diff --git a/cmd/completion/completion.go b/cmd/completion/completion.go index 1906804c6..1a1b8f83d 100644 --- a/cmd/completion/completion.go +++ b/cmd/completion/completion.go @@ -14,6 +14,7 @@ import ( "github.com/spf13/cobra" "github.com/terraform-docs/terraform-docs/cmd/completion/bash" + "github.com/terraform-docs/terraform-docs/cmd/completion/fish" "github.com/terraform-docs/terraform-docs/cmd/completion/zsh" ) @@ -22,28 +23,40 @@ func NewCommand() *cobra.Command { cmd := &cobra.Command{ Args: cobra.NoArgs, Use: "completion SHELL", - Short: "Generate shell completion code for the specified shell (bash or zsh)", + Short: "Generate shell completion code for the specified shell (bash, zsh, fish)", Long: longDescription, } // subcommands cmd.AddCommand(bash.NewCommand()) cmd.AddCommand(zsh.NewCommand()) + cmd.AddCommand(fish.NewCommand()) return cmd } -const longDescription = `Outputs terraform-doc shell completion for the given shell (bash or zsh) +const longDescription = `Outputs terraform-docs shell completion for the given shell (bash, zsh, fish) This depends on the bash-completion binary. Example installation instructions: # for bash users - $ terraform-doc completion bash > ~/.terraform-doc-completion - $ source ~/.terraform-doc-completion + $ terraform-docs completion bash > ~/.terraform-docs-completion + $ source ~/.terraform-docs-completion + + # or the one-liner below + + $ source <(terraform-docs completion bash) # for zsh users - % terraform-doc completion zsh > /usr/local/share/zsh/site-functions/_terraform-doc + % terraform-docs completion zsh > /usr/local/share/zsh/site-functions/_terraform-docs % autoload -U compinit && compinit # or if zsh-completion is installed via homebrew - % terraform-doc completion zsh > "${fpath[1]}/_terraform-doc" + % terraform-docs completion zsh > "${fpath[1]}/_terraform-docs" + +# for ohmyzsh + $ terraform-docs completion zsh > ~/.oh-my-zsh/completions/_terraform-docs + $ omz reload + +# for fish users + $ terraform-docs completion fish > ~/.config/fish/completions/terraform-docs.fish Additionally, you may want to output the completion to a file and source in your .bashrc Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2 diff --git a/cmd/completion/fish/fish.go b/cmd/completion/fish/fish.go new file mode 100644 index 000000000..a7e2e3876 --- /dev/null +++ b/cmd/completion/fish/fish.go @@ -0,0 +1,30 @@ +/* +Copyright 2021 The terraform-docs Authors. + +Licensed under the MIT license (the "License"); you may not +use this file except in compliance with the License. + +You may obtain a copy of the License at the LICENSE file in +the root directory of this source tree. +*/ + +package fish + +import ( + "os" + + "github.com/spf13/cobra" +) + +// NewCommand returns a new cobra.Command for 'completion fish' command +func NewCommand() *cobra.Command { + cmd := &cobra.Command{ + Args: cobra.NoArgs, + Use: "fish", + Short: "Generate shell completion for fish", + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Parent().Parent().GenFishCompletion(os.Stdout, true) + }, + } + return cmd +} diff --git a/cmd/root.go b/cmd/root.go index f1bfee6d8..722e7a28a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -62,6 +62,7 @@ func NewCommand() *cobra.Command { cmd.PersistentFlags().StringVarP(&config.File, "config", "c", ".terraform-docs.yml", "config file name") cmd.PersistentFlags().BoolVar(&config.Recursive.Enabled, "recursive", false, "update submodules recursively (default false)") cmd.PersistentFlags().StringVar(&config.Recursive.Path, "recursive-path", "modules", "submodules path to recursively update") + cmd.PersistentFlags().BoolVar(&config.Recursive.IncludeMain, "recursive-include-main", true, "include the main module") cmd.PersistentFlags().StringSliceVar(&config.Sections.Show, "show", []string{}, "show section ["+print.AllSections+"]") cmd.PersistentFlags().StringSliceVar(&config.Sections.Hide, "hide", []string{}, "hide section ["+print.AllSections+"]") diff --git a/docs/how-to/generate-terraform-tfvars.md b/docs/how-to/generate-terraform-tfvars.md index fe0f126a0..14508c152 100644 --- a/docs/how-to/generate-terraform-tfvars.md +++ b/docs/how-to/generate-terraform-tfvars.md @@ -4,7 +4,7 @@ description: "How to generate terraform.tfvars file with terraform-docs" menu: docs: parent: "how-to" -weight: 207 +weight: 208 toc: false --- diff --git a/docs/how-to/github-action.md b/docs/how-to/github-action.md index a23c16844..95549956d 100644 --- a/docs/how-to/github-action.md +++ b/docs/how-to/github-action.md @@ -4,7 +4,7 @@ description: "How to use terraform-docs with GitHub Actions" menu: docs: parent: "how-to" -weight: 208 +weight: 209 toc: false --- @@ -20,7 +20,7 @@ jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.ref }} diff --git a/docs/how-to/ignore-resources.md b/docs/how-to/ignore-resources.md new file mode 100644 index 000000000..0367c3dde --- /dev/null +++ b/docs/how-to/ignore-resources.md @@ -0,0 +1,74 @@ +--- +title: "Ignore Resources to be Generated" +description: "How to ignore resources from generated output" +menu: + docs: + parent: "how-to" +weight: 204 +toc: false +--- + +Since `v0.18.0` + +Any type of resources can be ignored from the generated output by prepending them +with a comment `terraform-docs-ignore`. Supported type of Terraform resources to +get ignored are: + +- `resource` +- `data` +- `module` +- `variable` +- `output` + +{{< alert type="info" >}} +If a `resource` or `data` is ignored, their corresponding discovered provider +will also get ignored from "Providers" section. +{{< /alert>}} + +Take the following example: + +```hcl +################################################################## +# All of the following will be ignored from the generated output # +################################################################## + +# terraform-docs-ignore +resource "foo_resource" "foo" {} + +# This resource is going to get ignored from generated +# output by using the following known comment. +# +# terraform-docs-ignore +# +# The ignore keyword also doesn't have to be the first, +# last, or the only thing in a leading comment +resource "bar_resource" "bar" {} + +# terraform-docs-ignore +data "foo_data_resource" "foo" {} + +# terraform-docs-ignore +data "bar_data_resource" "bar" {} + +// terraform-docs-ignore +module "foo" { + source = "foo" + version = "x.x.x" +} + +# terraform-docs-ignore +variable "foo" { + default = "foo" +} + +// terraform-docs-ignore +output "foo" { + value = "foo" +} +``` + +{{< alert type="info" >}} +The ignore keyword (i.e. `terraform-docs-ignore`) doesn't have to be the first, +last, or only thing in a leading comment. As long as the keyword is present in +a comment, the following resource will get ignored. +{{< /alert>}} diff --git a/docs/how-to/include-examples.md b/docs/how-to/include-examples.md index fb1965e61..557627e03 100644 --- a/docs/how-to/include-examples.md +++ b/docs/how-to/include-examples.md @@ -4,7 +4,7 @@ description: "How to include example in terraform-docs generated output" menu: docs: parent: "how-to" -weight: 205 +weight: 206 toc: false --- diff --git a/docs/how-to/insert-output-to-file.md b/docs/how-to/insert-output-to-file.md index 54f11a0ba..1c4e2bdc1 100644 --- a/docs/how-to/insert-output-to-file.md +++ b/docs/how-to/insert-output-to-file.md @@ -4,14 +4,14 @@ description: "How to insert generated terraform-docs output to file" menu: docs: parent: "how-to" -weight: 204 +weight: 205 toc: false --- Since `v0.12.0` -Generated output can be insterted directly into the file. There are two modes of -insersion: `inject` (default) or `replace`. Take a look at [output] configuration +Generated output can be inserted directly into the file. There are two modes of +insertion: `inject` (default) or `replace`. Take a look at [output] configuration for all the details. ```bash diff --git a/docs/how-to/pre-commit-hooks.md b/docs/how-to/pre-commit-hooks.md index 91f093cda..98ae84800 100644 --- a/docs/how-to/pre-commit-hooks.md +++ b/docs/how-to/pre-commit-hooks.md @@ -4,7 +4,7 @@ description: "How to use pre-commit hooks with terraform-docs" menu: docs: parent: "how-to" -weight: 209 +weight: 210 toc: false --- @@ -76,7 +76,7 @@ done ``` {{< alert type="warning" >}} -This is very basic and higly simplified version of [pre-commit-terraform](https://github.com/antonbabenko/pre-commit-terraform). +This is very basic and highly simplified version of [pre-commit-terraform](https://github.com/antonbabenko/pre-commit-terraform). Please refer to it for complete examples and guides. {{< /alert >}} diff --git a/docs/how-to/recursive-submodules.md b/docs/how-to/recursive-submodules.md index 29b9c2295..19d45b30b 100644 --- a/docs/how-to/recursive-submodules.md +++ b/docs/how-to/recursive-submodules.md @@ -4,13 +4,13 @@ description: "How to generate submodules documentation recursively with terrafor menu: docs: parent: "how-to" -weight: 206 +weight: 207 toc: false --- Since `v0.15.0` -Considering the file strucutre below of main module and its submodules, it is +Considering the file structure below of main module and its submodules, it is possible to generate documentation for the main and all its submodules in one execution, with `--recursive` flag. @@ -22,6 +22,10 @@ set. Path to find submodules can be configured with `--recursive-path` (defaults to `modules`). +The main module document is generated by default, which can be configured with +`--recursive-include-main`. Should the main module document be excluded from +document generation, use `--recursive-include-main=false`. + Each submodule can also have their own `.terraform-docs.yml` config file, to override configuration from root module. diff --git a/docs/reference/asciidoc-document.md b/docs/reference/asciidoc-document.md index 0d26d6d44..fa78b03a3 100644 --- a/docs/reference/asciidoc-document.md +++ b/docs/reference/asciidoc-document.md @@ -42,6 +42,7 @@ terraform-docs asciidoc document [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --required show Required column or section (default true) --sensitive show Sensitive column or section (default true) diff --git a/docs/reference/asciidoc-table.md b/docs/reference/asciidoc-table.md index b343f9660..3898e924a 100644 --- a/docs/reference/asciidoc-table.md +++ b/docs/reference/asciidoc-table.md @@ -42,6 +42,7 @@ terraform-docs asciidoc table [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --required show Required column or section (default true) --sensitive show Sensitive column or section (default true) diff --git a/docs/reference/asciidoc.md b/docs/reference/asciidoc.md index 783a32749..0ed611faa 100644 --- a/docs/reference/asciidoc.md +++ b/docs/reference/asciidoc.md @@ -45,6 +45,7 @@ terraform-docs asciidoc [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --show strings show section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --sort sort items (default true) diff --git a/docs/reference/json.md b/docs/reference/json.md index fe4583e20..840dfcd9f 100644 --- a/docs/reference/json.md +++ b/docs/reference/json.md @@ -39,6 +39,7 @@ terraform-docs json [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --show strings show section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --sort sort items (default true) diff --git a/docs/reference/markdown-document.md b/docs/reference/markdown-document.md index b614611ee..2c18f3551 100644 --- a/docs/reference/markdown-document.md +++ b/docs/reference/markdown-document.md @@ -44,6 +44,7 @@ terraform-docs markdown document [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --required show Required column or section (default true) --sensitive show Sensitive column or section (default true) diff --git a/docs/reference/markdown-table.md b/docs/reference/markdown-table.md index f3775a859..64b4ce7fa 100644 --- a/docs/reference/markdown-table.md +++ b/docs/reference/markdown-table.md @@ -44,6 +44,7 @@ terraform-docs markdown table [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --required show Required column or section (default true) --sensitive show Sensitive column or section (default true) @@ -147,15 +148,15 @@ generates the following output: | [bool-2](#input\_bool-2) | It's bool number two. | `bool` | `false` | no | | [bool-3](#input\_bool-3) | n/a | `bool` | `true` | no | | [bool\_default\_false](#input\_bool\_default\_false) | n/a | `bool` | `false` | no | - | [input-with-code-block](#input\_input-with-code-block) | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| no | + | [input-with-code-block](#input\_input-with-code-block) | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| no | | [input-with-pipe](#input\_input-with-pipe) | It includes v1 \| v2 \| v3 | `string` | `"v1"` | no | | [input\_with\_underscores](#input\_input\_with\_underscores) | A variable with underscores. | `any` | n/a | yes | - | [list-1](#input\_list-1) | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| no | + | [list-1](#input\_list-1) | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| no | | [list-2](#input\_list-2) | It's list number two. | `list` | n/a | yes | | [list-3](#input\_list-3) | n/a | `list` | `[]` | no | | [list\_default\_empty](#input\_list\_default\_empty) | n/a | `list(string)` | `[]` | no | - | [long\_type](#input\_long\_type) | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| no | - | [map-1](#input\_map-1) | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| no | + | [long\_type](#input\_long\_type) | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| no | + | [map-1](#input\_map-1) | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| no | | [map-2](#input\_map-2) | It's map number two. | `map` | n/a | yes | | [map-3](#input\_map-3) | n/a | `map` | `{}` | no | | [no-escape-default-value](#input\_no-escape-default-value) | The description contains `something_with_underscore`. Defaults to 'VALUE\_WITH\_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | no | diff --git a/docs/reference/markdown.md b/docs/reference/markdown.md index ab947d29f..fb3ecb64a 100644 --- a/docs/reference/markdown.md +++ b/docs/reference/markdown.md @@ -47,6 +47,7 @@ terraform-docs markdown [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --show strings show section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --sort sort items (default true) diff --git a/docs/reference/pretty.md b/docs/reference/pretty.md index d3e798d6a..401feca76 100644 --- a/docs/reference/pretty.md +++ b/docs/reference/pretty.md @@ -39,6 +39,7 @@ terraform-docs pretty [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --show strings show section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --sort sort items (default true) diff --git a/docs/reference/terraform-docs.md b/docs/reference/terraform-docs.md index ccc71e536..1864b2d8c 100644 --- a/docs/reference/terraform-docs.md +++ b/docs/reference/terraform-docs.md @@ -33,6 +33,7 @@ terraform-docs [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --show strings show section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --sort sort items (default true) diff --git a/docs/reference/tfvars-hcl.md b/docs/reference/tfvars-hcl.md index 7abc874a8..cde879ac1 100644 --- a/docs/reference/tfvars-hcl.md +++ b/docs/reference/tfvars-hcl.md @@ -39,6 +39,7 @@ terraform-docs tfvars hcl [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --show strings show section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --sort sort items (default true) diff --git a/docs/reference/tfvars-json.md b/docs/reference/tfvars-json.md index 0354b356a..d48e08b46 100644 --- a/docs/reference/tfvars-json.md +++ b/docs/reference/tfvars-json.md @@ -38,6 +38,7 @@ terraform-docs tfvars json [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --show strings show section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --sort sort items (default true) diff --git a/docs/reference/tfvars.md b/docs/reference/tfvars.md index 38834dc9b..756a48338 100644 --- a/docs/reference/tfvars.md +++ b/docs/reference/tfvars.md @@ -34,6 +34,7 @@ Generate terraform.tfvars of inputs. --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --show strings show section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --sort sort items (default true) diff --git a/docs/reference/toml.md b/docs/reference/toml.md index a0c649d72..f47c17320 100644 --- a/docs/reference/toml.md +++ b/docs/reference/toml.md @@ -38,6 +38,7 @@ terraform-docs toml [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --show strings show section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --sort sort items (default true) diff --git a/docs/reference/xml.md b/docs/reference/xml.md index 633f12472..f89869698 100644 --- a/docs/reference/xml.md +++ b/docs/reference/xml.md @@ -38,6 +38,7 @@ terraform-docs xml [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --show strings show section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --sort sort items (default true) diff --git a/docs/reference/yaml.md b/docs/reference/yaml.md index 577de597f..ff468e63a 100644 --- a/docs/reference/yaml.md +++ b/docs/reference/yaml.md @@ -38,6 +38,7 @@ terraform-docs yaml [PATH] [flags] --output-values-from string inject output values from file into outputs (default "") --read-comments use comments as description when description is empty (default true) --recursive update submodules recursively (default false) + --recursive-include-main include the main module (default true) --recursive-path string submodules path to recursively update (default "modules") --show strings show section [all, data-sources, footer, header, inputs, modules, outputs, providers, requirements, resources] --sort sort items (default true) diff --git a/docs/user-guide/configuration.md b/docs/user-guide/configuration.md index 9f0b06ce3..51528b6f8 100644 --- a/docs/user-guide/configuration.md +++ b/docs/user-guide/configuration.md @@ -79,6 +79,7 @@ footer-from: "" recursive: enabled: false path: modules + include-main: true sections: hide: [] diff --git a/docs/user-guide/configuration/content.md b/docs/user-guide/configuration/content.md index fff5f0d53..39eb19806 100644 --- a/docs/user-guide/configuration/content.md +++ b/docs/user-guide/configuration/content.md @@ -42,7 +42,7 @@ over the `content`. - `{{ include "relative/path/to/file" }}` -Additionally there's also one extra special variable avaialble to the `content`: +Additionally there's also one extra special variable available to the `content`: - `{{ .Module }}` @@ -69,7 +69,13 @@ content: |- {{ .Header }} - and even in between sections + and even in between sections. also spaces will be preserved: + + - item 1 + - item 1-1 + - item 1-2 + - item 2 + - item 3 {{ .Providers }} @@ -133,4 +139,4 @@ content: |- {{- end }} ``` -[Terraform module]: https://pkg.go.dev/github.com/terraform-docs/terraform-docs/terraform#Module \ No newline at end of file +[Terraform module]: https://pkg.go.dev/github.com/terraform-docs/terraform-docs/terraform#Module diff --git a/docs/user-guide/configuration/footer-from.md b/docs/user-guide/configuration/footer-from.md index 6a425fa84..960141b70 100644 --- a/docs/user-guide/configuration/footer-from.md +++ b/docs/user-guide/configuration/footer-from.md @@ -11,14 +11,14 @@ toc: true Since `v0.12.0` Relative path to a file to extract footer for the generated output from. Supported -file formats are `.adoc`, `.md`, `.tf`, and `.txt`. +file formats are `.adoc`, `.md`, `.tf`, `.tofu`, and `.txt`. {{< alert type="info" >}} The whole file content is being extracted as module footer when extracting from `.adoc`, `.md`, or `.txt`. {{< /alert >}} -To extract footer from `.tf` file you need to use following javascript, c, or java +To extract footer from `.tf` or `.tofu` file you need to use following javascript, c, or java like multi-line comment. ```tf @@ -37,7 +37,7 @@ resource "foo" "bar" { ... } ``` {{< alert type="info" >}} -This comment must start at the immediate first line of the `.tf` file +This comment must start at the immediate first line of the `.tf` or `.tofu` file before any `resource`, `variable`, `module`, etc. {{< /alert >}} diff --git a/docs/user-guide/configuration/header-from.md b/docs/user-guide/configuration/header-from.md index b5f016ef0..2ab4a0b60 100644 --- a/docs/user-guide/configuration/header-from.md +++ b/docs/user-guide/configuration/header-from.md @@ -11,14 +11,14 @@ toc: true Since `v0.10.0` Relative path to a file to extract header for the generated output from. Supported -file formats are `.adoc`, `.md`, `.tf`, and `.txt`. +file formats are `.adoc`, `.md`, `.tf`, `.tofu`, and `.txt`. {{< alert type="info" >}} The whole file content is being extracted as module header when extracting from `.adoc`, `.md`, or `.txt`. {{< /alert >}} -To extract header from `.tf` file you need to use following javascript, c, or java +To extract header from `.tf` or `.tofu` file you need to use following javascript, c, or java like multi-line comment. ```tf @@ -37,7 +37,7 @@ resource "foo" "bar" { ... } ``` {{< alert type="info" >}} -This comment must start at the immediate first line of the `.tf` file +This comment must start at the immediate first line of the `.tf` or `.tofu` file before any `resource`, `variable`, `module`, etc. {{< /alert >}} diff --git a/docs/user-guide/configuration/output.md b/docs/user-guide/configuration/output.md index ed9278606..77f0f662e 100644 --- a/docs/user-guide/configuration/output.md +++ b/docs/user-guide/configuration/output.md @@ -99,7 +99,7 @@ output: ## Examples -Inject the generated output into `README.md` between the sorrounding comments. +Inject the generated output into `README.md` between the surrounding comments. ```yaml output: diff --git a/docs/user-guide/configuration/recursive.md b/docs/user-guide/configuration/recursive.md index 1ccf4c885..ab1a25184 100644 --- a/docs/user-guide/configuration/recursive.md +++ b/docs/user-guide/configuration/recursive.md @@ -32,6 +32,7 @@ Available options with their default values. recursive: enabled: false path: modules + include-main: true ``` ## Examples @@ -50,3 +51,12 @@ recursive: enabled: true path: submodules-folder ``` + +Skip the main module document, and only generate documents for submodules. + +```yaml +recursive: + enabled: true + path: submodules-folder + include-main: false +``` diff --git a/docs/user-guide/installation.md b/docs/user-guide/installation.md index adec7b1c7..4f6586f1b 100644 --- a/docs/user-guide/installation.md +++ b/docs/user-guide/installation.md @@ -51,14 +51,14 @@ terraform-docs can be run as a container by mounting a directory with `.tf` files in it and run the following command: ```bash -docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.16.0 markdown /terraform-docs +docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.20.0 markdown /terraform-docs ``` If `output.file` is not enabled for this module, generated output can be redirected back to a file: ```bash -docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.16.0 markdown /terraform-docs > doc.md +docker run --rm --volume "$(pwd):/terraform-docs" -u $(id -u) quay.io/terraform-docs/terraform-docs:0.20.0 markdown /terraform-docs > doc.md ``` {{< alert type="primary" >}} @@ -73,7 +73,7 @@ Stable binaries are available on the GitHub [Release] page. To install, download the file for your platform from "Assets" and place it into your `$PATH`: ```bash -curl -sSLo ./terraform-docs.tar.gz https://terraform-docs.io/dl/v0.16.0/terraform-docs-v0.16.0-$(uname)-amd64.tar.gz +curl -sSLo ./terraform-docs.tar.gz https://terraform-docs.io/dl/v0.20.0/terraform-docs-v0.20.0-$(uname)-amd64.tar.gz tar -xzf terraform-docs.tar.gz chmod +x terraform-docs mv terraform-docs /some-dir-in-your-PATH/terraform-docs @@ -89,12 +89,12 @@ The latest version can be installed using `go install` or `go get`: ```bash # go1.17+ -go install github.com/terraform-docs/terraform-docs@v0.16.0 +go install github.com/terraform-docs/terraform-docs@v0.20.0 ``` ```bash # go1.16 -GO111MODULE="on" go get github.com/terraform-docs/terraform-docs@v0.16.0 +GO111MODULE="on" go get github.com/terraform-docs/terraform-docs@v0.20.0 ``` {{< alert type="warning" >}} @@ -138,11 +138,24 @@ source <(terraform-docs completion bash) ### zsh -```bash +```zsh terraform-docs completion zsh > /usr/local/share/zsh/site-functions/_terraform-docs autoload -U compinit && compinit ``` +### ohmyzsh + +```zsh +terraform-docs completion zsh > ~/.oh-my-zsh/completions/_terraform-docs +omz reload +``` + +### fish + +```fish +terraform-docs completion fish > ~/.config/fish/completions/terraform-docs.fish +``` + To make this change permanent, the above commands can be added to `~/.profile` file. [Chocolatey]: https://www.chocolatey.org diff --git a/examples/.terraform-docs.yml b/examples/.terraform-docs.yml index 11c9ca868..7d690700c 100644 --- a/examples/.terraform-docs.yml +++ b/examples/.terraform-docs.yml @@ -2,8 +2,7 @@ # version: ">= 0.10, < 0.12" # see: https://terraform-docs.io/user-guide/configuration/formatter -# formatter: markdown table -formatter: template +formatter: markdown table # see: https://terraform-docs.io/user-guide/configuration/header-from header-from: doc.txt @@ -15,6 +14,7 @@ footer-from: footer.md # recursive: # enabled: false # path: modules +# include-main: false # see: https://terraform-docs.io/user-guide/configuration/sections sections: @@ -31,7 +31,13 @@ sections: # # {{ .Header }} # -# and even in between sections +# and even in between sections. also spaces will be preserved: +# +# - item 1 +# - item 1-1 +# - item 1-2 +# - item 2 +# - item 3 # # ## Resources # {{ range .Module.Resources }} diff --git a/examples/main.tf b/examples/main.tf index 8b31f0403..a800ffa46 100644 --- a/examples/main.tf +++ b/examples/main.tf @@ -63,8 +63,20 @@ data "aws_caller_identity" "ident" { provider = "aws.ident" } +# terraform-docs-ignore +data "aws_caller_identity" "ignored" { + provider = "aws" +} + resource "null_resource" "foo" {} +# This resource is going to get ignored from generated +# output by using the following known comment. +# terraform-docs-ignore +# And the ignore keyword also doesn't have to be the first, +# last, or only thing in a leading comment +resource "null_resource" "ignored" {} + module "bar" { source = "baz" version = "4.5.6" @@ -84,3 +96,9 @@ module "baz" { module "foobar" { source = "git@github.com:module/path?ref=v7.8.9" } + +// terraform-docs-ignore +module "ignored" { + source = "foobaz" + version = "7.8.9" +} diff --git a/examples/outputs.tf b/examples/outputs.tf index 5bc3fefe5..e49538296 100644 --- a/examples/outputs.tf +++ b/examples/outputs.tf @@ -17,3 +17,8 @@ output "output-0.12" { value = join(",", var.list-3) description = "terraform 0.12 only" } + +// terraform-docs-ignore +output "ignored" { + value = "ignored" +} diff --git a/examples/variables.tf b/examples/variables.tf index b58e27cc9..bafab8fef 100644 --- a/examples/variables.tf +++ b/examples/variables.tf @@ -14,6 +14,11 @@ variable "bool-1" { default = true } +# terraform-docs-ignore +variable "ignored" { + default = "" +} + variable "string-3" { default = "" } diff --git a/format/doc.go b/format/doc.go index b1a1ec8fe..ad71c2490 100644 --- a/format/doc.go +++ b/format/doc.go @@ -10,35 +10,35 @@ the root directory of this source tree. // Package format provides different, out of the box supported, output format types. // -// Usage +// # Usage // // A specific format can be instantiated either with `format.New()` function or // directly calling its function (e.g. `NewMarkdownTable`, etc) // -// config := print.DefaultConfig() -// config.Formatter = "markdown table" +// config := print.DefaultConfig() +// config.Formatter = "markdown table" // -// formatter, err := format.New(config) -// if err != nil { -// return err -// } +// formatter, err := format.New(config) +// if err != nil { +// return err +// } // -// err := formatter.Generate(tfmodule) -// if err != nil { -// return err -// } +// err := formatter.Generate(tfmodule) +// if err != nil { +// return err +// } // -// output, err := formatter.Render"") -// if err != nil { -// return err -// } +// output, err := formatter.Render"") +// if err != nil { +// return err +// } // // Note: if you don't intend to provide additional template for the generated // content, or the target format doesn't provide templating (e.g. json, yaml, // xml, or toml) you can use `Content()` function instead of `Render)`. Note // that `Content()` returns all the sections combined with predefined order. // -// output := formatter.Content() +// output := formatter.Content() // // Supported formats are: // @@ -53,5 +53,4 @@ the root directory of this source tree. // • `NewTOML` // • `NewXML` // • `NewYAML` -// package format diff --git a/format/generator.go b/format/generator.go index baf4c7b46..c3a431e41 100644 --- a/format/generator.go +++ b/format/generator.go @@ -135,6 +135,8 @@ type generator struct { // newGenerator returns a generator for specific formatter name and with // provided sets of GeneratorFunc functions to build and add individual // sections. +// +//nolint:unparam func newGenerator(config *print.Config, canRender bool, fns ...generateFunc) *generator { g := &generator{ config: config, @@ -209,7 +211,7 @@ func (g *generator) Render(tpl string) (string, error) { }) tt.CustomFunc(gotemplate.FuncMap{ "include": func(s string) string { - content, err := os.ReadFile(filepath.Join(g.path, s)) + content, err := os.ReadFile(filepath.Join(g.path, filepath.Clean(s))) if err != nil { panic(err) } diff --git a/format/generator_test.go b/format/generator_test.go index baa7af2b5..32c92357a 100644 --- a/format/generator_test.go +++ b/format/generator_test.go @@ -11,7 +11,7 @@ the root directory of this source tree. package format import ( - "io/ioutil" + "os" "path/filepath" "testing" @@ -182,7 +182,7 @@ func TestGeneratorFuncModule(t *testing.T) { generator := newGenerator(config, true, withModule(module)) path := filepath.Join("..", "terraform", "testdata", "expected", "full-example-mainTf-Header.golden") - data, err := ioutil.ReadFile(path) + data, err := os.ReadFile(path) assert.Nil(err) @@ -191,7 +191,7 @@ func TestGeneratorFuncModule(t *testing.T) { assert.Equal(expected, generator.module.Header) assert.Equal("", generator.module.Footer) assert.Equal(7, len(generator.module.Inputs)) - assert.Equal(3, len(generator.module.Outputs)) + assert.Equal(4, len(generator.module.Outputs)) }) } diff --git a/format/pretty.go b/format/pretty.go index 77767738e..68f51e206 100644 --- a/format/pretty.go +++ b/format/pretty.go @@ -35,8 +35,9 @@ type pretty struct { // NewPretty returns new instance of Pretty. func NewPretty(config *print.Config) Type { tt := template.New(config, &template.Item{ - Name: "pretty", - Text: string(prettyTpl), + Name: "pretty", + Text: string(prettyTpl), + TrimSpace: true, }) tt.CustomFunc(gotemplate.FuncMap{ "colorize": func(c string, s string) string { diff --git a/format/testdata/markdown/table-Base.golden b/format/testdata/markdown/table-Base.golden index 21ef339ea..24333eeff 100644 --- a/format/testdata/markdown/table-Base.golden +++ b/format/testdata/markdown/table-Base.golden @@ -92,14 +92,14 @@ followed by another line of text. | number-1 | It's number number one. | `number` | `42` | | map-3 | n/a | `map` | `{}` | | map-2 | It's map number two. | `map` | n/a | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `list` | `[]` | | list-2 | It's list number two. | `list` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | | with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` | | string_default_empty | n/a | `string` | `""` | diff --git a/format/testdata/markdown/table-EscapeCharacters.golden b/format/testdata/markdown/table-EscapeCharacters.golden index bb82f742b..b8e6b01fe 100644 --- a/format/testdata/markdown/table-EscapeCharacters.golden +++ b/format/testdata/markdown/table-EscapeCharacters.golden @@ -92,14 +92,14 @@ followed by another line of text. | number-1 | It's number number one. | `number` | `42` | | map-3 | n/a | `map` | `{}` | | map-2 | It's map number two. | `map` | n/a | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `list` | `[]` | | list-2 | It's list number two. | `list` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | input\_with\_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| long\_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| long\_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE\_WITH\_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | | with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` | | string\_default\_empty | n/a | `string` | `""` | diff --git a/format/testdata/markdown/table-IndentationOfFour.golden b/format/testdata/markdown/table-IndentationOfFour.golden index 19c86fd82..96e9c4f19 100644 --- a/format/testdata/markdown/table-IndentationOfFour.golden +++ b/format/testdata/markdown/table-IndentationOfFour.golden @@ -92,14 +92,14 @@ followed by another line of text. | number-1 | It's number number one. | `number` | `42` | | map-3 | n/a | `map` | `{}` | | map-2 | It's map number two. | `map` | n/a | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `list` | `[]` | | list-2 | It's list number two. | `list` | n/a | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | input_with_underscores | A variable with underscores. | `any` | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | | with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` | | string_default_empty | n/a | `string` | `""` | diff --git a/format/testdata/markdown/table-OutputValues.golden b/format/testdata/markdown/table-OutputValues.golden index 309b85cd2..b0a25b376 100644 --- a/format/testdata/markdown/table-OutputValues.golden +++ b/format/testdata/markdown/table-OutputValues.golden @@ -2,7 +2,7 @@ | Name | Description | Value | Sensitive | |------|-------------|-------|:---------:| -| unquoted | It's unquoted output. |
{
"leon": "cat"
}
| no | -| output-2 | It's output number two. |
[
"jack",
"lola"
]
| no | +| unquoted | It's unquoted output. |
{
"leon": "cat"
}
| no | +| output-2 | It's output number two. |
[
"jack",
"lola"
]
| no | | output-1 | It's output number one. | `1` | no | | output-0.12 | terraform 0.12 only | `` | yes | \ No newline at end of file diff --git a/format/testdata/markdown/table-OutputValuesNoSensitivity.golden b/format/testdata/markdown/table-OutputValuesNoSensitivity.golden index 8e7f02168..0e6221ca1 100644 --- a/format/testdata/markdown/table-OutputValuesNoSensitivity.golden +++ b/format/testdata/markdown/table-OutputValuesNoSensitivity.golden @@ -2,7 +2,7 @@ | Name | Description | Value | |------|-------------|-------| -| unquoted | It's unquoted output. |
{
"leon": "cat"
}
| -| output-2 | It's output number two. |
[
"jack",
"lola"
]
| +| unquoted | It's unquoted output. |
{
"leon": "cat"
}
| +| output-2 | It's output number two. |
[
"jack",
"lola"
]
| | output-1 | It's output number one. | `1` | | output-0.12 | terraform 0.12 only | `` | \ No newline at end of file diff --git a/format/testdata/markdown/table-WithAnchor.golden b/format/testdata/markdown/table-WithAnchor.golden index a1aaaccc6..6a202b2c2 100644 --- a/format/testdata/markdown/table-WithAnchor.golden +++ b/format/testdata/markdown/table-WithAnchor.golden @@ -92,14 +92,14 @@ followed by another line of text. | [number-1](#input_number-1) | It's number number one. | `number` | `42` | | [map-3](#input_map-3) | n/a | `map` | `{}` | | [map-2](#input_map-2) | It's map number two. | `map` | n/a | -| [map-1](#input_map-1) | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| +| [map-1](#input_map-1) | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| | [list-3](#input_list-3) | n/a | `list` | `[]` | | [list-2](#input_list-2) | It's list number two. | `list` | n/a | -| [list-1](#input_list-1) | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| +| [list-1](#input_list-1) | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| | [input_with_underscores](#input_input_with_underscores) | A variable with underscores. | `any` | n/a | | [input-with-pipe](#input_input-with-pipe) | It includes v1 \| v2 \| v3 | `string` | `"v1"` | -| [input-with-code-block](#input_input-with-code-block) | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| -| [long_type](#input_long_type) | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| [input-with-code-block](#input_input-with-code-block) | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| +| [long_type](#input_long_type) | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | [no-escape-default-value](#input_no-escape-default-value) | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | | [with-url](#input_with-url) | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` | | [string_default_empty](#input_string_default_empty) | n/a | `string` | `""` | diff --git a/format/testdata/markdown/table-WithRequired.golden b/format/testdata/markdown/table-WithRequired.golden index 08ed2ee38..8e335e5a1 100644 --- a/format/testdata/markdown/table-WithRequired.golden +++ b/format/testdata/markdown/table-WithRequired.golden @@ -92,14 +92,14 @@ followed by another line of text. | number-1 | It's number number one. | `number` | `42` | no | | map-3 | n/a | `map` | `{}` | no | | map-2 | It's map number two. | `map` | n/a | yes | -| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| no | +| map-1 | It's map number one. | `map` |
{
"a": 1,
"b": 2,
"c": 3
}
| no | | list-3 | n/a | `list` | `[]` | no | | list-2 | It's list number two. | `list` | n/a | yes | -| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| no | +| list-1 | It's list number one. | `list` |
[
"a",
"b",
"c"
]
| no | | input_with_underscores | A variable with underscores. | `any` | n/a | yes | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | `"v1"` | no | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| no | -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| no | +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` |
[
"name rack:location"
]
| no | +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
|
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| no | | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | `"VALUE_WITH_UNDERSCORE"` | no | | with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | `""` | no | | string_default_empty | n/a | `string` | `""` | no | diff --git a/format/testdata/markdown/table-WithoutDefault.golden b/format/testdata/markdown/table-WithoutDefault.golden index 082b876c3..8cc8b3b5e 100644 --- a/format/testdata/markdown/table-WithoutDefault.golden +++ b/format/testdata/markdown/table-WithoutDefault.golden @@ -22,8 +22,8 @@ | list-1 | It's list number one. | `list` | | input_with_underscores | A variable with underscores. | `any` | | input-with-pipe | It includes v1 \| v2 \| v3 | `string` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` | -| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
| `list` | +| long_type | This description is itself markdown.

It spans over multiple lines. |
object({
name = string,
foo = object({ foo = string, bar = string }),
bar = object({ foo = string, bar = string }),
fizz = list(string),
buzz = list(string)
})
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `string` | | with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `string` | | string_default_empty | n/a | `string` | diff --git a/format/testdata/markdown/table-WithoutType.golden b/format/testdata/markdown/table-WithoutType.golden index b9345a39c..56f65f3f3 100644 --- a/format/testdata/markdown/table-WithoutType.golden +++ b/format/testdata/markdown/table-WithoutType.golden @@ -16,14 +16,14 @@ | number-1 | It's number number one. | `42` | | map-3 | n/a | `{}` | | map-2 | It's map number two. | n/a | -| map-1 | It's map number one. |
{
"a": 1,
"b": 2,
"c": 3
}
| +| map-1 | It's map number one. |
{
"a": 1,
"b": 2,
"c": 3
}
| | list-3 | n/a | `[]` | | list-2 | It's list number two. | n/a | -| list-1 | It's list number one. |
[
"a",
"b",
"c"
]
| +| list-1 | It's list number one. |
[
"a",
"b",
"c"
]
| | input_with_underscores | A variable with underscores. | n/a | | input-with-pipe | It includes v1 \| v2 \| v3 | `"v1"` | -| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
|
[
"name rack:location"
]
| -| long_type | This description is itself markdown.

It spans over multiple lines. |
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| +| input-with-code-block | This is a complicated one. We need a newline.
And an example in a code block
default     = [
"machine rack01:neptune"
]
|
[
"name rack:location"
]
| +| long_type | This description is itself markdown.

It spans over multiple lines. |
{
"bar": {
"bar": "bar",
"foo": "bar"
},
"buzz": [
"fizz",
"buzz"
],
"fizz": [],
"foo": {
"bar": "foo",
"foo": "foo"
},
"name": "hello"
}
| | no-escape-default-value | The description contains `something_with_underscore`. Defaults to 'VALUE_WITH_UNDERSCORE'. | `"VALUE_WITH_UNDERSCORE"` | | with-url | The description contains url. https://www.domain.com/foo/bar_baz.html | `""` | | string_default_empty | n/a | `""` | diff --git a/format/tfvars_hcl.go b/format/tfvars_hcl.go index 87f1f5b63..4364f5c31 100644 --- a/format/tfvars_hcl.go +++ b/format/tfvars_hcl.go @@ -38,8 +38,9 @@ var padding []int // NewTfvarsHCL returns new instance of TfvarsHCL. func NewTfvarsHCL(config *print.Config) Type { tt := template.New(config, &template.Item{ - Name: "tfvars", - Text: string(tfvarsHCLTpl), + Name: "tfvars", + Text: string(tfvarsHCLTpl), + TrimSpace: true, }) tt.CustomFunc(gotemplate.FuncMap{ "align": func(s string, i int) string { diff --git a/format/util.go b/format/util.go index e8c2b5eab..4933fcb55 100644 --- a/format/util.go +++ b/format/util.go @@ -95,8 +95,9 @@ func readTemplateItems(efs embed.FS, prefix string) []*template.Item { } items = append(items, &template.Item{ - Name: name, - Text: string(content), + Name: name, + Text: string(content), + TrimSpace: true, }) } return items diff --git a/go.mod b/go.mod index 195dad6a2..cf64cb328 100644 --- a/go.mod +++ b/go.mod @@ -1,23 +1,76 @@ module github.com/terraform-docs/terraform-docs -go 1.16 +go 1.23.0 + +toolchain go1.24.2 require ( - github.com/BurntSushi/toml v0.3.1 - github.com/Masterminds/sprig/v3 v3.2.2 - github.com/hashicorp/go-hclog v0.15.0 - github.com/hashicorp/go-plugin v1.4.2 - github.com/hashicorp/go-version v1.3.0 - github.com/hashicorp/hcl/v2 v2.10.1 - github.com/iancoleman/orderedmap v0.2.0 - github.com/imdario/mergo v0.3.12 + github.com/BurntSushi/toml v1.4.0 + github.com/Masterminds/sprig/v3 v3.3.0 + github.com/hashicorp/go-hclog v1.6.3 + github.com/hashicorp/go-plugin v1.6.1 + github.com/hashicorp/go-version v1.7.0 + github.com/hashicorp/hcl/v2 v2.22.0 + github.com/iancoleman/orderedmap v0.3.0 + github.com/imdario/mergo v0.3.16 github.com/mitchellh/go-homedir v1.1.0 - github.com/spf13/cobra v1.2.1 + github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.8.1 - github.com/stretchr/testify v1.7.0 + github.com/spf13/viper v1.19.0 + github.com/stretchr/testify v1.9.0 github.com/terraform-docs/terraform-config-inspect v0.0.0-20210728164355-9c1f178932fa - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b - honnef.co/go/tools v0.2.0 - mvdan.cc/xurls/v2 v2.3.0 + golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 + gopkg.in/yaml.v3 v3.0.1 + honnef.co/go/tools v0.3.2 + mvdan.cc/xurls/v2 v2.5.0 +) + +require ( + dario.cat/mergo v1.0.1 // indirect + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver/v3 v3.3.0 // indirect + github.com/agext/levenshtein v1.2.3 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/fatih/color v1.17.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/golang/protobuf v1.5.4 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect + github.com/huandu/xstrings v1.5.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/oklog/run v1.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/sagikazarmark/locafero v0.6.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/shopspring/decimal v1.4.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.7.0 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/zclconf/go-cty v1.15.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.36.0 // indirect + golang.org/x/exp/typeparams v0.0.0-20220722155223-a9213eeb770e // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.38.0 // indirect + golang.org/x/sync v0.12.0 // indirect + golang.org/x/sys v0.31.0 // indirect + golang.org/x/text v0.23.0 // indirect + golang.org/x/tools v0.25.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.66.2 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect ) diff --git a/go.sum b/go.sum index 5e4615ff9..ae51c219c 100644 --- a/go.sum +++ b/go.sum @@ -1,697 +1,205 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0= +github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.2.2 h1:17jRggJu518dr3QaafizSXOjKYp94wKfABxUmyxvxX8= -github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= +github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs= +github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= +github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= -github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= -github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= +github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= +github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= -github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.4.2 h1:yFvG3ufXXpqiMiZx9HLcaK3XbIqQ1WJFR/F1a2CuVw0= -github.com/hashicorp/go-plugin v1.4.2/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= -github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-plugin v1.6.1 h1:P7MR2UP6gNKGPp+y7EZw2kOiq4IR9WiqLvp0XOsVdwI= +github.com/hashicorp/go-plugin v1.6.1/go.mod h1:XPHFku2tFo3o3QKFgSYo+cghcUhw1NA1hZyMK0PWAw0= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= -github.com/hashicorp/hcl/v2 v2.10.1 h1:h4Xx4fsrRE26ohAk/1iGF/JBqRQbyUqu5Lvj60U54ys= -github.com/hashicorp/hcl/v2 v2.10.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs= -github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= -github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= -github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/hashicorp/hcl/v2 v2.22.0 h1:hkZ3nCtqeJsDhPRFz5EA9iwcG1hNWGePOTw6oyul12M= +github.com/hashicorp/hcl/v2 v2.22.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= +github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= +github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sagikazarmark/locafero v0.6.0 h1:ON7AQg37yzcRPU69mt7gwhFEBwxI6P9T4Qu3N51bwOk= +github.com/sagikazarmark/locafero v0.6.0/go.mod h1:77OmuIc6VTraTXKXIs/uvUxKGUXjE1GbemJYHqdNjX0= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= +github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w= +github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/terraform-docs/terraform-config-inspect v0.0.0-20210728164355-9c1f178932fa h1:wdyf3TobwYFwsqnUGJcjdNHxKfwHPFbaOknBJehnF1M= github.com/terraform-docs/terraform-config-inspect v0.0.0-20210728164355-9c1f178932fa/go.mod h1:GtanFwTsRRXScYHOMb5h4K18XQBFeS2tXat9/LrPtPc= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= -github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= -github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.8.0 h1:s4AvqaeQzJIu3ndv4gVIhplVD0krU+bgrcLSVUnaWuA= -github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= +github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= +github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= +golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= +golang.org/x/exp/typeparams v0.0.0-20220722155223-a9213eeb770e h1:7Xs2YCOpMlNqSQSmrrnhlzBXIE/bpMecZplbLePTJvE= +golang.org/x/exp/typeparams v0.0.0-20220722155223-a9213eeb770e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= +golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= +golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= +golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= +golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= +golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0 h1:/9BgsAsa5nWe26HqOlvlgJnqBuktYOLCgjCPqsa56W0= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= +google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.2.0 h1:ws8AfbgTX3oIczLPNPCu5166oBg9ST2vNs0rcht+mDE= -honnef.co/go/tools v0.2.0/go.mod h1:lPVVZ2BS5TfnjLyizF7o7hv7j9/L+8cZY2hLyjP9cGY= -mvdan.cc/xurls/v2 v2.3.0 h1:59Olnbt67UKpxF1EwVBopJvkSUBmgtb468E4GVWIZ1I= -mvdan.cc/xurls/v2 v2.3.0/go.mod h1:AjuTy7gEiUArFMjgBBDU4SMxlfUYsRokpJQgNWOt3e4= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.3.2 h1:ytYb4rOqyp1TSa2EPvNVwtPQJctSELKaMyLfqNP4+34= +honnef.co/go/tools v0.3.2/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw= +mvdan.cc/xurls/v2 v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8= +mvdan.cc/xurls/v2 v2.5.0/go.mod h1:yQgaGQ1rFtJUzkmKiHYSSfuQxqfYmd//X6PxvholpeE= diff --git a/images/terraform-docs-teaser.png b/images/terraform-docs-teaser.png index 407922ec6..e09c3cb01 100644 Binary files a/images/terraform-docs-teaser.png and b/images/terraform-docs-teaser.png differ diff --git a/internal/cli/run.go b/internal/cli/run.go index 0976fc841..05678e876 100644 --- a/internal/cli/run.go +++ b/internal/cli/run.go @@ -94,9 +94,11 @@ type module struct { // RunEFunc is the 'cobra.Command#RunE' function for 'formatter' commands. It attempts // to discover submodules, on `--recursive` flag, and generates the content for them // as well as the root module. -func (r *Runtime) RunEFunc(cmd *cobra.Command, args []string) error { - modules := []module{ - {rootDir: r.rootDir, config: r.config}, +func (r *Runtime) RunEFunc(cmd *cobra.Command, args []string) error { //nolint:gocyclo + modules := []module{} + + if !r.config.Recursive.Enabled || r.config.Recursive.IncludeMain { + modules = append(modules, module{r.rootDir, r.config}) } // Generating content recursively is only allowed when `config.Output.File` @@ -214,7 +216,7 @@ func (r *Runtime) bindFlags(v *viper.Viper) { switch f.Name { case "show", "hide": // If '--show' or '--hide' CLI flag is used, explicitly override and remove - // all items from 'show' and 'hide' set in '.terraform-doc.yml'. + // all items from 'show' and 'hide' set in '.terraform-docs.yml'. if !sectionsCleared { v.Set("sections.show", []string{}) v.Set("sections.hide", []string{}) diff --git a/internal/cli/writer.go b/internal/cli/writer.go index 3a00e0cc8..2514928cd 100644 --- a/internal/cli/writer.go +++ b/internal/cli/writer.go @@ -28,7 +28,7 @@ type stdoutWriter struct{} // Write content to Stdout func (sw *stdoutWriter) Write(p []byte) (int, error) { - return os.Stdout.Write([]byte(string(p) + "\n")) + return os.Stdout.WriteString(string(p) + "\n") } // fileWriter writes content to file. @@ -82,7 +82,7 @@ func (fw *fileWriter) Write(p []byte) (int, error) { return fw.write(filename, buf.Bytes()) } - content, err := os.ReadFile(filename) + content, err := os.ReadFile(filepath.Clean(filename)) if err != nil { // In mode 'inject', if target file not found: // create it and save the generated output into it. @@ -161,7 +161,7 @@ func (fw *fileWriter) inject(filename string, content string, generated string) func (fw *fileWriter) write(filename string, p []byte) (int, error) { // if run in check mode return exit 1 if fw.check { - f, err := os.ReadFile(filename) + f, err := os.ReadFile(filepath.Clean(filename)) if err != nil { return 0, err } diff --git a/internal/plugin/discovery.go b/internal/plugin/discovery.go index 007c507e2..b6c611f4e 100644 --- a/internal/plugin/discovery.go +++ b/internal/plugin/discovery.go @@ -12,7 +12,6 @@ package plugin import ( "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -56,7 +55,7 @@ func findPlugins(dir string) (*List, error) { clients := map[string]*goplugin.Client{} formatters := map[string]*pluginsdk.Client{} - files, err := ioutil.ReadDir(dir) + files, err := os.ReadDir(dir) if err != nil { return nil, err } diff --git a/internal/reader/lines_test.go b/internal/reader/lines_test.go index d7e31acc5..3b29c92e3 100644 --- a/internal/reader/lines_test.go +++ b/internal/reader/lines_test.go @@ -11,7 +11,6 @@ the root directory of this source tree. package reader import ( - "path/filepath" "strings" "testing" @@ -122,7 +121,7 @@ func TestReadLinesFromFile(t *testing.T) { t.Run(tt.name, func(t *testing.T) { assert := assert.New(t) lines := Lines{ - FileName: filepath.Join(tt.fileName), + FileName: tt.fileName, LineNum: tt.lineNumber, Condition: func(line string) bool { line = strings.TrimSpace(line) diff --git a/internal/testutil/testing.go b/internal/testutil/testing.go index 620022b96..fbb4d231c 100644 --- a/internal/testutil/testing.go +++ b/internal/testutil/testing.go @@ -11,7 +11,6 @@ the root directory of this source tree. package testutil import ( - "io/ioutil" "os" "path/filepath" "runtime" @@ -43,7 +42,7 @@ func GetModule(config *print.Config) (*terraform.Module, error) { // GetExpected returns 'example' Module and expected Golden file content func GetExpected(format, name string) (string, error) { path := filepath.Join(testDataPath(), format, name+".golden") - bytes, err := ioutil.ReadFile(filepath.Clean(path)) + bytes, err := os.ReadFile(filepath.Clean(path)) if err != nil { return "", err } @@ -65,5 +64,5 @@ func getExampleFolder(folder string) (string, error) { } func testDataPath() string { - return filepath.Join("testdata") + return "testdata" } diff --git a/internal/types/types.go b/internal/types/types.go index 29371d2b5..2e4481882 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -286,7 +286,7 @@ func (l List) Raw() interface{} { } type xmllistentry struct { - XMLName xml.Name + XMLName xml.Name `xml:"item"` Value interface{} `xml:",chardata"` } @@ -334,7 +334,7 @@ func (m Map) Length() int { } type xmlmapentry struct { - XMLName xml.Name + XMLName xml.Name `xml:","` Value interface{} `xml:",chardata"` } @@ -347,24 +347,26 @@ func (s sortmapkeys) Less(i, j int) bool { return s[i] < s[j] } // MarshalXML custom marshal function which converts map to its literal // XML representation. For example: // -// m := Map{ -// "a": 1, -// "b": 2, -// "c": 3, -// } +// m := Map{ +// "a": 1, +// "b": 2, +// "c": 3, +// } // -// type foo struct { -// Value Map `xml:"value"` -// } +// type foo struct { +// Value Map `xml:"value"` +// } // // will get marshaled to: // // -// -// 1 -// 2 -// 3 -// +// +// +// 1 +// 2 +// 3 +// +// // func (m Map) MarshalXML(e *xml.Encoder, start xml.StartElement) error { if len(m) == 0 { diff --git a/internal/version/version.go b/internal/version/version.go index 67fb6145d..795772660 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -17,7 +17,7 @@ import ( // current version const ( - coreVersion = "0.16.0" + coreVersion = "0.20.0" prerelease = "" ) diff --git a/plugin/client.go b/plugin/client.go index 899de4f5d..826f5ae2f 100644 --- a/plugin/client.go +++ b/plugin/client.go @@ -1,17 +1,11 @@ /* Copyright 2021 The terraform-docs Authors. -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 +Licensed under the MIT license (the "License"); you may not +use this file except in compliance with the License. - 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. +You may obtain a copy of the License at the LICENSE file in +the root directory of this source tree. */ package plugin diff --git a/plugin/doc.go b/plugin/doc.go index 3510b4ce9..85c7168f9 100644 --- a/plugin/doc.go +++ b/plugin/doc.go @@ -1,17 +1,11 @@ /* Copyright 2021 The terraform-docs Authors. -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 +Licensed under the MIT license (the "License"); you may not +use this file except in compliance with the License. - 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. +You may obtain a copy of the License at the LICENSE file in +the root directory of this source tree. */ // Package plugin contains the implementations needed to make @@ -25,44 +19,43 @@ limitations under the License. // Implementation details are hidden in go-plugin. This package is // essentially a wrapper for go-plugin. // -// Usage +// # Usage // // A simple plugin can look like this: // -// package main -// -// import ( -// _ "embed" //nolint -// -// "github.com/terraform-docs/terraform-docs/plugin" -// "github.com/terraform-docs/terraform-docs/print" -// "github.com/terraform-docs/terraform-docs/template" -// "github.com/terraform-docs/terraform-docs/terraform" -// ) -// -// func main() { -// plugin.Serve(&plugin.ServeOpts{ -// Name: "template", -// Version: "0.1.0", -// Printer: printerFunc, -// }) -// } -// -// //go:embed sections.tmpl -// var tplCustom []byte -// -// // printerFunc the function being executed by the plugin client. -// func printerFunc(config *print.Config, module *terraform.Module) (string, error) { -// tpl := template.New(config, -// &template.Item{Name: "custom", Text: string(tplCustom)}, -// ) -// -// rendered, err := tpl.Render("custom", module) -// if err != nil { -// return "", err -// } -// -// return rendered, nil -// } -// +// package main +// +// import ( +// _ "embed" //nolint +// +// "github.com/terraform-docs/terraform-docs/plugin" +// "github.com/terraform-docs/terraform-docs/print" +// "github.com/terraform-docs/terraform-docs/template" +// "github.com/terraform-docs/terraform-docs/terraform" +// ) +// +// func main() { +// plugin.Serve(&plugin.ServeOpts{ +// Name: "template", +// Version: "0.1.0", +// Printer: printerFunc, +// }) +// } +// +// //go:embed sections.tmpl +// var tplCustom []byte +// +// // printerFunc the function being executed by the plugin client. +// func printerFunc(config *print.Config, module *terraform.Module) (string, error) { +// tpl := template.New(config, +// &template.Item{Name: "custom", Text: string(tplCustom)}, +// ) +// +// rendered, err := tpl.Render("custom", module) +// if err != nil { +// return "", err +// } +// +// return rendered, nil +// } package plugin diff --git a/plugin/plugin.go b/plugin/plugin.go index deda080df..954047668 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -1,17 +1,11 @@ /* Copyright 2021 The terraform-docs Authors. -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 +Licensed under the MIT license (the "License"); you may not +use this file except in compliance with the License. - 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. +You may obtain a copy of the License at the LICENSE file in +the root directory of this source tree. */ package plugin diff --git a/plugin/server.go b/plugin/server.go index 1fc46c86d..3499ce28b 100644 --- a/plugin/server.go +++ b/plugin/server.go @@ -1,17 +1,11 @@ /* Copyright 2021 The terraform-docs Authors. -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 +Licensed under the MIT license (the "License"); you may not +use this file except in compliance with the License. - 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. +You may obtain a copy of the License at the LICENSE file in +the root directory of this source tree. */ package plugin diff --git a/print/config.go b/print/config.go index 1ed910e78..4ac193522 100644 --- a/print/config.go +++ b/print/config.go @@ -73,14 +73,16 @@ func DefaultConfig() *Config { } type recursive struct { - Enabled bool `mapstructure:"enabled"` - Path string `mapstructure:"path"` + Enabled bool `mapstructure:"enabled"` + Path string `mapstructure:"path"` + IncludeMain bool `mapstructure:"include-main"` } func defaultRecursive() recursive { return recursive{ - Enabled: false, - Path: "modules", + Enabled: false, + Path: "modules", + IncludeMain: true, } } diff --git a/print/doc.go b/print/doc.go index 888fff901..2e210f657 100644 --- a/print/doc.go +++ b/print/doc.go @@ -10,7 +10,7 @@ the root directory of this source tree. // Package print provides configuration, and a Generator. // -// Configuration +// # Configuration // // `print.Config` is the data structure representation for `.terraform-docs.yml` // which will be read and extracted upon execution of terraform-docs cli. On the @@ -18,13 +18,13 @@ the root directory of this source tree. // // This will return an instance of `Config` with default values set: // -// config := print.DefaultConfig() +// config := print.DefaultConfig() // // Alternatively this will return an empty instance of `Config`: // -// config := print.NewConfig() +// config := print.NewConfig() // -// Generator +// # Generator // // `Generator` is an abstract implementation of `format.Type`. It doesn't implement // `Generate(*terraform.Module) error` function. It is used directly by different @@ -46,5 +46,4 @@ the root directory of this source tree. // • `{{ .Requirements }}` // • `{{ .Resources }}` // • `{{ include "path/fo/file" }}` -// package print diff --git a/print/util.go b/print/util.go index 3d6410239..6a26ef1e0 100644 --- a/print/util.go +++ b/print/util.go @@ -19,6 +19,7 @@ func contains(list []string, name string) bool { return false } +// nolint func index(list []string, name string) int { for i, v := range list { if v == name { @@ -28,6 +29,7 @@ func index(list []string, name string) int { return -1 } +// nolint func remove(list []string, name string) []string { index := index(list, name) if index < 0 { diff --git a/scripts/docs/generate.go b/scripts/docs/generate.go index e0f9f2c65..f2677bd5b 100644 --- a/scripts/docs/generate.go +++ b/scripts/docs/generate.go @@ -70,13 +70,13 @@ func generate(cmd *cobra.Command, weight int, basename string) error { } filename := filepath.Join("docs", "reference", basename+".md") - f, err := os.Create(filename) + f, err := os.Create(filepath.Clean(filename)) if err != nil { return err } defer f.Close() //nolint:errcheck,gosec - if _, err := io.WriteString(f, ""); err != nil { + if _, err := f.WriteString(""); err != nil { return err } if err := generateMarkdown(cmd, weight, f); err != nil { @@ -200,7 +200,7 @@ func example(ref *reference) error { if s == "" { buf.WriteString("\n") } else { - buf.WriteString(fmt.Sprintf(" %s\n", s)) + fmt.Fprintf(buf, " %s\n", s) } } ref.Example = buf.String() diff --git a/scripts/release/Dockerfile b/scripts/release/Dockerfile index f7836499a..be1cbc5c8 100644 --- a/scripts/release/Dockerfile +++ b/scripts/release/Dockerfile @@ -6,7 +6,7 @@ # You may obtain a copy of the License at the LICENSE file in # the root directory of this source tree. -FROM alpine:3.14.0 +FROM docker.io/library/alpine:3.21.3 COPY terraform-docs /usr/local/bin/terraform-docs diff --git a/scripts/release/release.sh b/scripts/release/release.sh deleted file mode 100755 index c436bfab8..000000000 --- a/scripts/release/release.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright 2021 The terraform-docs Authors. -# -# Licensed under the MIT license (the "License"); you may not -# use this file except in compliance with the License. -# -# You may obtain a copy of the License at the LICENSE file in -# the root directory of this source tree. - -set -o errexit -set -o pipefail - -CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) - -if [ -z "${CURRENT_BRANCH}" ] || [ "${CURRENT_BRANCH}" != "master" ]; then - echo "Error: The current branch is '${CURRENT_BRANCH}', switch to 'master' to do the release." - exit 1 -fi - -if [ -n "$(git status --short)" ]; then - echo "Error: There are untracked/modified changes, commit or discard them before the release." - exit 1 -fi - -RELEASE_VERSION=$1 -CURRENT_VERSION=$2 -FROM_MAKEFILE=$3 - -if [ -z "${RELEASE_VERSION}" ]; then - if [ -z "${FROM_MAKEFILE}" ]; then - echo "Error: VERSION is missing. e.g. ./release.sh " - else - echo "Error: missing value for 'version'. e.g. 'make release VERSION=x.y.z'" - fi - exit 1 -fi - -if [ -z "${CURRENT_VERSION}" ]; then - CURRENT_VERSION=$(git describe --tags --exact-match 2>/dev/null || git describe --tags 2>/dev/null || echo "v0.0.1-$(COMMIT_HASH)") -fi - -if [ "v${RELEASE_VERSION}" == "${CURRENT_VERSION}" ]; then - echo "Error: provided version (v${RELEASE_VERSION}) already exists." - exit 1 -fi - -if [ "$(git describe --tags "v${RELEASE_VERSION}" 2>/dev/null)" ]; then - echo "Error: provided version (v${RELEASE_VERSION}) already exists." - exit 1 -fi - -PWD=$(cd "$(dirname "$0")" && pwd -P) - -# get closest GA tag, ignore alpha, beta and rc tags -function getClosestVersion() { - for t in $(git tag --sort=-creatordate); do - tag="$t" - if [[ "$tag" == *"-alpha"* ]] || [[ "$tag" == *"-beta"* ]] || [[ "$tag" == *"-rc"* ]]; then - continue - fi - break - done - echo "${tag//v/}" -} -CLOSEST_VERSION=$(getClosestVersion) - -# Bump the released version in README and version.go -if [[ $RELEASE_VERSION != *"-alpha"* && $RELEASE_VERSION != *"-beta"* && $RELEASE_VERSION != *"-rc"* ]]; then - sed -i -E "s|${CLOSEST_VERSION}|${RELEASE_VERSION}|g" README.md - sed -i -E "s|${CLOSEST_VERSION}|${RELEASE_VERSION}|g" docs/user-guide/installation.md - git add README.md docs/user-guide/installation.md -fi - -sed -i -E "s|v${RELEASE_VERSION}-alpha|v${RELEASE_VERSION}|g" internal/version/version.go -git add internal/version/version.go - -# Commit changes -printf "\033[36m==> %s\033[0m\n" "Commit changes for release version v${RELEASE_VERSION}" -git commit -m "Release version v${RELEASE_VERSION}" - -printf "\033[36m==> %s\033[0m\n" "Push commits for v${RELEASE_VERSION}" -git push origin master - -# Tag the release -printf "\033[36m==> %s\033[0m\n" "Tag release v${RELEASE_VERSION}" -git tag --annotate --message "v${RELEASE_VERSION} Release" "v${RELEASE_VERSION}" - -printf "\033[36m==> %s\033[0m\n" "Push tag release v${RELEASE_VERSION}" -git push origin "v${RELEASE_VERSION}" diff --git a/scripts/release/update-choco.sh b/scripts/release/update-choco.sh deleted file mode 100755 index 07a116d16..000000000 --- a/scripts/release/update-choco.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright 2021 The terraform-docs Authors. -# -# Licensed under the MIT license (the "License"); you may not -# use this file except in compliance with the License. -# -# You may obtain a copy of the License at the LICENSE file in -# the root directory of this source tree. - -set -o errexit -set -o pipefail - -if [ -n "$(git status --short)" ]; then - echo "Error: There are untracked/modified changes, commit or discard them before the release." - exit 1 -fi - -RELEASE_VERSION=$1 - -if [ -z "${RELEASE_VERSION}" ]; then - echo "Error: release version is missing" - exit 1 -fi - -PWD=$(cd "$(dirname "$0")" && pwd -P) - -# get closest GA tag immediately before the latest one, ignore alpha, beta and rc tags -function getClosestVersion() { - local latest - latest="" - for t in $(git tag --sort=-creatordate); do - tag="$t" - if [[ "$tag" == *"-alpha"* ]] || [[ "$tag" == *"-beta"* ]] || [[ "$tag" == *"-rc"* ]]; then - continue - fi - if [ -z "$latest" ]; then - latest="$t" - continue - fi - break - done - echo "${tag//v/}" -} -CLOSEST_VERSION=$(getClosestVersion) - -git clone https://github.com/terraform-docs/chocolatey-package "${PWD}/chocolatey-package" - -# Bump version in terraform-docs.nuspec -sed -i -E "s|${CLOSEST_VERSION}|${RELEASE_VERSION}|g" "${PWD}/chocolatey-package/terraform-docs.nuspec" - -# Bump version and checksum in tools/chocolateyinstall.ps1 -CHECKSUM=$(grep windows-amd64.zip "${PWD}/../../dist/terraform-docs-v${RELEASE_VERSION}.sha256sum" | awk '{print $1}') - -sed -i -E "s|checksum = '.*$|checksum = '${CHECKSUM}'|g" "${PWD}/chocolatey-package/tools/chocolateyinstall.ps1" -sed -i -E "s|v${CLOSEST_VERSION}|v${RELEASE_VERSION}|g" "${PWD}/chocolatey-package/tools/chocolateyinstall.ps1" - -pushd "${PWD}/chocolatey-package/" -git diff -popd diff --git a/template/doc.go b/template/doc.go index bb79041f3..a102b0113 100644 --- a/template/doc.go +++ b/template/doc.go @@ -12,42 +12,42 @@ the root directory of this source tree. // // Usage // -// import ( -// "fmt" -// gotemplate "text/template" -// -// "github.com/terraform-docs/terraform-docs/print" -// "github.com/terraform-docs/terraform-docs/template" -// "github.com/terraform-docs/terraform-docs/terraform" -// ) -// -// const mainTpl =` -// {{- if .Config.Sections.Header -}} -// {{- with .Module.Header -}} -// {{ colorize "\033[90m" . }} -// {{ end -}} -// {{- printf "\n\n" -}} -// {{ end -}}` -// -// func render(config *print.Config, module *terraform.Module) (string, error) { -// tt := template.New(config, &template.Item{ -// Name: "main", -// Text: mainTpl, -// }) -// -// tt := template.New(config, items...) -// tt.CustomFunc(gotemplate.FuncMap{ -// "colorize": func(color string, s string) string { -// reset := "\033[0m" -// if !config.Settings.Color { -// color = "" -// reset = "" -// } -// return fmt.Sprintf("%s%s%s", color, s, reset) -// }, -// }) -// -// return tt.Render("main", module) -// } -// +// import ( +// "fmt" +// gotemplate "text/template" +// +// "github.com/terraform-docs/terraform-docs/print" +// "github.com/terraform-docs/terraform-docs/template" +// "github.com/terraform-docs/terraform-docs/terraform" +// ) +// +// const mainTpl =` +// {{- if .Config.Sections.Header -}} +// {{- with .Module.Header -}} +// {{ colorize "\033[90m" . }} +// {{ end -}} +// {{- printf "\n\n" -}} +// {{ end -}}` +// +// func render(config *print.Config, module *terraform.Module) (string, error) { +// tt := template.New(config, &template.Item{ +// Name: "main", +// Text: mainTpl, +// TrimSpace: true, +// }) +// +// tt := template.New(config, items...) +// tt.CustomFunc(gotemplate.FuncMap{ +// "colorize": func(color string, s string) string { +// reset := "\033[0m" +// if !config.Settings.Color { +// color = "" +// reset = "" +// } +// return fmt.Sprintf("%s%s%s", color, s, reset) +// }, +// }) +// +// return tt.Render("main", module) +// } package template diff --git a/template/sanitizer.go b/template/sanitizer.go index bf020d3fe..029ee98d2 100644 --- a/template/sanitizer.go +++ b/template/sanitizer.go @@ -114,7 +114,7 @@ func SanitizeMarkdownTable(s string, escape bool, html bool) string { return segment }, func(segment string, first bool, last bool) string { - linebreak := "
" + linebreak := "
" codestart := "
"
 			codeend := "
" @@ -189,11 +189,11 @@ func ConvertMultiLineText(s string, isTable bool, isHeader bool, showHTML bool) return s } - // representation of line break.
if showHTML is true, if false. + // representation of line break.
if showHTML is true, if false. linebreak := " " if showHTML { - linebreak = "
" + linebreak = "
" } // Convert space-space-newline to 'linebreak'. diff --git a/template/sanitizer_test.go b/template/sanitizer_test.go index 8d494d654..cf787d9fd 100644 --- a/template/sanitizer_test.go +++ b/template/sanitizer_test.go @@ -11,7 +11,7 @@ the root directory of this source tree. package template import ( - "io/ioutil" + "os" "path/filepath" "testing" @@ -129,12 +129,12 @@ func TestSanitizeSection(t *testing.T) { t.Run(tt.name, func(t *testing.T) { assert := assert.New(t) - bytes, err := ioutil.ReadFile(filepath.Join("testdata", "section", tt.filename+".golden")) + bytes, err := os.ReadFile(filepath.Join("testdata", "section", tt.filename+".golden")) assert.Nil(err) actual := SanitizeSection(string(bytes), tt.escape, false) - expected, err := ioutil.ReadFile(filepath.Join("testdata", "section", tt.filename+".expected")) + expected, err := os.ReadFile(filepath.Join("testdata", "section", tt.filename+".expected")) assert.Nil(err) assert.Equal(string(expected), actual) @@ -168,12 +168,12 @@ func TestSanitizeDocument(t *testing.T) { t.Run(tt.name, func(t *testing.T) { assert := assert.New(t) - bytes, err := ioutil.ReadFile(filepath.Join("testdata", "document", tt.filename+".golden")) + bytes, err := os.ReadFile(filepath.Join("testdata", "document", tt.filename+".golden")) assert.Nil(err) actual := SanitizeDocument(string(bytes), tt.escape, false) - expected, err := ioutil.ReadFile(filepath.Join("testdata", "document", tt.filename+".expected")) + expected, err := os.ReadFile(filepath.Join("testdata", "document", tt.filename+".expected")) assert.Nil(err) assert.Equal(string(expected), actual) @@ -229,12 +229,12 @@ func TestSanitizeMarkdownTable(t *testing.T) { t.Run(tt.name, func(t *testing.T) { assert := assert.New(t) - bytes, err := ioutil.ReadFile(filepath.Join("testdata", "table", tt.filename+".golden")) + bytes, err := os.ReadFile(filepath.Join("testdata", "table", tt.filename+".golden")) assert.Nil(err) actual := SanitizeMarkdownTable(string(bytes), tt.escape, tt.html) - expected, err := ioutil.ReadFile(filepath.Join("testdata", "table", tt.expected+".markdown.expected")) + expected, err := os.ReadFile(filepath.Join("testdata", "table", tt.expected+".markdown.expected")) assert.Nil(err) assert.Equal(string(expected), actual) @@ -268,12 +268,12 @@ func TestSanitizeAsciidocTable(t *testing.T) { t.Run(tt.name, func(t *testing.T) { assert := assert.New(t) - bytes, err := ioutil.ReadFile(filepath.Join("testdata", "table", tt.filename+".golden")) + bytes, err := os.ReadFile(filepath.Join("testdata", "table", tt.filename+".golden")) assert.Nil(err) actual := SanitizeAsciidocTable(string(bytes), tt.escape, false) - expected, err := ioutil.ReadFile(filepath.Join("testdata", "table", tt.filename+".asciidoc.expected")) + expected, err := os.ReadFile(filepath.Join("testdata", "table", tt.filename+".asciidoc.expected")) assert.Nil(err) assert.Equal(string(expected), actual) @@ -301,7 +301,7 @@ func TestConvertMultiLineText(t *testing.T) { filename: "newline-single", isTable: true, showHTML: true, - expected: "Lorem ipsum dolor sit amet,

consectetur adipiscing elit,

sed do eiusmod tempor incididunt

ut labore et dolore magna aliqua.", + expected: "Lorem ipsum dolor sit amet,

consectetur adipiscing elit,

sed do eiusmod tempor incididunt

ut labore et dolore magna aliqua.", }, { name: "convert multi-line newline-single", @@ -322,7 +322,7 @@ func TestConvertMultiLineText(t *testing.T) { filename: "newline-double", isTable: true, showHTML: true, - expected: "Lorem ipsum dolor sit amet,


consectetur adipiscing elit,


sed do eiusmod tempor incididunt


ut labore et dolore magna aliqua.", + expected: "Lorem ipsum dolor sit amet,


consectetur adipiscing elit,


sed do eiusmod tempor incididunt


ut labore et dolore magna aliqua.", }, { name: "convert multi-line newline-double", @@ -343,7 +343,7 @@ func TestConvertMultiLineText(t *testing.T) { filename: "paragraph", isTable: true, showHTML: true, - expected: "Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.", + expected: "Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.", }, { name: "convert multi-line paragraph", @@ -364,7 +364,7 @@ func TestConvertMultiLineText(t *testing.T) { filename: "list", isTable: true, showHTML: true, - expected: "- Lorem ipsum dolor sit amet,
* Lorem ipsum dolor sit amet,
* consectetur adipiscing elit,
- consectetur adipiscing elit,
- sed do eiusmod tempor incididunt
- ut labore et dolore magna aliqua.", + expected: "- Lorem ipsum dolor sit amet,
* Lorem ipsum dolor sit amet,
* consectetur adipiscing elit,
- consectetur adipiscing elit,
- sed do eiusmod tempor incididunt
- ut labore et dolore magna aliqua.", }, { name: "convert multi-line list", @@ -385,7 +385,7 @@ func TestConvertMultiLineText(t *testing.T) { filename: "indentations", isTable: true, showHTML: true, - expected: "This is is a multline test which works

Key
Foo1: blah
Foo2: blah

Key2
Foo1: bar1
Foo2: bar2", + expected: "This is is a multline test which works

Key
Foo1: blah
Foo2: blah

Key2
Foo1: bar1
Foo2: bar2", }, { name: "convert multi-line indentations", @@ -400,7 +400,7 @@ func TestConvertMultiLineText(t *testing.T) { assert := assert.New(t) path := filepath.Join("testdata", "multiline", tt.filename+".golden") - bytes, err := ioutil.ReadFile(path) + bytes, err := os.ReadFile(path) assert.Nil(err) actual := ConvertMultiLineText(string(bytes), tt.isTable, false, tt.showHTML) diff --git a/template/template.go b/template/template.go index eb7b44f40..4fa5ef1d0 100644 --- a/template/template.go +++ b/template/template.go @@ -25,8 +25,9 @@ import ( // Item represents a named templated which can reference other named templated too. type Item struct { - Name string - Text string + Name string + Text string + TrimSpace bool } // Template represents a new Template with given name and content to be rendered @@ -102,12 +103,12 @@ func (t *Template) RenderContent(name string, data interface{}) (string, error) tmpl := gotemplate.New(item.Name) tmpl.Funcs(t.funcMap) - gotemplate.Must(tmpl.Parse(normalize(item.Text))) + gotemplate.Must(tmpl.Parse(normalize(item.Text, item.TrimSpace))) for _, ii := range t.items { tt := tmpl.New(ii.Name) tt.Funcs(t.funcMap) - gotemplate.Must(tt.Parse(normalize(ii.Text))) + gotemplate.Must(tt.Parse(normalize(ii.Text, ii.TrimSpace))) } if err := tmpl.ExecuteTemplate(&buffer, item.Name, data); err != nil { @@ -232,14 +233,15 @@ func builtinFuncs(config *print.Config) gotemplate.FuncMap { // nolint:gocyclo // normalize the template and remove any space from all the lines. This makes // it possible to have a indented, human-readable template which doesn't affect // the rendering of them. -func normalize(s string) string { - segments := strings.Split(s, "\n") - buffer := bytes.NewBufferString("") - for _, segment := range segments { - buffer.WriteString(strings.TrimSpace(segment)) // nolint:gosec - buffer.WriteString("\n") // nolint:gosec +func normalize(s string, trimSpace bool) string { + if !trimSpace { + return s } - return buffer.String() + splitted := strings.Split(s, "\n") + for i, v := range splitted { + splitted[i] = strings.TrimSpace(v) + } + return strings.Join(splitted, "\n") } // GenerateIndentation generates indentation of Markdown and AsciiDoc headers diff --git a/template/template_test.go b/template/template_test.go index 431e14f20..cc8c08ac3 100644 --- a/template/template_test.go +++ b/template/template_test.go @@ -398,14 +398,14 @@ func TestBuiltinFunc(t *testing.T) { funcName: "sanitizeMarkdownTbl", funcArgs: []string{"\"Example of 'foo_bar' module in `foo_bar.tf`.\n\n| Foo | Bar |\""}, escape: true, - expected: "Example of 'foo\\_bar' module in `foo_bar.tf`.

\\| Foo \\| Bar \\|", + expected: "Example of 'foo\\_bar' module in `foo_bar.tf`.

\\| Foo \\| Bar \\|", }, { name: "template builtin functions sanitizeMarkdownTbl", funcName: "sanitizeMarkdownTbl", funcArgs: []string{"\"Example of 'foo_bar' module in `foo_bar.tf`.\n\n| Foo | Bar |\""}, escape: false, - expected: "Example of 'foo_bar' module in `foo_bar.tf`.

\\| Foo \\| Bar \\|", + expected: "Example of 'foo_bar' module in `foo_bar.tf`.

\\| Foo \\| Bar \\|", }, { name: "template builtin functions sanitizeMarkdownTbl", @@ -508,3 +508,51 @@ func TestGenerateIndentation(t *testing.T) { }) } } + +func TestNormalize(t *testing.T) { + tests := []struct { + name string + text string + trim bool + expected string + }{ + { + name: "normalize with trim space", + text: "Lorem ipsum\ndolor sit amet,\nconsectetur\nadipiscing\nelit", + trim: true, + expected: "Lorem ipsum\ndolor sit amet,\nconsectetur\nadipiscing\nelit", + }, + { + name: "normalize with trim space", + text: "Lorem ipsum\ndolor sit amet,\nconsectetur\nadipiscing\nelit\n", + trim: true, + expected: "Lorem ipsum\ndolor sit amet,\nconsectetur\nadipiscing\nelit\n", + }, + { + name: "normalize with trim space", + text: "Lorem ipsum\ndolor sit amet,\n consectetur\nadipiscing\nelit", + trim: true, + expected: "Lorem ipsum\ndolor sit amet,\nconsectetur\nadipiscing\nelit", + }, + { + name: "normalize without trim space", + text: "Lorem ipsum\ndolor sit amet,\nconsectetur\nadipiscing\nelit", + trim: false, + expected: "Lorem ipsum\ndolor sit amet,\nconsectetur\nadipiscing\nelit", + }, + { + name: "normalize without trim space", + text: "Lorem ipsum\ndolor sit amet,\n consectetur\nadipiscing\nelit", + trim: false, + expected: "Lorem ipsum\ndolor sit amet,\n consectetur\nadipiscing\nelit", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert := assert.New(t) + actual := normalize(tt.text, tt.trim) + + assert.Equal(tt.expected, actual) + }) + } +} diff --git a/template/testdata/table/codeblock-html.markdown.expected b/template/testdata/table/codeblock-html.markdown.expected index 8e60f2ad8..a70db77c0 100644 --- a/template/testdata/table/codeblock-html.markdown.expected +++ b/template/testdata/table/codeblock-html.markdown.expected @@ -1 +1 @@ -This is a complicated one. We need a newline.
And an example in a code block. Availeble options
are: foo \| bar \| baz
default = [
"foo"
]
\ No newline at end of file +This is a complicated one. We need a newline.
And an example in a code block. Availeble options
are: foo \| bar \| baz
default = [
"foo"
]
\ No newline at end of file diff --git a/template/testdata/table/complex-html.markdown.expected b/template/testdata/table/complex-html.markdown.expected index c822e0254..dd0ac7356 100644 --- a/template/testdata/table/complex-html.markdown.expected +++ b/template/testdata/table/complex-html.markdown.expected @@ -1 +1 @@ -Usage:

Example of 'foo\_bar' module in `foo_bar.tf`.

- list item 1
- list item 2

Even inline **formatting** in _here_ is possible.
and some [link](https://domain.com/)

* list item 3
* list item 4
module "foo_bar" {
source = "github.com/foo/bar"

id = "1234567890"
name = "baz"

zones = ["us-east-1", "us-west-1"]

tags = {
Name = "baz"
Created-By = "first.last@email.com"
Date-Created = "20180101"
}
}
Here is some trailing text after code block,
followed by another line of text.

\| Name \| Description \|
\|------\|-----------------\|
\| Foo \| Foo description \|
\| Bar \| Bar description \| \ No newline at end of file +Usage:

Example of 'foo\_bar' module in `foo_bar.tf`.

- list item 1
- list item 2

Even inline **formatting** in _here_ is possible.
and some [link](https://domain.com/)

* list item 3
* list item 4
module "foo_bar" {
source = "github.com/foo/bar"

id = "1234567890"
name = "baz"

zones = ["us-east-1", "us-west-1"]

tags = {
Name = "baz"
Created-By = "first.last@email.com"
Date-Created = "20180101"
}
}
Here is some trailing text after code block,
followed by another line of text.

\| Name \| Description \|
\|------\|-----------------\|
\| Foo \| Foo description \|
\| Bar \| Bar description \| \ No newline at end of file diff --git a/terraform/doc.go b/terraform/doc.go index 1708dc848..c55057df7 100644 --- a/terraform/doc.go +++ b/terraform/doc.go @@ -30,23 +30,22 @@ the root directory of this source tree. // // Usage // -// options := &terraform.Options{ -// Path: "./examples", -// ShowHeader: true, -// HeaderFromFile: "main.tf", -// ShowFooter: true, -// FooterFromFile: "footer.md", -// SortBy: &terraform.SortBy{ -// Name: true, -// }, -// ReadComments: true, -// } -// -// tfmodule, err := terraform.LoadWithOptions(options) -// if err != nil { -// log.Fatal(err) -// } -// -// ... -// +// options := &terraform.Options{ +// Path: "./examples", +// ShowHeader: true, +// HeaderFromFile: "main.tf", +// ShowFooter: true, +// FooterFromFile: "footer.md", +// SortBy: &terraform.SortBy{ +// Name: true, +// }, +// ReadComments: true, +// } +// +// tfmodule, err := terraform.LoadWithOptions(options) +// if err != nil { +// log.Fatal(err) +// } +// +// ... package terraform diff --git a/terraform/load.go b/terraform/load.go index 7cfa1f755..55dfc72e7 100644 --- a/terraform/load.go +++ b/terraform/load.go @@ -14,7 +14,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -109,10 +108,10 @@ func isFileFormatSupported(filename string, section string) (bool, error) { return false, fmt.Errorf("--%s-from value is missing", section) } switch getFileFormat(filename) { - case ".adoc", ".md", ".tf", ".txt": + case ".adoc", ".md", ".tf", ".tofu", ".txt": return true, nil } - return false, fmt.Errorf("only .adoc, .md, .tf, and .txt formats are supported to read %s from", section) + return false, fmt.Errorf("only .adoc, .md, .tf, .tofu and .txt formats are supported to read %s from", section) } func loadHeader(config *print.Config) (string, error) { @@ -147,8 +146,9 @@ func loadSection(config *print.Config, file string, section string) (string, err } return "", err // user explicitly asked for a file which doesn't exist } - if getFileFormat(file) != ".tf" { - content, err := ioutil.ReadFile(filepath.Clean(filename)) + format := getFileFormat(file) + if format != ".tf" && format != ".tofu" { + content, err := os.ReadFile(filepath.Clean(filename)) if err != nil { return "", err } @@ -188,10 +188,17 @@ func loadInputs(tfmodule *tfconfig.Module, config *print.Config) ([]*Input, []*I var optional = make([]*Input, 0, len(tfmodule.Variables)) for _, input := range tfmodule.Variables { + comments := loadComments(input.Pos.Filename, input.Pos.Line) + + // skip over inputs that are marked as being ignored + if strings.Contains(comments, "terraform-docs-ignore") { + continue + } + // convert CRLF to LF early on (https://github.com/terraform-docs/terraform-docs/issues/305) inputDescription := strings.ReplaceAll(input.Description, "\r\n", "\n") if inputDescription == "" && config.Settings.ReadComments { - inputDescription = loadComments(input.Pos.Filename, input.Pos.Line) + inputDescription = comments } i := &Input{ @@ -246,13 +253,20 @@ func loadModulecalls(tfmodule *tfconfig.Module, config *print.Config) []*ModuleC var source, version string for _, m := range tfmodule.ModuleCalls { - source, version = formatSource(m.Source, m.Version) + comments := loadComments(m.Pos.Filename, m.Pos.Line) + + // skip over modules that are marked as being ignored + if strings.Contains(comments, "terraform-docs-ignore") { + continue + } description := "" if config.Settings.ReadComments { - description = loadComments(m.Pos.Filename, m.Pos.Line) + description = comments } + source, version = formatSource(m.Source, m.Version) + modules = append(modules, &ModuleCall{ Name: m.Name, Source: source, @@ -278,9 +292,17 @@ func loadOutputs(tfmodule *tfconfig.Module, config *print.Config) ([]*Output, er } } for _, o := range tfmodule.Outputs { - description := o.Description + comments := loadComments(o.Pos.Filename, o.Pos.Line) + + // skip over outputs that are marked as being ignored + if strings.Contains(comments, "terraform-docs-ignore") { + continue + } + + // convert CRLF to LF early on (https://github.com/terraform-docs/terraform-docs/issues/584) + description := strings.ReplaceAll(o.Description, "\r\n", "\n") if description == "" && config.Settings.ReadComments { - description = loadComments(o.Pos.Filename, o.Pos.Line) + description = comments } output := &Output{ @@ -294,11 +316,15 @@ func loadOutputs(tfmodule *tfconfig.Module, config *print.Config) ([]*Output, er } if config.OutputValues.Enabled { - output.Sensitive = values[output.Name].Sensitive - if values[output.Name].Sensitive { - output.Value = types.ValueOf(``) + if value, ok := values[output.Name]; ok { + output.Sensitive = value.Sensitive + output.Value = types.ValueOf(value.Value) } else { - output.Value = types.ValueOf(values[output.Name].Value) + output.Value = types.ValueOf("null") + } + + if output.Sensitive { + output.Value = types.ValueOf(``) } } outputs = append(outputs, output) @@ -315,7 +341,7 @@ func loadOutputValues(config *print.Config) (map[string]*output, error) { if out, err = cmd.Output(); err != nil { return nil, fmt.Errorf("caught error while reading the terraform outputs: %w", err) } - } else if out, err = ioutil.ReadFile(config.OutputValues.From); err != nil { + } else if out, err = os.ReadFile(config.OutputValues.From); err != nil { return nil, fmt.Errorf("caught error while reading the terraform outputs file at %s: %w", config.OutputValues.From, err) } var terraformOutputs map[string]*output @@ -326,7 +352,11 @@ func loadOutputValues(config *print.Config) (map[string]*output, error) { return terraformOutputs, err } -func loadProviders(tfmodule *tfconfig.Module, config *print.Config) []*Provider { +func loadProviders(tfmodule *tfconfig.Module, config *print.Config) []*Provider { //nolint:gocyclo + // NOTE(khos2ow): this function is over our cyclomatic complexity goal. + // Be wary when adding branches, and look for functionality that could + // be reasonably moved into an injected dependency. + type provider struct { Name string `hcl:"name,label"` Version string `hcl:"version"` @@ -356,6 +386,13 @@ func loadProviders(tfmodule *tfconfig.Module, config *print.Config) []*Provider for _, resource := range resources { for _, r := range resource { + comments := loadComments(r.Pos.Filename, r.Pos.Line) + + // skip over resources that are marked as being ignored + if strings.Contains(comments, "terraform-docs-ignore") { + continue + } + var version = "" if l, ok := lock[r.Provider.Name]; ok { version = l.Version @@ -364,6 +401,10 @@ func loadProviders(tfmodule *tfconfig.Module, config *print.Config) []*Provider } key := fmt.Sprintf("%s.%s", r.Provider.Name, r.Provider.Alias) + if _, ok := discovered[key]; ok { + continue + } + discovered[key] = &Provider{ Name: r.Provider.Name, Alias: types.String(r.Provider.Alias), @@ -380,6 +421,7 @@ func loadProviders(tfmodule *tfconfig.Module, config *print.Config) []*Provider for _, provider := range discovered { providers = append(providers, provider) } + return providers } @@ -416,6 +458,13 @@ func loadResources(tfmodule *tfconfig.Module, config *print.Config) []*Resource for _, resource := range allResources { for _, r := range resource { + comments := loadComments(r.Pos.Filename, r.Pos.Line) + + // skip over resources that are marked as being ignored + if strings.Contains(comments, "terraform-docs-ignore") { + continue + } + var version string if rv, ok := tfmodule.RequiredProviders[r.Provider.Name]; ok { version = resourceVersion(rv.VersionConstraints) @@ -433,7 +482,7 @@ func loadResources(tfmodule *tfconfig.Module, config *print.Config) []*Resource description := "" if config.Settings.ReadComments { - description = loadComments(r.Pos.Filename, r.Pos.Line) + description = comments } discovered[key] = &Resource{ diff --git a/terraform/load_test.go b/terraform/load_test.go index 984acd5d5..563770f20 100644 --- a/terraform/load_test.go +++ b/terraform/load_test.go @@ -11,12 +11,14 @@ the root directory of this source tree. package terraform import ( - "io/ioutil" + "fmt" + "os" "path/filepath" "sort" "testing" "github.com/stretchr/testify/assert" + "golang.org/x/exp/slices" "github.com/terraform-docs/terraform-docs/print" ) @@ -38,6 +40,7 @@ func TestLoadModuleWithOptions(t *testing.T) { assert.Equal(true, module.HasModuleCalls()) assert.Equal(true, module.HasProviders()) assert.Equal(true, module.HasRequirements()) + assert.Equal(true, module.HasResources()) config.Sections.Header = false config.Sections.Footer = true @@ -158,6 +161,14 @@ func TestIsFileFormatSupported(t *testing.T) { errText: "", section: "header", }, + { + name: "is file format supported", + filename: "main.tofu", + expected: true, + wantErr: false, + errText: "", + section: "header", + }, { name: "is file format supported", filename: "main.txt", @@ -171,7 +182,7 @@ func TestIsFileFormatSupported(t *testing.T) { filename: "main.doc", expected: false, wantErr: true, - errText: "only .adoc, .md, .tf, and .txt formats are supported to read header from", + errText: "only .adoc, .md, .tf, .tofu and .txt formats are supported to read header from", section: "header", }, { @@ -186,7 +197,7 @@ func TestIsFileFormatSupported(t *testing.T) { filename: "main.doc", expected: false, wantErr: true, - errText: "only .adoc, .md, .tf, and .txt formats are supported to read footer from", + errText: "only .adoc, .md, .tf, .tofu and .txt formats are supported to read footer from", section: "footer", }, { @@ -226,7 +237,7 @@ func TestLoadHeader(t *testing.T) { showHeader: true, expectedData: func() (string, error) { path := filepath.Join("testdata", "expected", "full-example-mainTf-Header.golden") - data, err := ioutil.ReadFile(path) + data, err := os.ReadFile(path) return string(data), err }, }, @@ -272,7 +283,7 @@ func TestLoadFooter(t *testing.T) { showFooter: true, expectedData: func() (string, error) { path := filepath.Join("testdata", "expected", "full-example-mainTf-Header.golden") - data, err := ioutil.ReadFile(path) + data, err := os.ReadFile(path) return string(data), err }, }, @@ -402,7 +413,7 @@ func TestLoadSections(t *testing.T) { file: "wrong-formate.docx", expected: "", wantErr: true, - errText: "only .adoc, .md, .tf, and .txt formats are supported to read footer from", + errText: "only .adoc, .md, .tf, .tofu and .txt formats are supported to read footer from", section: "footer", }, { @@ -589,7 +600,7 @@ func TestLoadOutputs(t *testing.T) { name: "load module outputs from path", path: "full-example", expected: expected{ - outputs: 3, + outputs: 4, }, }, { @@ -618,6 +629,37 @@ func TestLoadOutputs(t *testing.T) { } } +func TestLoadOutputsLineEnding(t *testing.T) { + tests := []struct { + name string + path string + expected string + }{ + { + name: "load module outputs from file with lf line ending", + path: "outputs-lf", + expected: "The quick brown fox jumps\nover the lazy dog\n", + }, + { + name: "load module outputs from file with crlf line ending", + path: "outputs-crlf", + expected: "The quick brown fox jumps\nover the lazy dog\n", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert := assert.New(t) + + config := print.NewConfig() + module, _ := loadModule(filepath.Join("testdata", tt.path)) + outputs, _ := loadOutputs(module, config) + + assert.Equal(1, len(outputs)) + assert.Equal(tt.expected, string(outputs[0].Description)) + }) + } +} + func TestLoadOutputsValues(t *testing.T) { type expected struct { outputs int @@ -634,7 +676,7 @@ func TestLoadOutputsValues(t *testing.T) { path: "full-example", outputPath: "output-values.json", expected: expected{ - outputs: 3, + outputs: 4, }, wantErr: false, }, @@ -743,6 +785,87 @@ func TestLoadProviders(t *testing.T) { } } +func TestLoadRequirements(t *testing.T) { + type expected struct { + requirements []string + } + tests := []struct { + name string + path string + expected expected + }{ + { + name: "load module requirements from path", + path: "full-example", + expected: expected{ + requirements: []string{"terraform >= 0.12", "aws >= 2.15.0"}, + }, + }, + { + name: "load module requirements from path", + path: "no-requirements", + expected: expected{ + requirements: []string{}, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert := assert.New(t) + + module, _ := loadModule(filepath.Join("testdata", tt.path)) + requirements := loadRequirements(module) + + assert.Equal(len(tt.expected.requirements), len(requirements)) + + for i, r := range tt.expected.requirements { + assert.Equal(r, fmt.Sprintf("%s %s", requirements[i].Name, requirements[i].Version)) + } + }) + } +} + +func TestLoadResources(t *testing.T) { + type expected struct { + resources []string + } + tests := []struct { + name string + path string + expected expected + }{ + { + name: "load module resources from path", + path: "full-example", + expected: expected{ + resources: []string{"tls_private_key.baz", "aws_caller_identity.current", "null_resource.foo"}, + }, + }, + { + name: "load module resources from path", + path: "no-resources", + expected: expected{ + resources: []string{}, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert := assert.New(t) + + config := print.NewConfig() + module, _ := loadModule(filepath.Join("testdata", tt.path)) + resources := loadResources(module, config) + + assert.Equal(len(tt.expected.resources), len(resources)) + + for _, r := range resources { + assert.True(slices.Contains(tt.expected.resources, fmt.Sprintf("%s_%s.%s", r.ProviderName, r.Type, r.Name))) + } + }) + } +} + func TestLoadComments(t *testing.T) { tests := []struct { name string @@ -865,7 +988,7 @@ func TestSortItems(t *testing.T) { inputs: []string{"D", "B", "E", "A", "C", "F", "G"}, required: []string{"A", "F"}, optional: []string{"D", "B", "E", "C", "G"}, - outputs: []string{"C", "A", "B"}, + outputs: []string{"C", "A", "B", "D"}, providers: []string{"tls", "aws", "null"}, }, }, @@ -878,7 +1001,7 @@ func TestSortItems(t *testing.T) { inputs: []string{"D", "B", "E", "A", "C", "F", "G"}, required: []string{"A", "F"}, optional: []string{"D", "B", "E", "C", "G"}, - outputs: []string{"C", "A", "B"}, + outputs: []string{"C", "A", "B", "D"}, providers: []string{"tls", "aws", "null"}, }, }, @@ -891,7 +1014,7 @@ func TestSortItems(t *testing.T) { inputs: []string{"D", "B", "E", "A", "C", "F", "G"}, required: []string{"A", "F"}, optional: []string{"D", "B", "E", "C", "G"}, - outputs: []string{"C", "A", "B"}, + outputs: []string{"C", "A", "B", "D"}, providers: []string{"tls", "aws", "null"}, }, }, @@ -904,7 +1027,7 @@ func TestSortItems(t *testing.T) { inputs: []string{"A", "B", "C", "D", "E", "F", "G"}, required: []string{"A", "F"}, optional: []string{"B", "C", "D", "E", "G"}, - outputs: []string{"A", "B", "C"}, + outputs: []string{"A", "B", "C", "D"}, providers: []string{"aws", "null", "tls"}, }, }, @@ -917,7 +1040,7 @@ func TestSortItems(t *testing.T) { inputs: []string{"A", "F", "B", "C", "D", "E", "G"}, required: []string{"A", "F"}, optional: []string{"B", "C", "D", "E", "G"}, - outputs: []string{"A", "B", "C"}, + outputs: []string{"A", "B", "C", "D"}, providers: []string{"aws", "null", "tls"}, }, }, @@ -930,7 +1053,7 @@ func TestSortItems(t *testing.T) { inputs: []string{"A", "F", "G", "B", "C", "D", "E"}, required: []string{"A", "F"}, optional: []string{"G", "B", "C", "D", "E"}, - outputs: []string{"A", "B", "C"}, + outputs: []string{"A", "B", "C", "D"}, providers: []string{"aws", "null", "tls"}, }, }, diff --git a/terraform/testdata/full-example/main.tf b/terraform/testdata/full-example/main.tf index a05236ad1..de5adc306 100644 --- a/terraform/testdata/full-example/main.tf +++ b/terraform/testdata/full-example/main.tf @@ -21,13 +21,31 @@ data "aws_caller_identity" "current" { provider = "aws" } +# terraform-docs-ignore +data "aws_caller_identity" "ignored" { + provider = "aws" +} + resource "null_resource" "foo" {} +# terraform-docs-ignore +resource "null_resource" "ignored" {} + module "foo" { source = "bar" version = "1.2.3" } module "foobar" { - source = "git@github.com:module/path?ref=v7.8.9" + source = "git@github.com:module/path?ref=v7.8.9" +} + +locals { + arn = provider::aws::arn_parse("arn:aws:iam::444455556666:role/example") +} + +// terraform-docs-ignore +module "ignored" { + source = "baz" + version = "1.2.3" } diff --git a/terraform/testdata/full-example/outputs.tf b/terraform/testdata/full-example/outputs.tf index 1024f48f4..211ae2ae2 100644 --- a/terraform/testdata/full-example/outputs.tf +++ b/terraform/testdata/full-example/outputs.tf @@ -12,3 +12,13 @@ output "A" { output "B" { value = "b" } + +// D null result +output "D" { + value = null +} + +# terraform-docs-ignore +output "ignored" { + value = "e" +} diff --git a/terraform/testdata/full-example/variables.tf b/terraform/testdata/full-example/variables.tf index c504a0f63..f395bbd82 100644 --- a/terraform/testdata/full-example/variables.tf +++ b/terraform/testdata/full-example/variables.tf @@ -28,3 +28,9 @@ variable "G" { description = "G description" default = null } + +# terraform-docs-ignore +variable "ignored" { + description = "H description" + default = null +} diff --git a/terraform/testdata/inputs-crlf/variables.tf b/terraform/testdata/inputs-crlf/variables.tf index 2333cc825..6304af718 100644 --- a/terraform/testdata/inputs-crlf/variables.tf +++ b/terraform/testdata/inputs-crlf/variables.tf @@ -1,4 +1,4 @@ -variable "multi-line-lf" { +variable "multi-line-crlf" { type = string description = <<-EOT The quick brown fox jumps diff --git a/terraform/testdata/inputs-lf/variables.tf b/terraform/testdata/inputs-lf/variables.tf index b2cbf5279..fbc095800 100644 --- a/terraform/testdata/inputs-lf/variables.tf +++ b/terraform/testdata/inputs-lf/variables.tf @@ -1,4 +1,4 @@ -variable "multi-line-crlf" { +variable "multi-line-lf" { type = string description = <<-EOT The quick brown fox jumps diff --git a/terraform/testdata/no-requirements/main.tf b/terraform/testdata/no-requirements/main.tf new file mode 100644 index 000000000..e69de29bb diff --git a/terraform/testdata/no-resources/main.tf b/terraform/testdata/no-resources/main.tf new file mode 100644 index 000000000..e69de29bb diff --git a/terraform/testdata/outputs-crlf/outputs.tf b/terraform/testdata/outputs-crlf/outputs.tf new file mode 100644 index 000000000..18266be25 --- /dev/null +++ b/terraform/testdata/outputs-crlf/outputs.tf @@ -0,0 +1,7 @@ +output "multi-line-crlf" { + value = "foo" + description = <<-EOT + The quick brown fox jumps + over the lazy dog + EOT +} diff --git a/terraform/testdata/outputs-lf/outputs.tf b/terraform/testdata/outputs-lf/outputs.tf new file mode 100644 index 000000000..ab5daf699 --- /dev/null +++ b/terraform/testdata/outputs-lf/outputs.tf @@ -0,0 +1,7 @@ +output "multi-line-lf" { + value = "foo" + description = <<-EOT + The quick brown fox jumps + over the lazy dog + EOT +} diff --git a/terraform/testdata/read-comments/variables.tf b/terraform/testdata/read-comments/variables.tf index be42f6680..5ad8d3f72 100644 --- a/terraform/testdata/read-comments/variables.tf +++ b/terraform/testdata/read-comments/variables.tf @@ -7,3 +7,8 @@ variable "B" { output "B" { value = "b" } + +// terraform-docs-ignore +output "ignored" { + value = "c" +}