diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f3df96b..baddda8 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,7 +7,7 @@ assignees: '' --- -Found a bug? Maybe our [Slack Community](https://slack.cloudposse.com) can help. +Found a bug? Maybe our [Slack Community](https://slack.cloudposse.com) can help. [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) @@ -34,4 +34,4 @@ Anything that will help us triage the bug will help. Here are some ideas: - Version [e.g. 10.15] ## Additional Context -Add any other context about the problem here. \ No newline at end of file +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 94d3246..f40fe2f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -8,7 +8,7 @@ body: attributes: value: | Found a bug? - + Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/). diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 76ae6d6..918f371 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -15,4 +15,4 @@ contact_links: - name: DevOps Accelerator Program url: https://cloudposse.com/accelerate/ about: |- - Own your infrastructure in record time. We build it. You drive it. + Own your infrastructure in record time. We build it. You drive it. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 39a8686..44cdd4a 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -7,13 +7,13 @@ assignees: '' --- -Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/). +Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/). [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) ## Describe the Feature -A clear and concise description of what the bug is. +A clear and concise description of what the bug is. ## Expected Behavior diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 7b86672..44047f0 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -8,7 +8,7 @@ body: attributes: value: | Have a question? - + Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/). @@ -39,7 +39,7 @@ body: description: | Is your feature request related to a problem/challenge you are trying to solve? - + Please provide some additional context of why this feature or capability will be valuable. validations: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8944933..f5fb7d4 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,7 +8,7 @@ ## why @@ -16,6 +16,6 @@ ## references diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml new file mode 100644 index 0000000..64fa9f9 --- /dev/null +++ b/.github/workflows/autofix.yml @@ -0,0 +1,56 @@ +--- +# The workflow name **must** be "autofix.ci" for Autofix CI to function correctly. +# Any deviation from this name will cause Autofix CI to fail, as it relies on this +# specific identifier for execution. This is a strict requirement of Autofix CI. +name: autofix.ci +on: pull_request +permissions: {} +jobs: + autofix: + runs-on: ubuntu-24.04 + permissions: {} + timeout-minutes: 15 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + - uses: aquaproj/aqua-installer@5e54e5cee8a95ee2ce7c04cb993da6dfad13e59c # v3.1.2 + with: + aqua_version: v2.43.0 + + - name: Update aqua-checksums.json + run: aqua upc -prune + + # go mod tidy + - uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 + with: + go-version-file: go.mod + - run: go mod tidy + + # gofumpt + - name: Get changed Go files + id: changed-files + uses: tj-actions/changed-files@e7b157b1c4ad44acfc8d9be14b8cd8f5058636e3 # v45.0.6 + with: + use_rest_api: "true" + files: | + **/*.go + - if: steps.changed-files.outputs.all_changed_files_count != '0' + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + run: | + # shellcheck disable=SC2086 + gofumpt -l -w $ALL_CHANGED_FILES + + # Run pre-commit hooks for whitespace fixes + - name: Install pre-commit + run: | + pip install pre-commit + + - name: Run pre-commit whitespace fixes + run: | + # Run only the whitespace-related hooks from pre-commit + pre-commit run trailing-whitespace --all-files || true + pre-commit run end-of-file-fixer --all-files || true + + - uses: autofix-ci/action@2891949f3779a1cafafae1523058501de3d4e944 # v1.3.1 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..1fd9570 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,100 @@ +name: "CodeQL" + +on: + push: + branches: ["main"] + pull_request: + # The branches below must be a subset of the branches above + branches: ["main"] + types: [opened, labeled, unlabeled, synchronize] + schedule: + # runs on 19:17 every Tuesday + - cron: "27 19 * * 2" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + timeout-minutes: 360 + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ["go", "javascript-typescript"] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" + + lint-golangci: + name: "Lint (golangci)" + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + permissions: + # Required: allow read access to the content for analysis. + contents: read + # allow read access to pull request. Use with `only-new-issues` option. + pull-requests: read + # allow write access to checks to allow the action to annotate code in the PR. + checks: write + # allow write access to security events to allow the action to upload SARIF files. + security-events: write + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v8 + id: golangci + with: + version: v2.4.0 + only-new-issues: true # Shows only issues introduced in the PR + # Not all line numbers in diff may match the linter's line outputs + # See: https://github.com/golangci/golangci-lint/issues/4376#issuecomment-1938874827 + # Always exit 0 so we upload the sarif file to CodeQL + args: > + --output.sarif.path=golangci-lint.sarif + --issues-exit-code=0 + + - name: Upload filtered SARIF results + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: golangci-lint.sarif diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..697dc74 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,55 @@ +name: Pre-commit + +on: + pull_request: + types: [opened, synchronize, reopened] + +env: + # Ensure pre-commit uses the right Python version + PYTHON_VERSION: "3.11" + # Skip hooks that are already running in other CI jobs to avoid redundant work + # go-build-mod: Already runs in test.yml build job + # golangci-lint: Already runs in codeql.yml lint-golangci job + SKIP: go-build-mod,golangci-lint + +jobs: + pre-commit: + name: Run pre-commit hooks + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + # Fetch full history for proper diff checking + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Install Go tools + run: | + # Install gofumpt for pre-commit + go install mvdan.cc/gofumpt@latest + + # Install golangci-lint v2 + go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.5.0 + + # Add Go bin to PATH + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Run CloudPosse pre-commit action + uses: cloudposse/github-action-pre-commit@v4.0.0 + with: + # Run against files changed in the PR only + # This prevents formatting/checking unrelated files + extra_args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref HEAD diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aedd852..a58247f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,13 +26,13 @@ jobs: timeout-minutes: 5 steps: - name: Check out code into the Go module directory - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Install Atmos uses: cloudposse/github-action-setup-atmos@v2 with: token: ${{ github.token }} - install-wrapper: false + install-wrapper: false - name: Set up Go uses: actions/setup-go@v5 @@ -66,7 +66,7 @@ jobs: - "1.6.3" steps: - name: Check out code into the Go module directory - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Install Atmos uses: cloudposse/github-action-setup-atmos@v2 diff --git a/.github/workflows/validate-codeowners.yml b/.github/workflows/validate-codeowners.yml index d97f0ce..67ca1b3 100644 --- a/.github/workflows/validate-codeowners.yml +++ b/.github/workflows/validate-codeowners.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: "Checkout source code at current commit" - uses: actions/checkout@v4 + uses: actions/checkout@v5 # Leave pinned at 0.7.1 until https://github.com/mszostok/codeowners-validator/issues/173 is resolved - uses: mszostok/codeowners-validator@v0.7.1 if: github.event.pull_request.head.repo.full_name == github.repository diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..75dceea --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,203 @@ +version: "2" +run: + tests: true +linters: + enable: + - bodyclose + - cyclop + - dogsled + - dupl + - err113 + - forbidigo + - funlen + - gocognit + - gocritic + - godot + - gosec + - importas + - loggercheck + - misspell + - nestif + - nilerr + - nolintlint + - revive + - rowserrcheck + - tparallel + - unconvert + - unparam + - unused + - whitespace + settings: + cyclop: + max-complexity: 15 + dogsled: + max-blank-identifiers: 3 + dupl: + threshold: 150 + forbidigo: + forbid: + - pattern: os\.Getenv + msg: Use `viper.BindEnv` for new environment variables instead of `os.Getenv` + - pattern: '\.(Skip|SkipNow)\(' + msg: Use `t.Skipf("")` with a descriptive reason; do not use `t.Skip`/`t.SkipNow` + - pattern: ^path\.Join$ + msg: Use `filepath.Join` for OS-appropriate path separators instead of `path.Join` (which always uses forward slashes) + exclude-godoc-examples: false + analyze-types: false + funlen: + lines: 60 + statements: 40 + ignore-comments: true + gocognit: + min-complexity: 20 + gocritic: + enabled-checks: + - rangeValCopy + - hugeParam + - commentedOutCode + - emptyDecl + - filepathJoin + - commentedOutImport + - initClause + - nestingReduce + - preferFilepathJoin + godot: + capital: true + period: true + gosec: + excludes: + - G101 + importas: + alias: + - pkg: github.com/cloudposse/atmos/pkg/logger + alias: log + no-unaliased: true + no-extra-aliases: false + lll: + line-length: 120 + tab-width: 4 + loggercheck: + kitlog: false + klog: false + logr: false + slog: false + zap: false + require-string-key: true + no-printf-like: true + rules: + - (github.com/cloudposse/atmos/pkg/logger.AtmosLogger).Info + - (github.com/cloudposse/atmos/pkg/logger.AtmosLogger).Error + - (github.com/cloudposse/atmos/pkg/logger.AtmosLogger).Warn + - (github.com/cloudposse/atmos/pkg/logger.AtmosLogger).Debug + - (github.com/cloudposse/atmos/pkg/logger.AtmosLogger).Fatal + - (github.com/cloudposse/atmos/pkg/logger.AtmosLogger).Trace + nestif: + min-complexity: 4 + revive: + rules: + - name: banned-characters + arguments: + - goto + - name: error-strings + arguments: + - disallow-newlines: true + - name: file-length-limit + arguments: + - max: 500 + skipBlankLines: true + skipComments: true + - name: function-length + arguments: + - 50 + - 60 + - name: function-result-limit + arguments: + - 3 + - name: cognitive-complexity + arguments: + - 25 + - name: cyclomatic + arguments: + - 10 + - name: add-constant + arguments: + - allowFloats: 0.0,0.,1.0,1.,2.0,2. + allowInts: 0,1,2,3,4 + allowStrs: '"","image","error","path","import","path","%w","%s","file","/"' + maxLitCount: "3" + - name: argument-limit + arguments: + - 5 + - name: deep-exit + - name: early-return + - name: comment-spacings + arguments: + - mypragma + - otherpragma + disabled: false + - name: var-declaration + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - err113 + - errcheck + - forbidigo + - funlen + - gocognit + - gosec + - revive + path: _test\.go$ + - linters: + - cyclop + path: (.+)_test\.go + # Allow fmt.Errorf when wrapping static errors from errUtils package + - linters: + - err113 + source: 'fmt\.Errorf\("%w: .+", errUtils\.' + # Allow fmt.Errorf when wrapping any static Err* variable + - linters: + - err113 + source: 'fmt\.Errorf\("%w: .+", Err[A-Z]' + # Allow errors.Join with fmt.Errorf for converting strings to errors + - linters: + - err113 + path: ".*" + source: 'errors\.Join\(.*errUtils\..*fmt\.Errorf' + paths: + - experiments/.* + - third_party$ + - builtin$ + - examples$ +issues: + max-issues-per-linter: 0 + max-same-issues: 0 + +severity: + default: error + rules: + - linters: + - revive + text: "cognitive-complexity|cyclomatic|function-length|function-result-limit|comment-spacings" + severity: warning + - linters: + - nestif + - nolintlint + severity: warning +formatters: + enable: + - gofumpt + - goimports + exclusions: + generated: lax + paths: + - experiments/.* + - third_party$ + - builtin$ + - examples$ + - _test\.go$ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..363e6c2 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,52 @@ +repos: + # Go-specific hooks + - repo: https://github.com/tekwizely/pre-commit-golang + rev: v1.0.0-rc.1 + hooks: + - id: go-fumpt + args: [-w] + exclude: ^(vendor/|tests/test-cases/|tests/testdata/|tests/snapshots/) + + - id: go-build-mod + name: Check Go build + description: Ensure code compiles before commit + + - id: go-mod-tidy + name: Tidy go.mod + description: Ensure go.mod and go.sum are clean + + # Run golangci-lint using system binary to avoid Go 1.25 compatibility issues + - repo: local + hooks: + - id: golangci-lint-config-verify + name: golangci-lint config verify + description: Validate golangci-lint configuration file schema + entry: golangci-lint config verify + language: system + files: ^\.golangci\.yml$ + pass_filenames: false + + - id: golangci-lint + name: golangci-lint + description: Run golangci-lint on modified Go files + entry: golangci-lint run --new-from-rev=origin/main --config=.golangci.yml + language: system + types: [go] + pass_filenames: false + require_serial: true + exclude: ^(vendor/|tests/test-cases/|tests/testdata/|tests/snapshots/) + + # General file hygiene + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + exclude: ^(vendor/|tests/test-cases/|tests/testdata/|tests/snapshots/|.*\.svg|website/src/components/Screengrabs/) + - id: end-of-file-fixer + exclude: ^(vendor/|tests/test-cases/|tests/testdata/|tests/snapshots/|.*\.svg|website/src/components/Screengrabs/) + - id: check-yaml + exclude: ^(vendor/|examples/tests/stacks/catalog/invalid-yaml-and-schema/|examples/tests/components/helmfile/.*/helmfile.yaml) + args: [--allow-multiple-documents, --unsafe] + - id: check-added-large-files + args: [--maxkb=500] + exclude: ^(docs/demo.gif|website/) diff --git a/.vscode/launch.json b/.vscode/launch.json index da54ddb..9f07c45 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -30,4 +30,4 @@ ], } ] -} \ No newline at end of file +} diff --git a/aqua/aqua-checksums.json b/aqua/aqua-checksums.json new file mode 100644 index 0000000..c6ed5ba --- /dev/null +++ b/aqua/aqua-checksums.json @@ -0,0 +1,34 @@ +{ + "checksums": [ + { + "id": "github_release/github.com/mvdan/gofumpt/v0.7.0/gofumpt_v0.7.0_darwin_amd64", + "checksum": "B7D05E092DA45C5EC96344AB635B1D6547C3E27C840BA39BC76989934EFD7CE3", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/mvdan/gofumpt/v0.7.0/gofumpt_v0.7.0_darwin_arm64", + "checksum": "08F23114760A090B090706D92B8C52B9875B9EB352D76C77AA354D6AA20B045A", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/mvdan/gofumpt/v0.7.0/gofumpt_v0.7.0_linux_amd64", + "checksum": "6FF459C1DCAE3B0B00844C1A5A4A5B0F547237D8A4F3624AAEA8D424AEEF24C6", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/mvdan/gofumpt/v0.7.0/gofumpt_v0.7.0_linux_arm64", + "checksum": "00C18C88EF50437629626BA20D677F4648684CB280952814CDD887677D42CBD3", + "algorithm": "sha256" + }, + { + "id": "github_release/github.com/mvdan/gofumpt/v0.7.0/gofumpt_v0.7.0_windows_amd64.exe", + "checksum": "65F5B9EA7723AA936FA6880E184624747E9E6481802B62D4CB5B774EF2350CEC", + "algorithm": "sha256" + }, + { + "id": "registries/github_content/github.com/aquaproj/aqua-registry/v4.302.1/registry.yaml", + "checksum": "908B44E94A3583AA2D6F0B17F53E49D01ACD57E4ECDFEDB29EB082D335D9445478426E591AB57D37BAA02A2EF9581A71A3AA66C825CC787323D65A1D89B53072", + "algorithm": "sha512" + } + ] +} diff --git a/aqua/aqua.yaml b/aqua/aqua.yaml new file mode 100644 index 0000000..ce421d3 --- /dev/null +++ b/aqua/aqua.yaml @@ -0,0 +1,12 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/aquaproj/aqua/main/json-schema/aqua-yaml.json +# aqua - Declarative CLI Version Manager +# https://aquaproj.github.io/ +checksum: + enabled: true + require_checksum: true +registries: + - type: standard + ref: v4.302.1 # renovate: depName=aquaproj/aqua-registry +packages: + - import: imports/*.yaml diff --git a/aqua/imports/gofumpt.yaml b/aqua/imports/gofumpt.yaml new file mode 100644 index 0000000..54f5e17 --- /dev/null +++ b/aqua/imports/gofumpt.yaml @@ -0,0 +1,2 @@ +packages: + - name: mvdan/gofumpt@v0.7.0 diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..af265e3 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,35 @@ +codecov: + require_ci_to_pass: true + +coverage: + status: + project: + default: + target: auto # Automatically use the base branch's coverage + threshold: 1% # Allow up to 1% drop to account for Codecov rounding + base: auto + if_not_found: success # Don't fail if base coverage is missing + paths: # Only track Go files for coverage calculations + - "**/*.go" + patch: + default: + target: 80% # Target at least 80% test coverage on new/changed lines + informational: true # Make patch coverage informational only + base: auto + paths: # Only track Go files for coverage calculations + - "**/*.go" + ignore: + - "**/mock_*.go" # Adjust this pattern based on your project structure + - "mock_*.go" # Adjust this pattern based on your project structure + - "**/mock/*.go" # Adjust interface required for mocking + - "**/*_test_helpers.go" # Test helper files (not test files but used only by tests) + - "**/testhelpers/**" # Test helper packages (used only by tests) + +comment: + layout: "reach,diff,flags,tree" # Display different coverage views + behavior: default # Default PR comment behavior + require_changes: true # Only post if coverage changes + require_base: true # Compare against base branch coverage + +github_checks: + annotations: true # Enable GitHub Checks Annotations diff --git a/docs/index.md b/docs/index.md index c699dee..e212a0b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,4 +18,4 @@ provider "utils" { ``` -## Schema \ No newline at end of file +## Schema diff --git a/examples/README.md b/examples/README.md index 876bb98..5874000 100644 --- a/examples/README.md +++ b/examples/README.md @@ -2,8 +2,8 @@ This directory contains examples that are mostly used for documentation, but can also be run/tested manually via the Terraform CLI. -The document generation tool looks for files in the following locations by default. -All other \*.tf files besides the ones mentioned below are ignored by the documentation tool. +The document generation tool looks for files in the following locations by default. +All other \*.tf files besides the ones mentioned below are ignored by the documentation tool. This is useful for creating examples that can run and/or are testable even if some parts are not relevant for the documentation. - **provider/provider.tf** example file for the provider index page diff --git a/examples/tests/components/terraform/test/test-component/providers_override.tf.json b/examples/tests/components/terraform/test/test-component/providers_override.tf.json index 615a68e..534cbd5 100644 --- a/examples/tests/components/terraform/test/test-component/providers_override.tf.json +++ b/examples/tests/components/terraform/test/test-component/providers_override.tf.json @@ -35,4 +35,4 @@ } } } -} \ No newline at end of file +} diff --git a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-7.yaml b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-7.yaml index 16b9992..c3be914 100644 --- a/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-7.yaml +++ b/examples/tests/stacks/catalog/invalid-yaml-and-schema/invalid-schema-7.yaml @@ -10,4 +10,3 @@ helmfile: vars: {} settings: - diff --git a/internal/provider/data_source_deep_merge_json.go b/internal/provider/data_source_deep_merge_json.go index 66ea23b..c57bb36 100644 --- a/internal/provider/data_source_deep_merge_json.go +++ b/internal/provider/data_source_deep_merge_json.go @@ -61,7 +61,7 @@ func dataSourceDeepMergeJSONRead(ctx context.Context, d *schema.ResourceData, me } // Convert result to JSON - var json = jsoniter.ConfigDefault + json := jsoniter.ConfigDefault jsonResult, err := json.Marshal(merged) if err != nil { return diag.FromErr(err) diff --git a/main.go b/main.go index 716fe35..66094c1 100644 --- a/main.go +++ b/main.go @@ -9,9 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/plugin" ) -var ( - version = "dev" -) +var version = "dev" func main() { var debugMode bool diff --git a/templates/index.md.tmpl b/templates/index.md.tmpl index 68fe4b8..da9b81d 100644 --- a/templates/index.md.tmpl +++ b/templates/index.md.tmpl @@ -13,4 +13,4 @@ The utils provider contains data sources to perform tasks that are difficult to {{tffile "examples/provider/provider.tf"}} -{{ .SchemaMarkdown | trimspace }} \ No newline at end of file +{{ .SchemaMarkdown | trimspace }} diff --git a/tools/tools.go b/tools/tools.go index 2735de6..f770edf 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -1,3 +1,4 @@ +//go:build tools // +build tools package tools