diff --git a/CHANGELOG.md b/CHANGELOG.md index d696931a7..9e6097c64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -845,7 +845,7 @@ plugin "aws" { } ``` -For backward compatibility, The AWS ruleset plugin is bundled with the binary. So you can still use AWS rules without installing the plugin separetely. The plugin is automatically enabled if there are AWS resources in your Terraform configuration, but it can also be turned on explicitly. See https://github.com/terraform-linters/tflint/pull/1009 for details. +For backward compatibility, The AWS ruleset plugin is bundled with the binary. So you can still use AWS rules without installing the plugin separately. The plugin is automatically enabled if there are AWS resources in your Terraform configuration, but it can also be turned on explicitly. See https://github.com/terraform-linters/tflint/pull/1009 for details. ### Breaking Changes @@ -1028,7 +1028,7 @@ Also, this release is built with Go v1.15. As a result, darwin/386 build will no TFLint v0.19 relies on and is compatible with Terraform v0.13! 🎉 -This version is also compatible with most Terraform v0.12 configurations without an immediate update to Terraform v0.13. [Custom variable validation](https://www.terraform.io/docs/configuration/variables.html#custom-validation-rules) was officially added in v0.13. Any modules that enabled this featue during the experiment phase must remove the experiment setting to be compatible with Terraform v0.13. Consult the [Terraform 0.13.0 changelog](https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md#0130-august-10-2020) for a full list of breaking changes. We recommend all users update when possible. +This version is also compatible with most Terraform v0.12 configurations without an immediate update to Terraform v0.13. [Custom variable validation](https://www.terraform.io/docs/configuration/variables.html#custom-validation-rules) was officially added in v0.13. Any modules that enabled this feature during the experiment phase must remove the experiment setting to be compatible with Terraform v0.13. Consult the [Terraform 0.13.0 changelog](https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md#0130-august-10-2020) for a full list of breaking changes. We recommend all users update when possible. ### Breaking Changes @@ -1169,7 +1169,7 @@ This release contains several improvements for plugins. In order to take advanta In this release, some great Terraform rules are added by great contributors! Please note that many rules are not enabled by default. You need to set it appropriately according to your policy. -The naming convention rules have been merged into the `terraform_naming_convetion` rule, so if you are using the `terraform_dash_in_*` rules you will need to change your configuration. See the documentation for details. +The naming convention rules have been merged into the `terraform_naming_convention` rule, so if you are using the `terraform_dash_in_*` rules you will need to change your configuration. See the documentation for details. ### Breaking Changes @@ -1426,7 +1426,7 @@ This is the first release in the terraform-linters organization. This release in ## 0.12.0 (2019-09-29) -This release includes an experimental Language Server Procotol support. Using LSP makes it easy to integrate TFLint with your favorite editor. Currently, only diagnostics are provided. +This release includes an experimental Language Server Protocol support. Using LSP makes it easy to integrate TFLint with your favorite editor. Currently, only diagnostics are provided. ### Breaking Changes @@ -1474,7 +1474,7 @@ This release includes an experimental Language Server Procotol support. Using LS ### Chores -- [#435](https://github.com/terraform-linters/tflint/pull/435): docs: Add Linix oneliner to download latest `tflint` ([@abitrolly](https://github.com/abitrolly)) +- [#435](https://github.com/terraform-linters/tflint/pull/435): docs: Add Linux oneliner to download latest `tflint` ([@abitrolly](https://github.com/abitrolly)) - [#437](https://github.com/terraform-linters/tflint/pull/437): docs: Fix typo in dash rule ([@abitrolly](https://github.com/abitrolly)) ## 0.11.1 (2019-09-11) @@ -1725,7 +1725,7 @@ As a major improvement, added 700+ rules in this release. These rules are automa ### Enhancements - [#277](https://github.com/terraform-linters/tflint/pull/277): Ignore annotation support. - - `tflint-ignore: rule_name` annotation is now availble. See [README.md](https://github.com/terraform-linters/tflint/blob/v0.8.1/README.md#rules). + - `tflint-ignore: rule_name` annotation is now available. See [README.md](https://github.com/terraform-linters/tflint/blob/v0.8.1/README.md#rules). ### BugFixes @@ -1925,7 +1925,7 @@ Minor version update. This release includes environment variable support. ### Enhancements - Support variables from environment variables ([#147](https://github.com/terraform-linters/tflint/pull/147)) -- Support moudle path for v0.10.7 ([#149](https://github.com/terraform-linters/tflint/pull/149)) +- Support module path for v0.10.7 ([#149](https://github.com/terraform-linters/tflint/pull/149)) ### Others diff --git a/cmd/inspect_parallel.go b/cmd/inspect_parallel.go index 1cf185b39..4e0afe682 100644 --- a/cmd/inspect_parallel.go +++ b/cmd/inspect_parallel.go @@ -163,7 +163,7 @@ func spawnWorker(ctx context.Context, executable string, workingDir string, opts cmd.WaitDelay = 3 * time.Second err := cmd.Run() if ctx.Err() != nil { - // If the context is canceled, return the context error instread of the command error. + // If the context is canceled, return the context error instead of the command error. err = ctx.Err() } diff --git a/docs/developer-guide/architecture.md b/docs/developer-guide/architecture.md index 0d67652fd..16eae4888 100644 --- a/docs/developer-guide/architecture.md +++ b/docs/developer-guide/architecture.md @@ -93,7 +93,7 @@ The `plugin.Discovery` returns a client for the RuleSet server it started. Use t Similarly, send inspection requests to the server. The server responds to requests and runs an inspection, but the plugin needs access to `terraform.Config` (imagine `runner.GetResourceContent`). -For this, the host process launches a gRPC server to respond such requests. Ths host server is called "Runner" server. Its behavior is implemented by TFLint. The plugin is passed a client that corresponds to the Runner server. +For this, the host process launches a gRPC server to respond such requests. The host server is called "Runner" server. Its behavior is implemented by TFLint. The plugin is passed a client that corresponds to the Runner server. ### Respond to requests for Terraform config (`plugin.GRPCServer`) diff --git a/docs/user-guide/compatibility.md b/docs/user-guide/compatibility.md index 00dc10128..5505fb216 100644 --- a/docs/user-guide/compatibility.md +++ b/docs/user-guide/compatibility.md @@ -75,7 +75,7 @@ TFLint supports the [`count`](https://developer.hashicorp.com/terraform/language resource "aws_instance" "foo" { count = 0 - instance_type = "invalid" # => ignored because ths resource is not created + instance_type = "invalid" # => ignored because the resource is not created } ``` diff --git a/integrationtest/init/init_test.go b/integrationtest/init/init_test.go index 6921baa36..43409ab92 100644 --- a/integrationtest/init/init_test.go +++ b/integrationtest/init/init_test.go @@ -98,7 +98,7 @@ func TestIntegration(t *testing.T) { t.Fatalf("Expected to contain working dir log, but did not: stdout=%s, stderr=%s", outStream, errStream) } if !strings.Contains(outStream.String(), "All plugins are already installed") { - t.Fatalf("Expected to contain alread installed log, but did not: stdout=%s, stderr=%s", outStream, errStream) + t.Fatalf("Expected to contain already installed log, but did not: stdout=%s, stderr=%s", outStream, errStream) } outStream, errStream = new(bytes.Buffer), new(bytes.Buffer) diff --git a/integrationtest/inspection/inspection_test.go b/integrationtest/inspection/inspection_test.go index a875a639c..d43897d7c 100644 --- a/integrationtest/inspection/inspection_test.go +++ b/integrationtest/inspection/inspection_test.go @@ -181,7 +181,7 @@ func TestIntegration(t *testing.T) { Dir: "eval-on-root-context", }, { - Name: "sensitve variable", + Name: "sensitive variable", Command: "tflint --format json", Dir: "sensitive", }, diff --git a/integrationtest/inspection/map-attribute/template.tf b/integrationtest/inspection/map-attribute/template.tf index 7507691ad..a38e50217 100644 --- a/integrationtest/inspection/map-attribute/template.tf +++ b/integrationtest/inspection/map-attribute/template.tf @@ -1,4 +1,4 @@ -resource "aws_instance" "intance" { +resource "aws_instance" "instance" { tags = { foo = "bar" } } diff --git a/plugin/discovery.go b/plugin/discovery.go index 672890f59..8d25f4390 100644 --- a/plugin/discovery.go +++ b/plugin/discovery.go @@ -123,18 +123,18 @@ func getPluginDir(cfg *tflint.Config) (string, error) { // and if it exists, the extension is added to the argument. func findPluginPath(path string) (string, error) { if runtime.GOOS != "windows" { - return checkPluginExistance(path) + return checkPluginExistence(path) } - returnPath, err := checkPluginExistance(path) + returnPath, err := checkPluginExistence(path) if os.IsNotExist(err) { - return checkPluginExistance(path + ".exe") + return checkPluginExistence(path + ".exe") } return returnPath, err } -func checkPluginExistance(path string) (string, error) { +func checkPluginExistence(path string) (string, error) { info, err := os.Stat(path) if err != nil { return "", err diff --git a/plugin/signature.go b/plugin/signature.go index 580bd8cdc..9d585d314 100644 --- a/plugin/signature.go +++ b/plugin/signature.go @@ -94,7 +94,7 @@ func (c *SignatureChecker) VerifyKeyless(target io.ReadSeeker, attestations []*g // // - Signed Entity Timestamp (SET), the time that the short-lived certificate was valid // - Certificate Transparency Logs, as public records - // - Signed Cerificate Timestamp (SCT), the time that the certificate was issued + // - Signed Certificate Timestamp (SCT), the time that the certificate was issued verifier, err := verify.NewSignedEntityVerifier( trustedRoot, verify.WithObserverTimestamps(1), diff --git a/plugin/signature_test.go b/plugin/signature_test.go index b4a520948..1a668c79e 100644 --- a/plugin/signature_test.go +++ b/plugin/signature_test.go @@ -30,17 +30,17 @@ func Test_GetSigningKey(t *testing.T) { Expected: testSigningKey, }, { - Name: "bulit-in signing key", + Name: "built-in signing key", Config: NewInstallConfig(tflint.EmptyConfig(), &tflint.PluginConfig{SigningKey: "", SourceOwner: "terraform-linters"}), Expected: builtinSigningKey, }, { - Name: "bulit-in signing key and configured signing key", + Name: "built-in signing key and configured signing key", Config: NewInstallConfig(tflint.EmptyConfig(), &tflint.PluginConfig{SigningKey: testSigningKey, SourceOwner: "terraform-linters"}), Expected: testSigningKey, }, { - Name: "bulit-in signing key, but in experimental mode", + Name: "built-in signing key, but in experimental mode", Config: NewInstallConfig(tflint.EmptyConfig(), &tflint.PluginConfig{SigningKey: "", SourceOwner: "terraform-linters"}), Envs: map[string]string{"TFLINT_EXPERIMENTAL": "true"}, Expected: "", @@ -81,17 +81,17 @@ func Test_HasSigningKey(t *testing.T) { Expected: true, }, { - Name: "bulit-in signing key", + Name: "built-in signing key", Config: NewInstallConfig(tflint.EmptyConfig(), &tflint.PluginConfig{SigningKey: "", SourceOwner: "terraform-linters"}), Expected: true, }, { - Name: "bulit-in signing key and configured signing key", + Name: "built-in signing key and configured signing key", Config: NewInstallConfig(tflint.EmptyConfig(), &tflint.PluginConfig{SigningKey: testSigningKey, SourceOwner: "terraform-linters"}), Expected: true, }, { - Name: "bulit-in signing key, but in experimental mode", + Name: "built-in signing key, but in experimental mode", Config: NewInstallConfig(tflint.EmptyConfig(), &tflint.PluginConfig{SigningKey: "", SourceOwner: "terraform-linters"}), Envs: map[string]string{"TFLINT_EXPERIMENTAL": "true"}, Expected: false, diff --git a/terraform/addrs/instance_key.go b/terraform/addrs/instance_key.go index d4774917a..f4de7a01a 100644 --- a/terraform/addrs/instance_key.go +++ b/terraform/addrs/instance_key.go @@ -46,7 +46,7 @@ func ParseInstanceKey(key cty.Value) (InstanceKey, error) { } } -// NoKey represents the absense of an InstanceKey, for the single instance +// NoKey represents the absence of an InstanceKey, for the single instance // of a configuration object that does not use "count" or "for_each" at all. var NoKey InstanceKey diff --git a/terraform/addrs/module_source.go b/terraform/addrs/module_source.go index fc4c87d9c..7103f6770 100644 --- a/terraform/addrs/module_source.go +++ b/terraform/addrs/module_source.go @@ -66,7 +66,7 @@ func ParseModuleSource(raw string) (ModuleSource, error) { // and then create relative references within the same directory in order // to ensure all modules in the package are looking at a consistent filesystem // layout. We also assume that modules within a package are maintained together, -// which means that cross-cutting maintenence across all of them would be +// which means that cross-cutting maintenance across all of them would be // possible. // // The actual value of a ModuleSourceLocal is a normalized relative path using @@ -106,7 +106,7 @@ func parseModuleSourceLocal(raw string) (ModuleSourceLocal, error) { clean := path.Clean(raw) // However, we do need to keep a single "./" on the front if it isn't - // a "../" path, or else it would be ambigous with the registry address + // a "../" path, or else it would be ambiguous with the registry address // syntax. if !strings.HasPrefix(clean, "../") { clean = "./" + clean diff --git a/terraform/addrs/parse_ref.go b/terraform/addrs/parse_ref.go index d808710a1..76c576bf3 100644 --- a/terraform/addrs/parse_ref.go +++ b/terraform/addrs/parse_ref.go @@ -15,7 +15,7 @@ type Reference struct { Remaining hcl.Traversal } -// ParseRef attempts to extract a referencable address from the prefix of the +// ParseRef attempts to extract a referenceable address from the prefix of the // given traversal, which must be an absolute traversal or this function // will panic. // diff --git a/terraform/collections/unique_key.go b/terraform/collections/unique_key.go index d6caf0f3b..97190d4d2 100644 --- a/terraform/collections/unique_key.go +++ b/terraform/collections/unique_key.go @@ -28,7 +28,7 @@ type UniqueKey[T any] interface { // A UniqueKeyer is a type that knows how to calculate a unique key itself. type UniqueKeyer[T any] interface { - // UniqueKey returns the unique key of the reciever. + // UniqueKey returns the unique key of the receiver. // // A correct implementation of UniqueKey must return a distinct value // for each unique value of T, where the uniqueness of T values is decided diff --git a/terraform/evaluator_test.go b/terraform/evaluator_test.go index bcecbc04a..2d301a653 100644 --- a/terraform/evaluator_test.go +++ b/terraform/evaluator_test.go @@ -277,7 +277,7 @@ variable "integer_var" { }, }, { - name: "no defualt variable", + name: "no default variable", config: `variable "no_value_var" {}`, expr: expr(`var.no_value_var`), ty: cty.String, diff --git a/terraform/ipaddr/ip_test.go b/terraform/ipaddr/ip_test.go index ddd95aa53..491ece0c6 100644 --- a/terraform/ipaddr/ip_test.go +++ b/terraform/ipaddr/ip_test.go @@ -105,7 +105,7 @@ var parseCIDRTests = []struct { {"0.0.0.-3/32", nil, nil, &ParseError{Type: "CIDR address", Text: "0.0.0.-3/32"}}, {"0.0.0.0/-0", nil, nil, &ParseError{Type: "CIDR address", Text: "0.0.0.0/-0"}}, // - // NOTE: Theis correct failure was added for go-1.17, but is a + // NOTE: This correct failure was added for go-1.17, but is a // backwards-incompatible change for Terraform users, who might have // already written modules using leading zeroes. // diff --git a/terraform/lang/funcs/cidr.go b/terraform/lang/funcs/cidr.go index f486d501a..61f2af317 100644 --- a/terraform/lang/funcs/cidr.go +++ b/terraform/lang/funcs/cidr.go @@ -14,7 +14,7 @@ import ( "github.com/zclconf/go-cty/cty/gocty" ) -// CidrHostFunc contructs a function that calculates a full host IP address +// CidrHostFunc constructs a function that calculates a full host IP address // within a given IP network address prefix. var CidrHostFunc = function.New(&function.Spec{ Params: []function.Parameter{ @@ -48,7 +48,7 @@ var CidrHostFunc = function.New(&function.Spec{ }, }) -// CidrNetmaskFunc contructs a function that converts an IPv4 address prefix given +// CidrNetmaskFunc constructs a function that converts an IPv4 address prefix given // in CIDR notation into a subnet mask address. var CidrNetmaskFunc = function.New(&function.Spec{ Params: []function.Parameter{ @@ -73,7 +73,7 @@ var CidrNetmaskFunc = function.New(&function.Spec{ }, }) -// CidrSubnetFunc contructs a function that calculates a subnet address within +// CidrSubnetFunc constructs a function that calculates a subnet address within // a given IP network address prefix. var CidrSubnetFunc = function.New(&function.Spec{ Params: []function.Parameter{ diff --git a/terraform/lang/funcs/collection_test.go b/terraform/lang/funcs/collection_test.go index 422e67e2b..daf9c5074 100644 --- a/terraform/lang/funcs/collection_test.go +++ b/terraform/lang/funcs/collection_test.go @@ -813,7 +813,7 @@ func TestLookup(t *testing.T) { cty.StringVal("beep").Mark("a"), false, }, - { // apply collection marks to unknown return vaue + { // apply collection marks to unknown return value []cty.Value{ cty.MapVal(map[string]cty.Value{ "boop": cty.StringVal("beep"), @@ -1727,7 +1727,7 @@ func TestTranspose(t *testing.T) { cty.NilVal, true, }, - { // marks (deep or shallow) on any elements will propegate to the entire return value + { // marks (deep or shallow) on any elements will propagate to the entire return value cty.MapVal(map[string]cty.Value{ "key1": cty.ListVal([]cty.Value{ cty.StringVal("a").Mark("beep"), // mark on the inner list element diff --git a/terraform/lang/funcs/crypto.go b/terraform/lang/funcs/crypto.go index 0b7bef984..2257001f4 100644 --- a/terraform/lang/funcs/crypto.go +++ b/terraform/lang/funcs/crypto.go @@ -125,7 +125,7 @@ var BcryptFunc = function.New(&function.Spec{ input := args[0].AsString() out, err := bcrypt.GenerateFromPassword([]byte(input), defaultCost) if err != nil { - return cty.UnknownVal(cty.String), fmt.Errorf("error occured generating password %s", err.Error()) + return cty.UnknownVal(cty.String), fmt.Errorf("error occurred generating password %s", err.Error()) } return cty.StringVal(string(out)), nil @@ -171,7 +171,7 @@ var RsaDecryptFunc = function.New(&function.Spec{ case asn1.SyntaxError: errStr = strings.ReplaceAll(e.Error(), "asn1: syntax error", "invalid ASN1 data in the given private key") case asn1.StructuralError: - errStr = strings.ReplaceAll(e.Error(), "asn1: struture error", "invalid ASN1 data in the given private key") + errStr = strings.ReplaceAll(e.Error(), "asn1: structure error", "invalid ASN1 data in the given private key") default: errStr = fmt.Sprintf("invalid private key: %s", e) } @@ -191,7 +191,7 @@ var RsaDecryptFunc = function.New(&function.Spec{ }, }) -// Sha1Func contructs a function that computes the SHA1 hash of a given string +// Sha1Func constructs a function that computes the SHA1 hash of a given string // and encodes it with hexadecimal digits. var Sha1Func = makeStringHashFunction(sha1.New, hex.EncodeToString) @@ -201,7 +201,7 @@ func MakeFileSha1Func(baseDir string) function.Function { return makeFileHashFunction(baseDir, sha1.New, hex.EncodeToString) } -// Sha256Func contructs a function that computes the SHA256 hash of a given string +// Sha256Func constructs a function that computes the SHA256 hash of a given string // and encodes it with hexadecimal digits. var Sha256Func = makeStringHashFunction(sha256.New, hex.EncodeToString) @@ -211,7 +211,7 @@ func MakeFileSha256Func(baseDir string) function.Function { return makeFileHashFunction(baseDir, sha256.New, hex.EncodeToString) } -// Sha512Func contructs a function that computes the SHA512 hash of a given string +// Sha512Func constructs a function that computes the SHA512 hash of a given string // and encodes it with hexadecimal digits. var Sha512Func = makeStringHashFunction(sha512.New, hex.EncodeToString) diff --git a/terraform/lang/funcs/crypto_test.go b/terraform/lang/funcs/crypto_test.go index 279777743..9b50e6414 100644 --- a/terraform/lang/funcs/crypto_test.go +++ b/terraform/lang/funcs/crypto_test.go @@ -96,7 +96,7 @@ func TestBase64Sha256(t *testing.T) { cty.StringVal("n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg="), false, }, - // This would differ because we're base64-encoding hex represantiation, not raw bytes. + // This would differ because we're base64-encoding hex representation, not raw bytes. // base64encode(sha256("test")) = // "OWY4NmQwODE4ODRjN2Q2NTlhMmZlYWEwYzU1YWQwMTVhM2JmNGYxYjJiMGI4MjJjZDE1ZDZjMTViMGYwMGEwOA==" } @@ -177,7 +177,7 @@ func TestBase64Sha512(t *testing.T) { cty.StringVal("7iaw3Ur350mqGo7jwQrpkj9hiYB3Lkc/iBml1JQODbJ6wYX4oOHV+E+IvIh/1nsUNzLDBMxfqa2Ob1f1ACio/w=="), false, }, - // This would differ because we're base64-encoding hex represantiation, not raw bytes + // This would differ because we're base64-encoding hex representation, not raw bytes // base64encode(sha512("test")) = // "OZWUyNmIwZGQ0YWY3ZTc0OWFhMWE4ZWUzYzEwYWU5OTIzZjYxODk4MDc3MmU0NzNmODgxOWE1ZDQ5NDBlMGRiMjdhYzE4NWY4YTBlMWQ1Zjg0Zjg4YmM4ODdmZDY3YjE0MzczMmMzMDRjYzVmYTlhZDhlNmY1N2Y1MDAyOGE4ZmY=" } diff --git a/terraform/lang/funcs/datetime.go b/terraform/lang/funcs/datetime.go index b6df93051..21b33788a 100644 --- a/terraform/lang/funcs/datetime.go +++ b/terraform/lang/funcs/datetime.go @@ -89,7 +89,7 @@ var TimeCmpFunc = function.New(&function.Spec{ case tsA.Before(tsB): return cty.NumberIntVal(-1), nil default: - // By elimintation, tsA must be after tsB. + // By elimination, tsA must be after tsB. return cty.NumberIntVal(1), nil } }, diff --git a/terraform/lang/funcs/number.go b/terraform/lang/funcs/number.go index 8a8f1410f..7da458b3b 100644 --- a/terraform/lang/funcs/number.go +++ b/terraform/lang/funcs/number.go @@ -12,7 +12,7 @@ import ( "github.com/zclconf/go-cty/cty/gocty" ) -// LogFunc contructs a function that returns the logarithm of a given number in a given base. +// LogFunc constructs a function that returns the logarithm of a given number in a given base. var LogFunc = function.New(&function.Spec{ Params: []function.Parameter{ { @@ -41,7 +41,7 @@ var LogFunc = function.New(&function.Spec{ }, }) -// PowFunc contructs a function that returns the logarithm of a given number in a given base. +// PowFunc constructs a function that returns the logarithm of a given number in a given base. var PowFunc = function.New(&function.Spec{ Params: []function.Parameter{ { @@ -70,7 +70,7 @@ var PowFunc = function.New(&function.Spec{ }, }) -// SignumFunc contructs a function that returns the closest whole number greater +// SignumFunc constructs a function that returns the closest whole number greater // than or equal to the given value. var SignumFunc = function.New(&function.Spec{ Params: []function.Parameter{ @@ -97,7 +97,7 @@ var SignumFunc = function.New(&function.Spec{ }, }) -// ParseIntFunc contructs a function that parses a string argument and returns an integer of the specified base. +// ParseIntFunc constructs a function that parses a string argument and returns an integer of the specified base. var ParseIntFunc = function.New(&function.Spec{ Params: []function.Parameter{ { diff --git a/terraform/lang/funcs/string.go b/terraform/lang/funcs/string.go index c3f22d300..2764a01fe 100644 --- a/terraform/lang/funcs/string.go +++ b/terraform/lang/funcs/string.go @@ -96,7 +96,7 @@ var EndsWithFunc = function.New(&function.Spec{ }) // ReplaceFunc constructs a function that searches a given string for another -// given substring, and replaces each occurence with a given replacement string. +// given substring, and replaces each occurrence with a given replacement string. var ReplaceFunc = function.New(&function.Spec{ Params: []function.Parameter{ { @@ -434,7 +434,7 @@ func isValidTemplateStringExpr(expr hcl.Expression) bool { } // Replace searches a given string for another given substring, -// and replaces all occurences with a given replacement string. +// and replaces all occurrences with a given replacement string. func Replace(str, substr, replace cty.Value) (cty.Value, error) { return ReplaceFunc.Call([]cty.Value{str, substr, replace}) } diff --git a/terraform/lang/references.go b/terraform/lang/references.go index d5dda42f1..d1c256f63 100644 --- a/terraform/lang/references.go +++ b/terraform/lang/references.go @@ -12,7 +12,7 @@ import ( // This function does not do any de-duplication of references, since references // have source location information embedded in them and so any invalid // references that are duplicated should have errors reported for each -// occurence. +// occurrence. // // If the returned diagnostics contains errors then the result may be // incomplete or invalid. Otherwise, the returned slice has one reference per diff --git a/terraform/module.go b/terraform/module.go index b6ff59f35..4f7fe7744 100644 --- a/terraform/module.go +++ b/terraform/module.go @@ -59,7 +59,7 @@ func (m *Module) build() hcl.Diagnostics { } m.Resources[r.Type][r.Name] = r case "variable": - v, valDiags := decodeVairableBlock(block) + v, valDiags := decodeVariableBlock(block) diags = diags.Extend(valDiags) m.Variables[v.Name] = v case "module": diff --git a/terraform/tfhcl/expand_spec.go b/terraform/tfhcl/expand_spec.go index 4dbee278a..8846c95d0 100644 --- a/terraform/tfhcl/expand_spec.go +++ b/terraform/tfhcl/expand_spec.go @@ -248,7 +248,7 @@ func (b *expandBody) decodeMetaArgSpec(rawSpec *hcl.Block) (*expandMetaArgSpec, spec.countVal = countVal - // We skip validation for count attribute if the value is unknwon + // We skip validation for count attribute if the value is unknown if countVal.IsKnown() { if countVal.IsNull() { diags = append(diags, &hcl.Diagnostic{ diff --git a/terraform/variable.go b/terraform/variable.go index fe722bff1..927ab5480 100644 --- a/terraform/variable.go +++ b/terraform/variable.go @@ -27,7 +27,7 @@ type Variable struct { Nullable bool } -func decodeVairableBlock(block *hclext.Block) (*Variable, hcl.Diagnostics) { +func decodeVariableBlock(block *hclext.Block) (*Variable, hcl.Diagnostics) { v := &Variable{ Name: block.Labels[0], Type: cty.DynamicPseudoType, diff --git a/tflint/config.go b/tflint/config.go index d627e15bd..021e1c3e4 100644 --- a/tflint/config.go +++ b/tflint/config.go @@ -445,7 +445,7 @@ var bundledPluginConfigContent = ` preset = "recommended" ` -// DisbaleBundledPlugin is a flag to temporarily disable the bundled plugin for integration tests. +// DisableBundledPlugin is a flag to temporarily disable the bundled plugin for integration tests. var DisableBundledPlugin = false // Terraform Language plugin is automatically enabled if the plugin isn't explicitly declared. diff --git a/tflint/runner.go b/tflint/runner.go index 1f83909cd..523617cce 100644 --- a/tflint/runner.go +++ b/tflint/runner.go @@ -14,7 +14,7 @@ import ( ) // Runner checks templates according rules. -// For variables interplation, it has Terraform eval context. +// For variables interpolation, it has Terraform eval context. // After checking, it accumulates results as issues. type Runner struct { TFConfig *terraform.Config @@ -36,7 +36,7 @@ type Rule interface { } // NewRunner returns new TFLint runner. -// It prepares built-in context (workpace metadata, variables) from +// It prepares built-in context (workspace metadata, variables) from // received `terraform.Config` and `terraform.InputValues`. func NewRunner(originalWorkingDir string, c *Config, ants map[string]Annotations, cfg *terraform.Config, variables ...terraform.InputValues) (*Runner, error) { path := "root" diff --git a/tools/release/main.go b/tools/release/main.go index 2ec3a9171..aa2e18dbc 100644 --- a/tools/release/main.go +++ b/tools/release/main.go @@ -60,7 +60,7 @@ func main() { log.Fatal(err) } - log.Println("commiting and tagging...") + log.Println("committing and tagging...") if err := execCommand(os.Stdout, "git", "add", "."); err != nil { log.Fatal(err) }