Skip to content

Commit b454e07

Browse files
authored
Fix typos (#1380)
1 parent 47fc83b commit b454e07

33 files changed

+69
-69
lines changed

.github/CONTRIBUTING.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ We welcome issues of all kinds including feature requests, bug reports or docume
5454

5555
### Bug Reports
5656

57-
- [ ] **Test against latest release**: Make sure you test against the latest avaiable version of both Terraform and SDK.
57+
- [ ] **Test against latest release**: Make sure you test against the latest available version of both Terraform and SDK.
5858
It is possible we already fixed the bug you're experiencing.
5959

6060
- [ ] **Search for duplicates**: It's helpful to keep bug reports consolidated to one thread, so do a quick search on existing bug reports to check if anybody else has reported the same thing. You can scope searches by the label `bug` to help narrow things down.
@@ -116,7 +116,7 @@ In the case of `terraform-plugin-sdk`, the repo's close relationship to the `ter
116116

117117
#### Exceptions
118118

119-
We belive that one should "leave the campsite cleaner than you found it", so you are welcome to clean up cosmetic issues in the neighbourhood when submitting a patch that makes functional changes or fixes.
119+
We believe that one should "leave the campsite cleaner than you found it", so you are welcome to clean up cosmetic issues in the neighbourhood when submitting a patch that makes functional changes or fixes.
120120

121121
### Dependency Updates
122122

@@ -140,7 +140,7 @@ changie new
140140
```
141141
and choose a `kind` of change corresponding to the Terraform Plugin [changelog categories](https://developer.hashicorp.com/terraform/plugin/best-practices/versioning#categorization)
142142

143-
Fill out the body field following the entry format. Changie will then prompt for a Github issue or pull request number.
143+
Fill out the body field following the entry format. Changie will then prompt for a GitHub issue or pull request number.
144144

145145
Repeat this process for any additional changes. The `.yaml` files created in the `.changes/unreleased` folder
146146
should be pushed the repository along with any code changes.
@@ -181,7 +181,7 @@ tfsdk: Prevented potential panic in `Example()` function
181181

182182
###### Enhancements
183183

184-
A new enhancement entry should use the `ENHANCEMENTS` kind and have a prefix indicating the sub-package it corresponds to, a colon, then followed by a brief summary. Use a `all` prefix for enchancements that apply to all sub-packages.
184+
A new enhancement entry should use the `ENHANCEMENTS` kind and have a prefix indicating the sub-package it corresponds to, a colon, then followed by a brief summary. Use a `all` prefix for enhancements that apply to all sub-packages.
185185

186186
``````markdown
187187
attr: Added `Great` interface for doing great things
@@ -262,7 +262,7 @@ To test the `ci-go/terraform-provider-corner` job, a valid GitHub Personal Acces
262262

263263
### Go Unit Tests
264264

265-
Go code unit testing is perfomed via Go's built-in testing functionality.
265+
Go code unit testing is performed via Go's built-in testing functionality.
266266

267267
To run the Go unit testing locally:
268268

@@ -343,7 +343,7 @@ Before running a release:
343343

344344
- **`meta/meta.go`**: The versions must be appropriately updated.
345345

346-
To cut a release, go to the repository in Github and click on the `Actions` tab.
346+
To cut a release, go to the repository in GitHub and click on the `Actions` tab.
347347

348348
Select the `Release` workflow on the left-hand menu.
349349

helper/logging/logging.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func LogOutput(t testing.T) (logOutput io.Writer, err error) {
9090

9191
// SetOutput checks for a log destination with LogOutput, and calls
9292
// log.SetOutput with the result. If LogOutput returns nil, SetOutput uses
93-
// io.Discard. Any error from LogOutout is fatal.
93+
// io.Discard. Any error from LogOutput is fatal.
9494
func SetOutput(t testing.T) {
9595
out, err := LogOutput(t)
9696
if err != nil {

helper/resource/testing.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
)
2929

3030
// flagSweep is a flag available when running tests on the command line. It
31-
// contains a comma seperated list of regions to for the sweeper functions to
31+
// contains a comma separated list of regions to for the sweeper functions to
3232
// run in. This flag bypasses the normal Test path and instead runs functions designed to
3333
// clean up any leaked resources a testing environment could have created. It is
3434
// a best effort attempt, and relies on Provider authors to implement "Sweeper"
@@ -49,7 +49,7 @@ import (
4949

5050
var flagSweep = flag.String("sweep", "", "List of Regions to run available Sweepers")
5151
var flagSweepAllowFailures = flag.Bool("sweep-allow-failures", false, "Enable to allow Sweeper Tests to continue after failures")
52-
var flagSweepRun = flag.String("sweep-run", "", "Comma seperated list of Sweeper Tests to run")
52+
var flagSweepRun = flag.String("sweep-run", "", "Comma separated list of Sweeper Tests to run")
5353
var sweeperFuncs map[string]*Sweeper
5454

5555
// SweeperFunc is a signature for a function that acts as a sweeper. It
@@ -103,7 +103,7 @@ func AddTestSweepers(name string, s *Sweeper) {
103103
// Sweeper flags added to the "go test" command:
104104
//
105105
// -sweep: Comma-separated list of locations/regions to run available sweepers.
106-
// -sweep-allow-failues: Enable to allow other sweepers to run after failures.
106+
// -sweep-allow-failures: Enable to allow other sweepers to run after failures.
107107
// -sweep-run: Comma-separated list of resource type sweepers to run. Defaults
108108
// to all sweepers.
109109
//
@@ -183,7 +183,7 @@ func runSweepers(regions []string, sweepers map[string]*Sweeper, allowFailures b
183183
return sweeperRunList, nil
184184
}
185185

186-
// filterSweepers takes a comma seperated string listing the names of sweepers
186+
// filterSweepers takes a comma separated string listing the names of sweepers
187187
// to be ran, and returns a filtered set from the list of all of sweepers to
188188
// run based on the names given.
189189
func filterSweepers(f string, source map[string]*Sweeper) map[string]*Sweeper {
@@ -230,7 +230,7 @@ func filterSweeperWithDependencies(name string, source map[string]*Sweeper) map[
230230
return result
231231
}
232232

233-
// runSweeperWithRegion recieves a sweeper and a region, and recursively calls
233+
// runSweeperWithRegion receives a sweeper and a region, and recursively calls
234234
// itself with that region for every dependency found for that sweeper. If there
235235
// are no dependencies, invoke the contained sweeper fun with the region, and
236236
// add the success/fail status to the sweeperRunList.
@@ -812,7 +812,7 @@ func testResource(c TestStep, state *terraform.State) (*terraform.ResourceState,
812812
// into smaller pieces more easily.
813813
//
814814
// ComposeTestCheckFunc returns immediately on the first TestCheckFunc error.
815-
// To aggregrate all errors, use ComposeAggregateTestCheckFunc instead.
815+
// To aggregate all errors, use ComposeAggregateTestCheckFunc instead.
816816
func ComposeTestCheckFunc(fs ...TestCheckFunc) TestCheckFunc {
817817
return func(s *terraform.State) error {
818818
for i, f := range fs {
@@ -831,7 +831,7 @@ func ComposeTestCheckFunc(fs ...TestCheckFunc) TestCheckFunc {
831831
// As a user testing their provider, this lets you decompose your checks
832832
// into smaller pieces more easily.
833833
//
834-
// Unlike ComposeTestCheckFunc, ComposeAggergateTestCheckFunc runs _all_ of the
834+
// Unlike ComposeTestCheckFunc, ComposeAggregateTestCheckFunc runs _all_ of the
835835
// TestCheckFuncs and aggregates failures.
836836
func ComposeAggregateTestCheckFunc(fs ...TestCheckFunc) TestCheckFunc {
837837
return func(s *terraform.State) error {

helper/resource/testing_sets.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const (
2020
// TestCheckTypeSetElemNestedAttrs ensures a subset map of values is stored in
2121
// state for the given name and key combination of attributes nested under a
2222
// list or set block. Use this TestCheckFunc in preference over non-set
23-
// variants to simplify testing code and ensure compatibility with indicies,
23+
// variants to simplify testing code and ensure compatibility with indices,
2424
// which can easily change with schema changes. State value checking is only
2525
// recommended for testing Computed attributes and attribute defaults.
2626
//
@@ -92,7 +92,7 @@ func TestCheckTypeSetElemNestedAttrs(name, attr string, values map[string]string
9292
// regular expressions, is stored in state for the given name and key
9393
// combination of attributes nested under a list or set block. Use this
9494
// TestCheckFunc in preference over non-set variants to simplify testing code
95-
// and ensure compatibility with indicies, which can easily change with schema
95+
// and ensure compatibility with indices, which can easily change with schema
9696
// changes. State value checking is only recommended for testing Computed
9797
// attributes and attribute defaults.
9898
//
@@ -171,7 +171,7 @@ func TestMatchTypeSetElemNestedAttrs(name, attr string, values map[string]*regex
171171
// TestCheckTypeSetElemAttr ensures a specific value is stored in state for the
172172
// given name and key combination under a list or set. Use this TestCheckFunc
173173
// in preference over non-set variants to simplify testing code and ensure
174-
// compatibility with indicies, which can easily change with schema changes.
174+
// compatibility with indices, which can easily change with schema changes.
175175
// State value checking is only recommended for testing Computed attributes and
176176
// attribute defaults.
177177
//

helper/resource/testing_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ func TestFilterSweepers(t *testing.T) {
337337
Filter: "none",
338338
},
339339
{
340-
Name: "with nested depenencies and top level filter",
340+
Name: "with nested dependencies and top level filter",
341341
Sweepers: map[string]*Sweeper{
342342
"not_matching": {
343343
Name: "not_matching",
@@ -362,7 +362,7 @@ func TestFilterSweepers(t *testing.T) {
362362
Filter: "matching_level1",
363363
},
364364
{
365-
Name: "with nested depenencies and middle level filter",
365+
Name: "with nested dependencies and middle level filter",
366366
Sweepers: map[string]*Sweeper{
367367
"not_matching": {
368368
Name: "not_matching",
@@ -387,7 +387,7 @@ func TestFilterSweepers(t *testing.T) {
387387
Filter: "matching_level2",
388388
},
389389
{
390-
Name: "with nested depenencies and bottom level filter",
390+
Name: "with nested dependencies and bottom level filter",
391391
Sweepers: map[string]*Sweeper{
392392
"not_matching": {
393393
Name: "not_matching",
@@ -809,7 +809,7 @@ func TestRunSweepers(t *testing.T) {
809809
ExpectError: true,
810810
},
811811
{
812-
Name: "failing top and dep allow failues",
812+
Name: "failing top and dep allow failures",
813813
Sweepers: map[string]*Sweeper{
814814
"aws_top": {
815815
Name: "aws_top",

helper/schema/core_schema.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (m schemaMap) CoreConfigSchema() *configschema.Block {
123123
// whose elem is a whole resource.
124124
func (s *Schema) coreConfigSchemaAttribute() *configschema.Attribute {
125125
// The Schema.DefaultFunc capability adds some extra weirdness here since
126-
// it can be combined with "Required: true" to create a sitution where
126+
// it can be combined with "Required: true" to create a situation where
127127
// required-ness is conditional. Terraform Core doesn't share this concept,
128128
// so we must sniff for this possibility here and conditionally turn
129129
// off the "Required" flag if it looks like the DefaultFunc is going

helper/schema/field_reader_config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func (r *ConfigFieldReader) readSet(
269269
return FieldReadResult{Value: set}, nil
270270
}
271271

272-
// If the list is computed, the set is necessarilly computed
272+
// If the list is computed, the set is necessarily computed
273273
if raw.Computed {
274274
return FieldReadResult{
275275
Value: set,

helper/schema/grpc_provider.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ func (s *GRPCProviderServer) upgradeJSONState(ctx context.Context, version int,
501501
// Remove any attributes no longer present in the schema, so that the json can
502502
// be correctly decoded.
503503
func (s *GRPCProviderServer) removeAttributes(ctx context.Context, v interface{}, ty cty.Type) {
504-
// we're only concerned with finding maps that corespond to object
504+
// we're only concerned with finding maps that correspond to object
505505
// attributes
506506
switch v := v.(type) {
507507
case []interface{}:
@@ -1593,7 +1593,7 @@ func stripSchema(s *Schema) *Schema {
15931593
}
15941594

15951595
// Zero values and empty containers may be interchanged by the apply process.
1596-
// When there is a discrepency between src and dst value being null or empty,
1596+
// When there is a discrepancy between src and dst value being null or empty,
15971597
// prefer the src value. This takes a little more liberty with set types, since
15981598
// we can't correlate modified set values. In the case of sets, if the src set
15991599
// was wholly known we assume the value was correctly applied and copy that

helper/schema/resource.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ type Resource struct {
189189
// This implementation is optional. If omitted, all Schema must enable
190190
// the ForceNew field and any practitioner changes that would have
191191
// caused and update will instead destroy and recreate the infrastructure
192-
// compontent.
192+
// component.
193193
//
194194
// The *ResourceData parameter contains the plan and state data for this
195195
// managed resource instance. The available data in the Get* methods is the
@@ -321,7 +321,7 @@ type Resource struct {
321321
// This implementation is optional. If omitted, all Schema must enable
322322
// the ForceNew field and any practitioner changes that would have
323323
// caused and update will instead destroy and recreate the infrastructure
324-
// compontent.
324+
// component.
325325
//
326326
// The Context parameter stores SDK information, such as loggers and
327327
// timeout deadlines. It also is wired to receive any cancellation from
@@ -460,7 +460,7 @@ type Resource struct {
460460
// This implementation is optional. If omitted, all Schema must enable
461461
// the ForceNew field and any practitioner changes that would have
462462
// caused and update will instead destroy and recreate the infrastructure
463-
// compontent.
463+
// component.
464464
//
465465
// The Context parameter stores SDK information, such as loggers. It also
466466
// is wired to receive any cancellation from Terraform such as a system or
@@ -664,7 +664,7 @@ type ResourceBehavior struct {
664664
// to change or break without warning. It is not protected by version compatibility guarantees.
665665
type ProviderDeferredBehavior struct {
666666
// When EnablePlanModification is true, the SDK will execute provider-defined logic
667-
// during plan (CustomizeDiff, Default, DiffSupressFunc, etc.) if ConfigureProvider
667+
// during plan (CustomizeDiff, Default, DiffSuppressFunc, etc.) if ConfigureProvider
668668
// returns a deferred response. The SDK will then automatically return a deferred response
669669
// along with the modified plan.
670670
EnablePlanModification bool
@@ -748,7 +748,7 @@ type StateUpgrader struct {
748748

749749
// Upgrade takes the JSON encoded state and the provider meta value, and
750750
// upgrades the state one single schema version. The provided state is
751-
// deocded into the default json types using a map[string]interface{}. It
751+
// decoded into the default json types using a map[string]interface{}. It
752752
// is up to the StateUpgradeFunc to ensure that the returned value can be
753753
// encoded using the new schema.
754754
Upgrade StateUpgradeFunc
@@ -873,7 +873,7 @@ func (r *Resource) Apply(
873873
data.providerMeta = s.ProviderMeta
874874
}
875875

876-
// Instance Diff shoould have the timeout info, need to copy it over to the
876+
// Instance Diff should have the timeout info, need to copy it over to the
877877
// ResourceData meta
878878
rt := ResourceTimeout{}
879879
if _, ok := d.Meta[TimeoutKey]; ok {

helper/schema/resource_data.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (d *ResourceData) GetChange(key string) (interface{}, interface{}) {
8282
// GetOk returns the data for the given key and whether or not the key
8383
// has been set to a non-zero value at some point.
8484
//
85-
// The first result will not necessarilly be nil if the value doesn't exist.
85+
// The first result will not necessarily be nil if the value doesn't exist.
8686
// The second result should be checked to determine this information.
8787
func (d *ResourceData) GetOk(key string) (interface{}, bool) {
8888
r := d.getRaw(key, getSourceSet)

helper/schema/resource_data_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ func TestResourceDataGetOk(t *testing.T) {
10371037
Ok: false,
10381038
},
10391039

1040-
// Further illustrates and clarifiies the GetOk semantics from #933, and
1040+
// Further illustrates and clarifies the GetOk semantics from #933, and
10411041
// highlights the limitation that zero-value config is currently
10421042
// indistinguishable from unset config.
10431043
{

helper/schema/resource_timeout.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func (t *ResourceTimeout) ConfigDecode(s *Resource, c *terraform.ResourceConfig)
132132
timeout = t.Default
133133
}
134134

135-
// If the resource has not delcared this in the definition, then error
135+
// If the resource has not declared this in the definition, then error
136136
// with an unsupported message
137137
if timeout == nil {
138138
return unsupportedTimeoutKeyError(timeKey)

helper/schema/schema.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ type Schema struct {
145145
//
146146
// The key benefit of activating this flag is that the result of Read or
147147
// ReadContext will be cleaned of normalization-only changes in the same
148-
// way as the planning result would normaly be, which therefore prevents
148+
// way as the planning result would normally be, which therefore prevents
149149
// churn for downstream expressions deriving from this attribute and
150150
// prevents incorrect "Values changed outside of Terraform" messages
151151
// when the remote API returns values which have the same meaning as the
@@ -1099,7 +1099,7 @@ func isValidFieldName(name string) bool {
10991099
}
11001100

11011101
// resourceDiffer is an interface that is used by the private diff functions.
1102-
// This helps facilitate diff logic for both ResourceData and ResoureDiff with
1102+
// This helps facilitate diff logic for both ResourceData and ResourceDiff with
11031103
// minimal divergence in code.
11041104
type resourceDiffer interface {
11051105
diffChange(string) (interface{}, interface{}, bool, bool, bool)
@@ -1119,24 +1119,24 @@ func (m schemaMap) diff(
11191119
d resourceDiffer,
11201120
all bool) error {
11211121

1122-
unsupressedDiff := new(terraform.InstanceDiff)
1123-
unsupressedDiff.Attributes = make(map[string]*terraform.ResourceAttrDiff)
1122+
unsuppressedDiff := new(terraform.InstanceDiff)
1123+
unsuppressedDiff.Attributes = make(map[string]*terraform.ResourceAttrDiff)
11241124

11251125
var err error
11261126
switch schema.Type {
11271127
case TypeBool, TypeInt, TypeFloat, TypeString:
1128-
err = m.diffString(k, schema, unsupressedDiff, d, all)
1128+
err = m.diffString(k, schema, unsuppressedDiff, d, all)
11291129
case TypeList:
1130-
err = m.diffList(ctx, k, schema, unsupressedDiff, d, all)
1130+
err = m.diffList(ctx, k, schema, unsuppressedDiff, d, all)
11311131
case TypeMap:
1132-
err = m.diffMap(k, schema, unsupressedDiff, d, all)
1132+
err = m.diffMap(k, schema, unsuppressedDiff, d, all)
11331133
case TypeSet:
1134-
err = m.diffSet(ctx, k, schema, unsupressedDiff, d, all)
1134+
err = m.diffSet(ctx, k, schema, unsuppressedDiff, d, all)
11351135
default:
11361136
err = fmt.Errorf("%s: unknown type %#v", k, schema.Type)
11371137
}
11381138

1139-
for attrK, attrV := range unsupressedDiff.Attributes {
1139+
for attrK, attrV := range unsuppressedDiff.Attributes {
11401140
switch rd := d.(type) {
11411141
case *ResourceData:
11421142
if schema.DiffSuppressFunc != nil && attrV != nil &&

helper/schema/set.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func (s *Set) add(item interface{}, computed bool) string {
219219

220220
func (s *Set) hash(item interface{}) string {
221221
code := s.F(item)
222-
// Always return a nonnegative hashcode.
222+
// Always return a non-negative hashcode.
223223
if code < 0 {
224224
code = -code
225225
}

helper/schema/shims_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func testApplyDiff(t *testing.T,
7373
}
7474
}
7575

76-
// Resource.Meta will be hanlded separately, so it's OK that we lose the
76+
// Resource.Meta will be handled separately, so it's OK that we lose the
7777
// timeout values here.
7878
expectedState, err := StateValueFromInstanceState(expected, testSchema.Block.ImpliedType())
7979
if err != nil {

helper/structure/normalize_json_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func TestNormalizeJsonString_valid(t *testing.T) {
7070

7171
func TestNormalizeJsonString_invalid(t *testing.T) {
7272
// Well formatted but not valid,
73-
// missing closing squre bracket.
73+
// missing closing square bracket.
7474
invalidJson := `{
7575
"abc": {
7676
"def": 123,

helper/validation/uuid_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestValidationIsUUID(t *testing.T) {
2424
Value: "00000000-0000-123-0000-000000000000",
2525
Error: true,
2626
},
27-
"ValidUuidWithOutDashs": {
27+
"ValidUuidWithoutDashes": {
2828
Value: "12345678123412341234123456789012",
2929
Error: true,
3030
},

0 commit comments

Comments
 (0)