From 4cdc7927418e754dd833d80e3056e823520a4cac Mon Sep 17 00:00:00 2001 From: Ryan Parman Date: Mon, 20 May 2024 12:03:21 -0600 Subject: [PATCH] style: Added yamlfmt config and performed updates. --- .github/dependabot.yml | 4 +- .github/workflows/dependabot-auto-merge.yml | 1 + .golangci.yml | 482 ++++++++++++------ .pre-commit-config.yaml | 123 ++--- .yamlfmt.yml | 22 + .yamllint | 74 --- cmd/root.go | 1 + cmd/version.go | 3 +- corefunc/env_ensure_test.go | 3 +- corefunc/url.go | 1 + corefuncprovider/env_ensure_data_source.go | 1 + corefuncprovider/env_ensure_function.go | 1 + .../homedir_expand_data_source.go | 1 + corefuncprovider/homedir_expand_function.go | 1 + corefuncprovider/homedir_get_data_source.go | 1 + corefuncprovider/homedir_get_function.go | 1 + corefuncprovider/int_leftpad_data_source.go | 1 + corefuncprovider/int_leftpad_function.go | 1 + corefuncprovider/str_camel_data_source.go | 1 + corefuncprovider/str_camel_function.go | 1 + corefuncprovider/str_constant_data_source.go | 1 + corefuncprovider/str_constant_function.go | 1 + .../str_iterative_replace_data_source.go | 1 + .../str_iterative_replace_function.go | 1 + corefuncprovider/str_kebab_data_source.go | 1 + corefuncprovider/str_kebab_function.go | 1 + corefuncprovider/str_leftpad_data_source.go | 1 + corefuncprovider/str_leftpad_function.go | 1 + corefuncprovider/str_pascal_function.go | 1 + corefuncprovider/str_snake_data_source.go | 1 + corefuncprovider/str_snake_function.go | 1 + .../str_truncate_label_function.go | 1 + corefuncprovider/url_parse_data_source.go | 1 + .../url_parse_data_source_test.go | 1 + corefuncprovider/url_parse_function.go | 1 + generator/go.mod | 2 +- terratest/data-sources/terraform_test.go | 5 +- terratest/functions/terraform_test.go | 5 +- 38 files changed, 443 insertions(+), 308 deletions(-) create mode 100644 .yamlfmt.yml delete mode 100644 .yamllint diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 14fc0af6..fa649748 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,8 +6,8 @@ version: 2 updates: - - package-ecosystem: gomod # See documentation for possible values - directory: / # Location of package manifests + - package-ecosystem: gomod # See documentation for possible values + directory: / # Location of package manifests schedule: interval: daily diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 649dd9ec..1119fe3f 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -1,3 +1,4 @@ +--- name: Auto-merge Dependabot Pull Requests on: pull_request_target diff --git a/.golangci.yml b/.golangci.yml index 26f25d1c..c9689c56 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,8 +1,8 @@ --- -# This file contains all available configuration options with their default -# values. +# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml +# https://golangci-lint.run/jsonschema/golangci.jsonschema.json -# options for analysis running +# goplicate-start:run run: # The default concurrency value is the number of available CPU. # concurrency: 4 @@ -46,6 +46,14 @@ run: # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18 # go: "1.21" +# goplicate-end:run + +# goplicate-start:severity +severity: + case-sensitive: false +# goplicate-end:severity + +# goplicate-start:linters linters: # please, do not use `enable-all`: it's deprecated and will be removed soon. # inverted configuration with `enable-all` and `disable` is not scalable @@ -78,7 +86,6 @@ linters: - gofumpt # - goheader - goimports - - gomnd # - gomoddirectives # - gomodguard - gosec @@ -94,6 +101,7 @@ linters: - maintidx - makezero - misspell + - mnd # - musttag - nakedret - nestif @@ -126,7 +134,9 @@ linters: - wrapcheck - wsl -# output configuration options +# goplicate-end:linters + +# goplicate-start:output output: # The formats used to render issues. # Format: `colored-line-number`, `line-number`, `json`, `colored-tab`, `tab`, `checkstyle`, `code-climate`, `junit-xml`, `github-actions`, `teamcity` @@ -186,18 +196,29 @@ output: # Default: false show-stats: true -# all available settings of specific linters +# goplicate-end:output + linters-settings: + # goplicate-start:settings-asasalint # asasalint: + # goplicate-end:settings-asasalint + + # goplicate-start:settings-bidichk # bidichk: + # goplicate-end:settings-bidichk + # goplicate-start:settings-copyloopvar copyloopvar: # If true, ignore aliasing of loop variables. # Default: false ignore-alias: false + # goplicate-end:settings-copyloopvar + # goplicate-start:settings-cyclop # cyclop: + # goplicate-end:settings-cyclop + # goplicate-start:settings-decorder decorder: # Required order of `type`, `const`, `var` and `func` declarations inside a file. # Default: types before constants before variables before functions. @@ -218,17 +239,25 @@ linters-settings: # If true, multiple global `type`, `const` and `var` declarations are allowed. # Default: true (disabled) disable-dec-num-check: false + # goplicate-end:settings-decorder + # goplicate-start:settings-depguard # depguard: + # goplicate-end:settings-depguard + # goplicate-start:settings-dogsled dogsled: # checks assignments with too many blank identifiers; default is 2 max-blank-identifiers: 2 + # goplicate-end:settings-dogsled + # goplicate-start:settings-dupl dupl: # tokens count to trigger issue, 150 by default threshold: 100 + # goplicate-end:settings-dupl + # goplicate-start:settings-dupword dupword: # Keywords for detecting duplicate words. # If this list is not empty, only the words defined in this list will be detected. @@ -245,7 +274,9 @@ linters-settings: # Keywords used to ignore detection. # Default: [] # ignore: [] + # goplicate-end:settings-dupword + # goplicate-start:settings-errcheck errcheck: # report about not checking of errors in type assetions: `a := b.(MyStruct)`; # default is false: such cases aren't reported by default. @@ -254,7 +285,9 @@ linters-settings: # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; # default is false: such cases aren't reported by default. check-blank: false + # goplicate-end:settings-errcheck + # goplicate-start:settings-errchkjson errchkjson: # With check-error-free-encoding set to true, errchkjson does warn about # errors from json encoding functions that are safe to be ignored, because @@ -276,7 +309,9 @@ linters-settings: # Issue on struct encoding that doesn't have exported fields. # Default: false report-no-exported: false + # goplicate-end:settings-errchkjson + # goplicate-start:settings-errorlint errorlint: # Check whether fmt.Errorf uses the %w verb for formatting errors. # See the https://github.com/polyfloyd/go-errorlint for caveats. @@ -290,7 +325,9 @@ linters-settings: # Check for plain error comparisons. # Default: true comparison: true + # goplicate-end:settings-errorlint + # goplicate-start:settings-exhaustive exhaustive: # Program elements to check for exhaustiveness. # Default: [ switch ] @@ -328,19 +365,25 @@ linters-settings: # Only run exhaustive check on map literals with "//exhaustive:enforce" comment. # Default: false explicit-exhaustive-map: false + # goplicate-end:settings-exhaustive + # goplicate-start:settings-exhaustruct exhaustruct: - # List of regular expressions to match struct packages and names. - # If this list is empty, all structs are tested. - # Default: [] - # include: [] + # List of regular expressions to match struct packages and names. + # If this list is empty, all structs are tested. + # Default: [] + # include: [] - # List of regular expressions to exclude struct packages and names from check. - # Default: [] - # exclude: [] + # List of regular expressions to exclude struct packages and names from check. + # Default: [] + # exclude: [] + # goplicate-end:settings-exhaustruct + # goplicate-start:settings-forbidigo # forbidigo: + # goplicate-end:settings-forbidigo + # goplicate-start:settings-funlen funlen: # Checks the number of lines in a function. # If lower than 0, disable the check. @@ -355,14 +398,20 @@ linters-settings: # Ignore comments when counting lines. # Default false ignore-comments: true + # goplicate-end:settings-funlen + # goplicate-start:settings-ginkgolinter # ginkgolinter: + # goplicate-end:settings-ginkgolinter + # goplicate-start:settings-gocognit gocognit: # Minimal code complexity to report. # Default: 30 (but we recommend 10-20) min-complexity: 20 + # goplicate-end:settings-gocognit + # goplicate-start:settings-goconst goconst: # Minimal length of string constant. # Default: 3 @@ -395,7 +444,9 @@ linters-settings: # Ignore when constant is not used as function argument. # Default: true ignore-calls: true + # goplicate-end:settings-goconst + # goplicate-start:settings-gocritic gocritic: # Disable all checks. # Default: false @@ -467,45 +518,45 @@ linters-settings: skipTestFuncs: true ruleguard: - # Enable debug to identify which 'Where' condition was rejected. - # The value of the parameter is the name of a function in a ruleguard file. - # - # When a rule is evaluated: - # If: - # The Match() clause is accepted; and - # One of the conditions in the Where() clause is rejected, - # Then: - # ruleguard prints the specific Where() condition that was rejected. - # - # The flag is passed to the ruleguard 'debug-group' argument. - # Default: "" - # debug: '' - - # Determines the behavior when an error occurs while parsing ruleguard files. - # If flag is not set, log error and skip rule files that contain an error. - # If flag is set, the value must be a comma-separated list of error conditions. - # - 'all': fail on all errors. - # - 'import': ruleguard rule imports a package that cannot be found. - # - 'dsl': gorule file does not comply with the ruleguard DSL. - # Default: "" - # failOn: '' - - # Comma-separated list of file paths containing ruleguard rules. - # If a path is relative, it is relative to the directory where the golangci-lint command is executed. - # The special '${configDir}' variable is substituted with the absolute directory containing the golangci config file. - # Glob patterns such as 'rules-*.go' may be specified. - # Default: "" - # rules: '' - - # Comma-separated list of enabled groups or skip empty to enable everything. - # Tags can be defined with # character prefix. - # Default: "" - # enable: "myGroupName,#myTagName" - - # Comma-separated list of disabled groups or skip empty to enable everything. - # Tags can be defined with # character prefix. - # Default: "" - # disable: "myGroupName,#myTagName" + # Enable debug to identify which 'Where' condition was rejected. + # The value of the parameter is the name of a function in a ruleguard file. + # + # When a rule is evaluated: + # If: + # The Match() clause is accepted; and + # One of the conditions in the Where() clause is rejected, + # Then: + # ruleguard prints the specific Where() condition that was rejected. + # + # The flag is passed to the ruleguard 'debug-group' argument. + # Default: "" + # debug: '' + + # Determines the behavior when an error occurs while parsing ruleguard files. + # If flag is not set, log error and skip rule files that contain an error. + # If flag is set, the value must be a comma-separated list of error conditions. + # - 'all': fail on all errors. + # - 'import': ruleguard rule imports a package that cannot be found. + # - 'dsl': gorule file does not comply with the ruleguard DSL. + # Default: "" + # failOn: '' + + # Comma-separated list of file paths containing ruleguard rules. + # If a path is relative, it is relative to the directory where the golangci-lint command is executed. + # The special '${configDir}' variable is substituted with the absolute directory containing the golangci config file. + # Glob patterns such as 'rules-*.go' may be specified. + # Default: "" + # rules: '' + + # Comma-separated list of enabled groups or skip empty to enable everything. + # Tags can be defined with # character prefix. + # Default: "" + # enable: "myGroupName,#myTagName" + + # Comma-separated list of disabled groups or skip empty to enable everything. + # Tags can be defined with # character prefix. + # Default: "" + # disable: "myGroupName,#myTagName" tooManyResultsChecker: # Maximum number of results. @@ -526,10 +577,17 @@ linters-settings: # Whether to check exported functions. # Default: false checkExported: false + # goplicate-end:settings-gocritic + # goplicate-start:settings-gocyclo # gocyclo: + # goplicate-end:settings-gocyclo + + # goplicate-start:settings-godot # godot: + # goplicate-end:settings-godot + # goplicate-start:settings-godox godox: # report any comments starting with keywords, this is useful for TODO or # FIXME comments that might be left in the code accidentally and should be @@ -542,7 +600,9 @@ linters-settings: - OPTIMIZE - TODO - "@TODO" + # goplicate-end:settings-godox + # goplicate-start:settings-gofmt gofmt: # Simplify code: gofmt with `-s` option. # Default: true @@ -556,7 +616,9 @@ linters-settings: replacement: any - pattern: a[b:len(a)] replacement: a[b:] + # goplicate-end:settings-gofmt + # goplicate-start:settings-gofumpt # gofumpt: # # Module path which contains the source code being formatted. # # Default: "" @@ -565,16 +627,22 @@ linters-settings: # # Choose whether to use the extra rules. # # Default: false # extra-rules: true + # goplicate-end:settings-gofumpt + # goplicate-start:settings-goheader # goheader: + # goplicate-end:settings-goheader + # goplicate-start:settings-goimports goimports: # A comma-separated list of prefixes, which, if set, checks import paths # with the given prefixes are grouped after 3rd-party packages. # Default: "" - # local-prefixes: github.mycompany.com + local-prefixes: github.com/northwood-labs/ + # goplicate-end:settings-goimports - gomnd: + # goplicate-start:settings-mnd + mnd: # List of enabled checks, see https://github.com/tommy-muehle/go-mnd/#checks for description. # Default: ["argument", "case", "condition", "operation", "return", "assign"] checks: @@ -607,15 +675,24 @@ linters-settings: # ignored-functions: # - '^math\.' # - '^http\.StatusText$' + # goplicate-end:settings-mnd + # goplicate-start:settings-gomoddirectives # gomoddirectives: + # goplicate-end:settings-gomoddirectives + + # goplicate-start:settings-gomodguard # gomodguard: + # goplicate-end:settings-gomodguard + # goplicate-start:settings-gosimple gosimple: # Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks # Default: ["*"] checks: ["*"] + # goplicate-end:settings-gosimple + # goplicate-start:settings-gosec gosec: # To select a subset of rules to run. # Available rules: https://github.com/securego/gosec#available-rules @@ -733,9 +810,13 @@ linters-settings: # Maximum allowed permissions mode for os.WriteFile and ioutil.WriteFile # Default: "0666" G306: "0666" + # goplicate-end:settings-gosec + # goplicate-start:settings-gosmopolitan # gosmopolitan: + # goplicate-end:settings-gosmopolitan + # goplicate-start:settings-govet govet: # Enable analyzers by name. # (in addition to default: @@ -816,9 +897,13 @@ linters-settings: unusedresult: funcs: true stringmethods: true + # goplicate-end:settings-govet + # goplicate-start:settings-grouper # grouper: + # goplicate-end:settings-grouper + # goplicate-start:settings-importas importas: # Do not allow unaliased imports of aliased packages. # Default: false @@ -841,14 +926,20 @@ linters-settings: # # see https://github.com/julz/importas#use-regular-expression for details # - pkg: knative.dev/serving/pkg/apis/(\w+)/(v[\w\d]+) # alias: $1$2 + # goplicate-end:settings-importas + # goplicate-start:settings-interfacebloat interfacebloat: # The maximum number of methods allowed for an interface. # Default: 10 max: 10 + # goplicate-end:settings-interfacebloat + # goplicate-start:settings-ireturn # ireturn: + # goplicate-end:settings-ireturn + # goplicate-start:settings-lll lll: # max line length, lines longer will be reported. Default is 120. '\t' is counted as 1 character # by default, and can be changed with the tab-width option @@ -856,20 +947,28 @@ linters-settings: # tab width in spaces. Default to 1. tab-width: 1 + # goplicate-end:settings-lll + # goplicate-start:settings-loggercheck # loggercheck: + # goplicate-end:settings-loggercheck + # goplicate-start:settings-maintidx maintidx: # Show functions with maintainability index lower than N. A high index indicates better # maintainability (it's kind of the opposite of complexity). # Default: 20 under: 20 + # goplicate-end:settings-maintidx + # goplicate-start:settings-makezero makezero: # Allow only slices initialized with a length of zero. # Default: false always: false + # goplicate-end:settings-makezero + # goplicate-start:settings-misspell misspell: # Correct spellings using locale preferences for US or UK. # Setting locale to US will correct the British spelling of 'colour' to 'color'. @@ -891,17 +990,25 @@ linters-settings: correction: "if" - typo: "cancelation" correction: "cancellation" + # goplicate-end:settings-misspell + # goplicate-start:settings-musttag # musttag: + # goplicate-end:settings-musttag + # goplicate-start:settings-nakedret nakedret: # make an issue if func has more lines of code than this setting and it has naked returns; # default is 30 max-func-lines: 30 + # goplicate-end:settings-nakedret + # goplicate-start:settings-nestif nestif: min-complexity: 10 + # goplicate-end:settings-nestif + # goplicate-start:settings-nilnil nilnil: # Checks that there is no simultaneous return of `nil` error and an invalid value. # Default: ["ptr", "func", "iface", "map", "chan"] @@ -911,20 +1018,28 @@ linters-settings: - iface - map - chan + # goplicate-end:settings-nilnil + # goplicate-start:settings-nlreturn nlreturn: # Size of the block (including return statement that is still "OK") # so no return split required. # Default: 1 block-size: 2 + # goplicate-end:settings-nlreturn + # goplicate-start:settings-nolintlint # nolintlint: + # goplicate-end:settings-nolintlint + # goplicate-start:settings-nonamedreturns nonamedreturns: # Report named error if it is assigned inside defer. # Default: false report-error-in-defer: false + # goplicate-end:settings-nonamedreturns + # goplicate-start:settings-paralleltest paralleltest: # Ignore missing calls to `t.Parallel()` and only report incorrect uses of it. # Default: false @@ -934,7 +1049,9 @@ linters-settings: # still required to have `t.Parallel`, but subtests are allowed to skip it. # Default: false ignore-missing-subtests: true + # goplicate-end:settings-paralleltest + # goplicate-start:settings-perfsprint perfsprint: # Optimizes even if it requires an int or uint type cast. # Default: true @@ -955,14 +1072,33 @@ linters-settings: # Optimizes into strings concatenation. # Default: true strconcat: true + # goplicate-end:settings-perfsprint + # goplicate-start:settings-prealloc # prealloc: + # goplicate-end:settings-prealloc + + # goplicate-start:settings-predeclared # predeclared: + # goplicate-end:settings-predeclared + + # goplicate-start:settings-promlinter # promlinter: + # goplicate-end:settings-promlinter + + # goplicate-start:settings-reassign # reassign: + # goplicate-end:settings-reassign + + # goplicate-start:settings-revive # revive: @TODO: Review and enable. + # goplicate-end:settings-revive + + # goplicate-start:settings-rowserrcheck # rowserrcheck: + # goplicate-end:settings-rowserrcheck + # goplicate-start:settings-sloglint sloglint: # See also https://github.com/go-simpler/sloggen @@ -981,32 +1117,38 @@ linters-settings: # Enforce putting arguments on separate lines. # Default: false args-on-sep-lines: false + # goplicate-end:settings-sloglint + # goplicate-start:settings-spancheck spancheck: - # Checks to enable. - # Options include: - # - `end`: check that `span.End()` is called - # - `record-error`: check that `span.RecordError(err)` is called when an error is returned - # - `set-status`: check that `span.SetStatus(codes.Error, msg)` is called when an error is returned - # Default: ["end"] - # checks: - # - end - # - record-error - # - set-status - - # A list of regexes for function signatures that silence `record-error` and `set-status` reports - # if found in the call path to a returned error. - # https://github.com/jjti/go-spancheck#ignore-check-signatures - # Default: [] - # ignore-check-signatures: - # - "telemetry.RecordError" + # Checks to enable. + # Options include: + # - `end`: check that `span.End()` is called + # - `record-error`: check that `span.RecordError(err)` is called when an error is returned + # - `set-status`: check that `span.SetStatus(codes.Error, msg)` is called when an error is returned + # Default: ["end"] + # checks: + # - end + # - record-error + # - set-status + + # A list of regexes for function signatures that silence `record-error` and `set-status` reports + # if found in the call path to a returned error. + # https://github.com/jjti/go-spancheck#ignore-check-signatures + # Default: [] + # ignore-check-signatures: + # - "telemetry.RecordError" + # goplicate-end:settings-spancheck + # goplicate-start:settings-staticcheck staticcheck: # https://staticcheck.io/docs/options#checks # https://staticcheck.io/docs/checks/ # Default: ["*"] checks: ["*"] + # goplicate-end:settings-staticcheck + # goplicate-start:settings-stylecheck stylecheck: # STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks # Default: ["*"] @@ -1024,7 +1166,9 @@ linters-settings: # https://staticcheck.io/docs/configuration/options/#http_status_code_whitelist # Default: ["200", "400", "404", "500"] # http-status-code-whitelist: [ "200", "400", "404", "500" ] + # goplicate-end:settings-stylecheck + # goplicate-start:settings-tagalign tagalign: # Align and sort can be used together or separately. # @@ -1059,7 +1203,9 @@ linters-settings: # Note: This option will be ignored if 'align' or 'sort' is false. # Default: false strict: true + # goplicate-end:settings-tagalign + # goplicate-start:settings-tagliatelle tagliatelle: # Check the struct tag name case. case: @@ -1082,11 +1228,21 @@ linters-settings: toml: snake xml: camel yaml: camel + # goplicate-end:settings-tagliatelle + # goplicate-start:settings-tenv # tenv: + # goplicate-end:settings-tenv + + # goplicate-start:settings-testifylint # testifylint: + # goplicate-end:settings-testifylint + + # goplicate-start:settings-testpackage # testpackage: + # goplicate-end:settings-testpackage + # goplicate-start:settings-thelper thelper: test: # Check *testing.T is first param (or after context.Context) of helper function. @@ -1139,7 +1295,9 @@ linters-settings: # Check f.Helper() begins helper function. # Default: true begin: true + # goplicate-end:settings-thelper + # goplicate-start:settings-usestdlibvars usestdlibvars: # Suggest the use of http.MethodXX. # Default: true @@ -1180,7 +1338,9 @@ linters-settings: # Suggest the use of constant.Kind.String(). # Default: false constant-kind: false + # goplicate-end:settings-usestdlibvars + # goplicate-start:settings-unconvert unconvert: # Remove conversions that force intermediate rounding. # Default: false @@ -1189,7 +1349,9 @@ linters-settings: # Be more conservative (experimental). # Default: false safe: false + # goplicate-end:settings-unconvert + # goplicate-start:settings-unparam unparam: # Inspect exported functions. # @@ -1200,7 +1362,9 @@ linters-settings: # # Default: false check-exported: false + # goplicate-end:settings-unparam + # goplicate-start:settings-unused unused: # Mark all struct fields that have been written to as used. # Default: true @@ -1229,9 +1393,13 @@ linters-settings: # Mark all identifiers inside generated files as used. # Default: true generated-is-used: true + # goplicate-end:settings-unused + # goplicate-start:settings-varnamelen # varnamelen: + # goplicate-end:settings-varnamelen + # goplicate-start:settings-whitespace whitespace: # Enforces newlines (or comments) after every multi-line if statement. # Default: false @@ -1240,7 +1408,9 @@ linters-settings: # Enforces newlines (or comments) after every multi-line function signature. # Default: false multi-func: false + # goplicate-end:settings-whitespace + # goplicate-start:settings-wrapcheck wrapcheck: # An array of strings that specify substrings of signatures to ignore. # If this set, it will override the default set of ignored signatures. @@ -1272,7 +1442,9 @@ linters-settings: # Default: [] # ignoreInterfaceRegexps: # - ^(?i)c(?-i)ach(ing|e) + # goplicate-end:settings-wrapcheck + # goplicate-start:settings-wsl wsl: # See https://github.com/bombsimon/wsl/blob/master/doc/configuration.md for documentation of available settings. # These are the defaults for `golangci-lint`. @@ -1327,13 +1499,82 @@ linters-settings: # this is set to true - the append call must append either a variable # assigned, called or used on the line above. strict-append: true + # goplicate-end:settings-wsl +# goplicate-start:issues issues: # List of regexps of issue texts to exclude, empty list by default. But independently from this # option we use default exclude patterns, it can be disabled by `exclude-use-default: false`. To # list all excluded by default patterns execute `golangci-lint run --help` # exclude: + # If set to true exclude and exclude-rules regular expressions become case-sensitive. + # Default: false + exclude-case-sensitive: false + + # Independently from option `exclude` we use default exclude patterns, it can be disabled by this + # option. To list all excluded by default patterns execute `golangci-lint run --help`. Default + # value for this option is true. + exclude-use-default: false + + # Which dirs to exclude: issues from them won't be reported. + # Can use regexp here: `generated.*`, regexp is applied on full path, + # including the path prefix if one is set. + # Default dirs are skipped independently of this option's value (see exclude-dirs-use-default). + # "/" will be replaced by current OS file path separator to properly work on Windows. + # Default: [] + # exclude-dirs: + # - src/external_libs + # - autogenerated_by_my_lib + + # Enables exclude of directories: + # - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ + # Default: true + exclude-dirs-use-default: false + + # Which files to exclude: they will be analyzed, but issues from them won't be reported. + # There is no need to include all autogenerated files, + # we confidently recognize autogenerated files. + # If it's not, please let us know. + # "/" will be replaced by current OS file path separator to properly work on Windows. + # Default: [] + # exclude-files: + # - ".*\\.my\\.go$" + # - lib/bad.go + + # To follow strictly the Go generated file convention. + # + # If set to true, source files that have lines matching only the following regular expression will be excluded: + # `^// Code generated .* DO NOT EDIT\.$` + # This line must appear before the first non-comment, non-blank text in the file. + # https://go.dev/s/generatedcode + # + # By default, a lax pattern is applied: + # sources are excluded if they contain lines `autogenerated file`, `code generated`, `do not edit`, etc. + # Default: false + exclude-generated-strict: false + + # Fix found issues (if it's supported by the linter). + fix: false + + # 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 + + # Show only new issues: if there are unstaged changes or untracked files, only those changes are + # analyzed, else only changes in HEAD~ are analyzed. It's a super-useful option for integration of + # golangci-lint into existing large codebase. It's not practical to fix all existing issues at the + # moment of integration: much better don't allow issues in new code. Default is false. + new: false + + # Show only new issues created after git revision `REV` + # new-from-rev: REV + + # Show only new issues created in git patch with set file path. + # new-from-patch: path/to/patch/file + # Excluding configuration per-path, per-linter, per-text and per-source exclude-rules: # Exclude some linters from running on tests files. @@ -1354,7 +1595,7 @@ issues: source: lint:allow_param - linters: - - gomnd + - mnd source: lint:allow_raw_number - text: "commentedOutCode: may want to remove commented-out code" @@ -1453,99 +1694,4 @@ issues: linters: - goconst source: lint:no_const - - # If set to true exclude and exclude-rules regular expressions become case-sensitive. - # Default: false - exclude-case-sensitive: false - - # Independently from option `exclude` we use default exclude patterns, it can be disabled by this - # option. To list all excluded by default patterns execute `golangci-lint run --help`. Default - # value for this option is true. - exclude-use-default: false - - # Which dirs to exclude: issues from them won't be reported. - # Can use regexp here: `generated.*`, regexp is applied on full path, - # including the path prefix if one is set. - # Default dirs are skipped independently of this option's value (see exclude-dirs-use-default). - # "/" will be replaced by current OS file path separator to properly work on Windows. - # Default: [] - # exclude-dirs: - # - src/external_libs - # - autogenerated_by_my_lib - - # Enables exclude of directories: - # - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ - # Default: true - exclude-dirs-use-default: false - - # Which files to exclude: they will be analyzed, but issues from them won't be reported. - # There is no need to include all autogenerated files, - # we confidently recognize autogenerated files. - # If it's not, please let us know. - # "/" will be replaced by current OS file path separator to properly work on Windows. - # Default: [] - # exclude-files: - # - ".*\\.my\\.go$" - # - lib/bad.go - - # To follow strictly the Go generated file convention. - # - # If set to true, source files that have lines matching only the following regular expression will be excluded: - # `^// Code generated .* DO NOT EDIT\.$` - # This line must appear before the first non-comment, non-blank text in the file. - # https://go.dev/s/generatedcode - # - # By default, a lax pattern is applied: - # sources are excluded if they contain lines `autogenerated file`, `code generated`, `do not edit`, etc. - # Default: false - exclude-generated-strict: false - - # Fix found issues (if it's supported by the linter). - fix: false - - # 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 - - # Show only new issues: if there are unstaged changes or untracked files, only those changes are - # analyzed, else only changes in HEAD~ are analyzed. It's a super-useful option for integration of - # golangci-lint into existing large codebase. It's not practical to fix all existing issues at the - # moment of integration: much better don't allow issues in new code. Default is false. - new: false - - # Show only new issues created after git revision `REV` - # new-from-rev: REV - - # Show only new issues created in git patch with set file path. - # new-from-patch: path/to/patch/file - -severity: - # Set the default severity for issues. - # - # If severity rules are defined and the issues do not match or no severity is provided to the rule - # this will be the default severity applied. - # Severities should match the supported severity names of the selected out format. - # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity - # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#SeverityLevel - # - GitHub: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message - # - TeamCity: https://www.jetbrains.com/help/teamcity/service-messages.html#Inspection+Instance - # - # Default value is an empty string. - # default-severity: error - - # If set to true `severity-rules` regular expressions become case-sensitive. - # Default: false - case-sensitive: false - - # When a list of severity rules are provided, severity information will be added to lint issues. - # Severity rules have the same filtering capability as exclude rules - # except you are allowed to specify one matcher per severity rule. - # Only affects out formats that support setting severity information. - # - # Default: [] - # rules: - # - linters: - # - dupl - # severity: info +# goplicate-end:issues diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c2d74464..9dd14ceb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks default_language_version: - python: python3.11 + python: python3.10 default_stages: - commit @@ -11,6 +11,8 @@ default_stages: fail_fast: false repos: + # ---------------------------------------------------------------------------- + # goplicate-start:always - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: @@ -19,10 +21,7 @@ repos: - --maxkb=500 - --enforce-all - id: check-case-conflict - - id: check-executables-have-shebangs - - id: check-json - id: check-merge-conflict - # - id: check-symlinks - id: check-toml - id: check-xml - id: check-yaml @@ -32,50 +31,15 @@ repos: - id: detect-private-key - id: end-of-file-fixer - id: fix-byte-order-marker - # - id: fix-encoding-pragma - # args: - # - --remove - id: mixed-line-ending args: - --fix=lf - # - id: requirements-txt-fixer - id: trailing-whitespace - # - repo: https://github.com/asottile/pyupgrade - # rev: c21b4c4d153be0633357686c7697f539ac194868 - # hooks: - # - id: pyupgrade - # args: - # - --py311-plus - - # - repo: https://github.com/asottile/reorder_python_imports - # rev: c4fe43d9809f1507508b3aba24ad1a72b5407f58 - # hooks: - # - id: reorder-python-imports - # args: - # - --py311-plus - - repo: https://github.com/skyzyx/git-hooks rev: 4a2f0dc93e5c5353ed5e619599b0d15e34df88db hooks: - id: git-check - - id: gofumpt - - id: golangci-lint - # - id: go-consistent - - id: gomodupdate - - id: script-must-have-extension - - id: shellcheck - - id: shfmt - args: - - -s - - -w - - -ln=auto - - -i=4 - - -ci - - -sr - - id: terraform-fmt - - id: yamlfmt - # - id: yapf - repo: https://github.com/igorshubovych/markdownlint-cli rev: v0.39.0 @@ -86,7 +50,7 @@ repos: - --ignore=.github - --ignore=.templates - --fix - - '**/*.md' + - "**/*.md" - repo: local hooks: @@ -104,36 +68,69 @@ repos: language: system stages: [commit, push] - # - id: actionlint - # name: Actionlint - # description: Lint GitHub Actions workflows - # entry: bash -c 'actionlint' - # language: system - # stages: [commit, push] + - id: trivy-vuln + name: Trivy (Vulnerabilities) + description: Check for security vulnerabilities. (https://trivy.dev) + entry: bash -c 'trivy fs --config trivy-vuln.yaml --ignorefile .trivyignore.yaml .' + language: system + stages: [commit, push] - - id: go-consistent - name: 'Go: Consistent Patterns' - description: Analyzes Go packages to identify unnecessary type conversions. - entry: bash -c 'go-consistent ./corefunc/...; go-consistent ./corefuncprovider/...' + - id: yamlfmt + name: yamlfmt + description: Format YAML to canonical style + entry: bash -c 'yamlfmt .' language: system stages: [commit, push] + # goplicate-end:always + # ---------------------------------------------------------------------------- + # goplicate-start:shell + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-executables-have-shebangs + + - repo: https://github.com/skyzyx/git-hooks + rev: 4a2f0dc93e5c5353ed5e619599b0d15e34df88db + hooks: + - id: script-must-have-extension + - id: shellcheck + - id: shfmt + args: + - --simplify + - --write + - --language-dialect=auto + - --indent=4 + - --case-indent + - --space-redirects + # goplicate-end:shell + + # ---------------------------------------------------------------------------- + # goplicate-start:golang + - repo: https://github.com/skyzyx/git-hooks + rev: 4a2f0dc93e5c5353ed5e619599b0d15e34df88db + hooks: + - id: gofumpt + - id: golangci-lint + + - repo: local + hooks: - id: unconvert - name: 'Go: unconvert (current GOOS/GOARCH)' + name: "Go: unconvert (current GOOS/GOARCH)" description: Analyzes Go packages to identify unnecessary type conversions. entry: bash -c 'unconvert -fastmath -tests -v ./...' language: system stages: [commit, push] - id: smrcptr - name: 'Go: Same Receiver Pointer' + name: "Go: Same Receiver Pointer" description: Don't mix receiver types. Choose either pointers or struct types for all available methods. entry: bash -c 'smrcptr -skip-std=true --constructor=true ./...' language: system stages: [commit, push] - id: govulncheck - name: 'Go: Vulnerability check' + name: "Go: Vulnerability check" description: Check for Go security vulnerabilities. (https://go.dev/blog/vuln) entry: bash -c 'govulncheck -test ./...' language: system @@ -145,10 +142,22 @@ repos: entry: bash -c 'osv-scanner -r .' language: system stages: [commit, push] + # goplicate-end:golang - - id: trivy-vuln - name: Trivy (Vulnerabilities) - description: Check for security vulnerabilities. (https://trivy.dev) - entry: bash -c 'trivy fs --config trivy-vuln.yaml .' + # ---------------------------------------------------------------------------- + # goplicate-start:terraform + - repo: https://github.com/skyzyx/git-hooks + rev: 4a2f0dc93e5c5353ed5e619599b0d15e34df88db + hooks: + - id: terraform-fmt + # goplicate-end:terraform + + # Project-specific tasks + - repo: local + hooks: + - id: go-consistent + name: "Go: Consistent Patterns" + description: Analyzes Go packages to identify unnecessary type conversions. + entry: bash -c 'go-consistent ./corefunc/...; go-consistent ./corefuncprovider/...' language: system stages: [commit, push] diff --git a/.yamlfmt.yml b/.yamlfmt.yml new file mode 100644 index 00000000..06b4bbc3 --- /dev/null +++ b/.yamlfmt.yml @@ -0,0 +1,22 @@ +--- +line_ending: lf +doublestar: false +continue_on_error: true +gitignore_excludes: true +extensions: + - yaml + - yml +output_format: default +formatter: + type: basic + disallow_anchors: true + drop_merge_tag: true + include_document_start: true + indent: 2 + indentless_arrays: false + line_ending: lf + max_line_length: 0 + pad_line_comments: 1 + retain_line_breaks_single: true + retain_line_breaks: true + scan_folded_as_literal: true diff --git a/.yamllint b/.yamllint deleted file mode 100644 index c55be5c1..00000000 --- a/.yamllint +++ /dev/null @@ -1,74 +0,0 @@ ---- -# https://yamllint.readthedocs.io/en/stable/rules.html -yaml-files: - - '*.yaml' - - '*.yml' - - .yamllint - -rules: - braces: - forbid: non-empty - min-spaces-inside: 0 - max-spaces-inside: 0 - min-spaces-inside-empty: 0 - max-spaces-inside-empty: 0 - brackets: - forbid: non-empty - min-spaces-inside: 0 - max-spaces-inside: 0 - min-spaces-inside-empty: 0 - max-spaces-inside-empty: 0 - colons: - max-spaces-before: 0 - max-spaces-after: 1 - commas: - max-spaces-before: 0 - min-spaces-after: 1 - max-spaces-after: 1 - comments: - require-starting-space: true - ignore-shebangs: true - min-spaces-from-content: 1 - comments-indentation: false - document-end: - present: false - document-start: - present: true - empty-lines: - max: 1 - max-start: 0 - max-end: 0 - empty-values: - forbid-in-block-mappings: true - forbid-in-flow-mappings: true - hyphens: - max-spaces-after: 1 - indentation: - spaces: 2 - indent-sequences: true - check-multi-line-strings: true - key-duplicates: enable - key-ordering: disable - line-length: - max: 120 - allow-non-breakable-words: true - allow-non-breakable-inline-mappings: false - level: warning - new-line-at-end-of-file: enable - new-lines: - type: unix - octal-values: - forbid-implicit-octal: true - forbid-explicit-octal: false - quoted-strings: - quote-type: any - required: only-when-needed - extra-required: [] - extra-allowed: [] - trailing-spaces: enable - truthy: - allowed-values: - - 'true' - - 'false' - check-keys: true - level: warning diff --git a/cmd/root.go b/cmd/root.go index 0cf1977c..cb70d6c0 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -23,6 +23,7 @@ import ( "github.com/spf13/cobra" "github.com/hashicorp/terraform-plugin-framework/providerserver" + "github.com/northwood-labs/terraform-provider-corefunc/corefuncprovider" ) diff --git a/cmd/version.go b/cmd/version.go index 7722d7ad..944619eb 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -25,9 +25,10 @@ import ( "text/tabwriter" "github.com/gookit/color" + "github.com/spf13/cobra" + "github.com/northwood-labs/golang-utils/archstring" "github.com/northwood-labs/golang-utils/exiterrorf" - "github.com/spf13/cobra" ) var ( diff --git a/corefunc/env_ensure_test.go b/corefunc/env_ensure_test.go index 9c36fa68..8f5368b8 100644 --- a/corefunc/env_ensure_test.go +++ b/corefunc/env_ensure_test.go @@ -21,8 +21,9 @@ import ( "regexp" "testing" - "github.com/northwood-labs/terraform-provider-corefunc/testfixtures" "github.com/stretchr/testify/assert" + + "github.com/northwood-labs/terraform-provider-corefunc/testfixtures" ) func ExampleEnvEnsure() { diff --git a/corefunc/url.go b/corefunc/url.go index 75d02c26..9d887c3e 100644 --- a/corefunc/url.go +++ b/corefunc/url.go @@ -18,6 +18,7 @@ package corefunc import ( "github.com/nlnwa/whatwg-url/canonicalizer" "github.com/nlnwa/whatwg-url/url" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc/types" ) diff --git a/corefuncprovider/env_ensure_data_source.go b/corefuncprovider/env_ensure_data_source.go index 49fc649e..ada6fdc1 100644 --- a/corefuncprovider/env_ensure_data_source.go +++ b/corefuncprovider/env_ensure_data_source.go @@ -28,6 +28,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/env_ensure_function.go b/corefuncprovider/env_ensure_function.go index cdf5b40f..24bd3c17 100644 --- a/corefuncprovider/env_ensure_function.go +++ b/corefuncprovider/env_ensure_function.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/homedir_expand_data_source.go b/corefuncprovider/homedir_expand_data_source.go index 4ce04312..72f05bb6 100644 --- a/corefuncprovider/homedir_expand_data_source.go +++ b/corefuncprovider/homedir_expand_data_source.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/homedir_expand_function.go b/corefuncprovider/homedir_expand_function.go index afd0703f..1ab7e25d 100644 --- a/corefuncprovider/homedir_expand_function.go +++ b/corefuncprovider/homedir_expand_function.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/homedir_get_data_source.go b/corefuncprovider/homedir_get_data_source.go index 5e48e09e..fb9b22a4 100644 --- a/corefuncprovider/homedir_get_data_source.go +++ b/corefuncprovider/homedir_get_data_source.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/homedir_get_function.go b/corefuncprovider/homedir_get_function.go index f8242058..3ca76077 100644 --- a/corefuncprovider/homedir_get_function.go +++ b/corefuncprovider/homedir_get_function.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/int_leftpad_data_source.go b/corefuncprovider/int_leftpad_data_source.go index aa4b3637..c4599156 100644 --- a/corefuncprovider/int_leftpad_data_source.go +++ b/corefuncprovider/int_leftpad_data_source.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/int_leftpad_function.go b/corefuncprovider/int_leftpad_function.go index 6afc61a1..4e2bad0b 100644 --- a/corefuncprovider/int_leftpad_function.go +++ b/corefuncprovider/int_leftpad_function.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/str_camel_data_source.go b/corefuncprovider/str_camel_data_source.go index 28d746d1..cf755da0 100644 --- a/corefuncprovider/str_camel_data_source.go +++ b/corefuncprovider/str_camel_data_source.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/str_camel_function.go b/corefuncprovider/str_camel_function.go index e4d91193..812924b8 100644 --- a/corefuncprovider/str_camel_function.go +++ b/corefuncprovider/str_camel_function.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/str_constant_data_source.go b/corefuncprovider/str_constant_data_source.go index 466de303..834e75ff 100644 --- a/corefuncprovider/str_constant_data_source.go +++ b/corefuncprovider/str_constant_data_source.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/str_constant_function.go b/corefuncprovider/str_constant_function.go index ebcdb916..b8e51dad 100644 --- a/corefuncprovider/str_constant_function.go +++ b/corefuncprovider/str_constant_function.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/str_iterative_replace_data_source.go b/corefuncprovider/str_iterative_replace_data_source.go index 7f897638..b894360a 100644 --- a/corefuncprovider/str_iterative_replace_data_source.go +++ b/corefuncprovider/str_iterative_replace_data_source.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" cfTypes "github.com/northwood-labs/terraform-provider-corefunc/corefunc/types" ) diff --git a/corefuncprovider/str_iterative_replace_function.go b/corefuncprovider/str_iterative_replace_function.go index 215827ce..281bb086 100644 --- a/corefuncprovider/str_iterative_replace_function.go +++ b/corefuncprovider/str_iterative_replace_function.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" cftypes "github.com/northwood-labs/terraform-provider-corefunc/corefunc/types" ) diff --git a/corefuncprovider/str_kebab_data_source.go b/corefuncprovider/str_kebab_data_source.go index 3e104dde..2bd05fd4 100644 --- a/corefuncprovider/str_kebab_data_source.go +++ b/corefuncprovider/str_kebab_data_source.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/str_kebab_function.go b/corefuncprovider/str_kebab_function.go index ee455049..5aff9c26 100644 --- a/corefuncprovider/str_kebab_function.go +++ b/corefuncprovider/str_kebab_function.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/str_leftpad_data_source.go b/corefuncprovider/str_leftpad_data_source.go index 1a1a8d26..1a26bd97 100644 --- a/corefuncprovider/str_leftpad_data_source.go +++ b/corefuncprovider/str_leftpad_data_source.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/str_leftpad_function.go b/corefuncprovider/str_leftpad_function.go index 23bc2bf2..faca9111 100644 --- a/corefuncprovider/str_leftpad_function.go +++ b/corefuncprovider/str_leftpad_function.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/str_pascal_function.go b/corefuncprovider/str_pascal_function.go index b082e14e..0c6de597 100644 --- a/corefuncprovider/str_pascal_function.go +++ b/corefuncprovider/str_pascal_function.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/str_snake_data_source.go b/corefuncprovider/str_snake_data_source.go index c4bd19db..85de4ac8 100644 --- a/corefuncprovider/str_snake_data_source.go +++ b/corefuncprovider/str_snake_data_source.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/str_snake_function.go b/corefuncprovider/str_snake_function.go index ee9d54ab..aa09a6bf 100644 --- a/corefuncprovider/str_snake_function.go +++ b/corefuncprovider/str_snake_function.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/str_truncate_label_function.go b/corefuncprovider/str_truncate_label_function.go index fbf09691..3789fd3b 100644 --- a/corefuncprovider/str_truncate_label_function.go +++ b/corefuncprovider/str_truncate_label_function.go @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/function" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" ) diff --git a/corefuncprovider/url_parse_data_source.go b/corefuncprovider/url_parse_data_source.go index fa34e5ec..21057080 100644 --- a/corefuncprovider/url_parse_data_source.go +++ b/corefuncprovider/url_parse_data_source.go @@ -26,6 +26,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" cftypes "github.com/northwood-labs/terraform-provider-corefunc/corefunc/types" ) diff --git a/corefuncprovider/url_parse_data_source_test.go b/corefuncprovider/url_parse_data_source_test.go index d561e83b..fdc98d21 100644 --- a/corefuncprovider/url_parse_data_source_test.go +++ b/corefuncprovider/url_parse_data_source_test.go @@ -24,6 +24,7 @@ import ( "text/template" "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/northwood-labs/terraform-provider-corefunc/testfixtures" ) diff --git a/corefuncprovider/url_parse_function.go b/corefuncprovider/url_parse_function.go index 8b8278fd..721e599b 100644 --- a/corefuncprovider/url_parse_function.go +++ b/corefuncprovider/url_parse_function.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/lithammer/dedent" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" cftypes "github.com/northwood-labs/terraform-provider-corefunc/corefunc/types" ) diff --git a/generator/go.mod b/generator/go.mod index 1e902f36..46d5ba2a 100644 --- a/generator/go.mod +++ b/generator/go.mod @@ -1,4 +1,4 @@ -module github.com/northwood-labs/terraform-provider-corefunc/generator +module generator go 1.22 diff --git a/terratest/data-sources/terraform_test.go b/terratest/data-sources/terraform_test.go index f03fe330..4188b832 100644 --- a/terratest/data-sources/terraform_test.go +++ b/terratest/data-sources/terraform_test.go @@ -23,10 +23,11 @@ import ( "github.com/gruntwork-io/terratest/modules/terraform" "github.com/hairyhenderson/go-which" - "github.com/northwood-labs/terraform-provider-corefunc/corefunc" - "github.com/northwood-labs/terraform-provider-corefunc/corefunc/types" "github.com/pkg/errors" "github.com/stretchr/testify/assert" + + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc/types" ) const ( diff --git a/terratest/functions/terraform_test.go b/terratest/functions/terraform_test.go index 0d58e175..df446471 100644 --- a/terratest/functions/terraform_test.go +++ b/terratest/functions/terraform_test.go @@ -23,10 +23,11 @@ import ( "github.com/gruntwork-io/terratest/modules/terraform" "github.com/hairyhenderson/go-which" - "github.com/northwood-labs/terraform-provider-corefunc/corefunc" - "github.com/northwood-labs/terraform-provider-corefunc/corefunc/types" "github.com/pkg/errors" "github.com/stretchr/testify/assert" + + "github.com/northwood-labs/terraform-provider-corefunc/corefunc" + "github.com/northwood-labs/terraform-provider-corefunc/corefunc/types" ) const (