Skip to content

Commit

Permalink
Fix typos (#1380)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBaulch authored Oct 3, 2024
1 parent 47fc83b commit b454e07
Show file tree
Hide file tree
Showing 33 changed files with 69 additions and 69 deletions.
12 changes: 6 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ We welcome issues of all kinds including feature requests, bug reports or docume

### Bug Reports

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

- [ ] **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.
Expand Down Expand Up @@ -116,7 +116,7 @@ In the case of `terraform-plugin-sdk`, the repo's close relationship to the `ter

#### Exceptions

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.
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.

### Dependency Updates

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

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

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

###### Enhancements

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.
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.

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

### Go Unit Tests

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

To run the Go unit testing locally:

Expand Down Expand Up @@ -343,7 +343,7 @@ Before running a release:

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion helper/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func LogOutput(t testing.T) (logOutput io.Writer, err error) {

// SetOutput checks for a log destination with LogOutput, and calls
// log.SetOutput with the result. If LogOutput returns nil, SetOutput uses
// io.Discard. Any error from LogOutout is fatal.
// io.Discard. Any error from LogOutput is fatal.
func SetOutput(t testing.T) {
out, err := LogOutput(t)
if err != nil {
Expand Down
14 changes: 7 additions & 7 deletions helper/resource/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
)

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

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

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

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

// runSweeperWithRegion recieves a sweeper and a region, and recursively calls
// runSweeperWithRegion receives a sweeper and a region, and recursively calls
// itself with that region for every dependency found for that sweeper. If there
// are no dependencies, invoke the contained sweeper fun with the region, and
// add the success/fail status to the sweeperRunList.
Expand Down Expand Up @@ -812,7 +812,7 @@ func testResource(c TestStep, state *terraform.State) (*terraform.ResourceState,
// into smaller pieces more easily.
//
// ComposeTestCheckFunc returns immediately on the first TestCheckFunc error.
// To aggregrate all errors, use ComposeAggregateTestCheckFunc instead.
// To aggregate all errors, use ComposeAggregateTestCheckFunc instead.
func ComposeTestCheckFunc(fs ...TestCheckFunc) TestCheckFunc {
return func(s *terraform.State) error {
for i, f := range fs {
Expand All @@ -831,7 +831,7 @@ func ComposeTestCheckFunc(fs ...TestCheckFunc) TestCheckFunc {
// As a user testing their provider, this lets you decompose your checks
// into smaller pieces more easily.
//
// Unlike ComposeTestCheckFunc, ComposeAggergateTestCheckFunc runs _all_ of the
// Unlike ComposeTestCheckFunc, ComposeAggregateTestCheckFunc runs _all_ of the
// TestCheckFuncs and aggregates failures.
func ComposeAggregateTestCheckFunc(fs ...TestCheckFunc) TestCheckFunc {
return func(s *terraform.State) error {
Expand Down
6 changes: 3 additions & 3 deletions helper/resource/testing_sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
// TestCheckTypeSetElemNestedAttrs ensures a subset map of values is stored in
// state for the given name and key combination of attributes nested under a
// list or set block. Use this TestCheckFunc in preference over non-set
// variants to simplify testing code and ensure compatibility with indicies,
// variants to simplify testing code and ensure compatibility with indices,
// which can easily change with schema changes. State value checking is only
// recommended for testing Computed attributes and attribute defaults.
//
Expand Down Expand Up @@ -92,7 +92,7 @@ func TestCheckTypeSetElemNestedAttrs(name, attr string, values map[string]string
// regular expressions, is stored in state for the given name and key
// combination of attributes nested under a list or set block. Use this
// TestCheckFunc in preference over non-set variants to simplify testing code
// and ensure compatibility with indicies, which can easily change with schema
// and ensure compatibility with indices, which can easily change with schema
// changes. State value checking is only recommended for testing Computed
// attributes and attribute defaults.
//
Expand Down Expand Up @@ -171,7 +171,7 @@ func TestMatchTypeSetElemNestedAttrs(name, attr string, values map[string]*regex
// TestCheckTypeSetElemAttr ensures a specific value is stored in state for the
// given name and key combination under a list or set. Use this TestCheckFunc
// in preference over non-set variants to simplify testing code and ensure
// compatibility with indicies, which can easily change with schema changes.
// compatibility with indices, which can easily change with schema changes.
// State value checking is only recommended for testing Computed attributes and
// attribute defaults.
//
Expand Down
8 changes: 4 additions & 4 deletions helper/resource/testing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func TestFilterSweepers(t *testing.T) {
Filter: "none",
},
{
Name: "with nested depenencies and top level filter",
Name: "with nested dependencies and top level filter",
Sweepers: map[string]*Sweeper{
"not_matching": {
Name: "not_matching",
Expand All @@ -362,7 +362,7 @@ func TestFilterSweepers(t *testing.T) {
Filter: "matching_level1",
},
{
Name: "with nested depenencies and middle level filter",
Name: "with nested dependencies and middle level filter",
Sweepers: map[string]*Sweeper{
"not_matching": {
Name: "not_matching",
Expand All @@ -387,7 +387,7 @@ func TestFilterSweepers(t *testing.T) {
Filter: "matching_level2",
},
{
Name: "with nested depenencies and bottom level filter",
Name: "with nested dependencies and bottom level filter",
Sweepers: map[string]*Sweeper{
"not_matching": {
Name: "not_matching",
Expand Down Expand Up @@ -809,7 +809,7 @@ func TestRunSweepers(t *testing.T) {
ExpectError: true,
},
{
Name: "failing top and dep allow failues",
Name: "failing top and dep allow failures",
Sweepers: map[string]*Sweeper{
"aws_top": {
Name: "aws_top",
Expand Down
2 changes: 1 addition & 1 deletion helper/schema/core_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (m schemaMap) CoreConfigSchema() *configschema.Block {
// whose elem is a whole resource.
func (s *Schema) coreConfigSchemaAttribute() *configschema.Attribute {
// The Schema.DefaultFunc capability adds some extra weirdness here since
// it can be combined with "Required: true" to create a sitution where
// it can be combined with "Required: true" to create a situation where
// required-ness is conditional. Terraform Core doesn't share this concept,
// so we must sniff for this possibility here and conditionally turn
// off the "Required" flag if it looks like the DefaultFunc is going
Expand Down
2 changes: 1 addition & 1 deletion helper/schema/field_reader_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func (r *ConfigFieldReader) readSet(
return FieldReadResult{Value: set}, nil
}

// If the list is computed, the set is necessarilly computed
// If the list is computed, the set is necessarily computed
if raw.Computed {
return FieldReadResult{
Value: set,
Expand Down
4 changes: 2 additions & 2 deletions helper/schema/grpc_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ func (s *GRPCProviderServer) upgradeJSONState(ctx context.Context, version int,
// Remove any attributes no longer present in the schema, so that the json can
// be correctly decoded.
func (s *GRPCProviderServer) removeAttributes(ctx context.Context, v interface{}, ty cty.Type) {
// we're only concerned with finding maps that corespond to object
// we're only concerned with finding maps that correspond to object
// attributes
switch v := v.(type) {
case []interface{}:
Expand Down Expand Up @@ -1593,7 +1593,7 @@ func stripSchema(s *Schema) *Schema {
}

// Zero values and empty containers may be interchanged by the apply process.
// When there is a discrepency between src and dst value being null or empty,
// When there is a discrepancy between src and dst value being null or empty,
// prefer the src value. This takes a little more liberty with set types, since
// we can't correlate modified set values. In the case of sets, if the src set
// was wholly known we assume the value was correctly applied and copy that
Expand Down
12 changes: 6 additions & 6 deletions helper/schema/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ type Resource struct {
// This implementation is optional. If omitted, all Schema must enable
// the ForceNew field and any practitioner changes that would have
// caused and update will instead destroy and recreate the infrastructure
// compontent.
// component.
//
// The *ResourceData parameter contains the plan and state data for this
// managed resource instance. The available data in the Get* methods is the
Expand Down Expand Up @@ -321,7 +321,7 @@ type Resource struct {
// This implementation is optional. If omitted, all Schema must enable
// the ForceNew field and any practitioner changes that would have
// caused and update will instead destroy and recreate the infrastructure
// compontent.
// component.
//
// The Context parameter stores SDK information, such as loggers and
// timeout deadlines. It also is wired to receive any cancellation from
Expand Down Expand Up @@ -460,7 +460,7 @@ type Resource struct {
// This implementation is optional. If omitted, all Schema must enable
// the ForceNew field and any practitioner changes that would have
// caused and update will instead destroy and recreate the infrastructure
// compontent.
// component.
//
// The Context parameter stores SDK information, such as loggers. It also
// is wired to receive any cancellation from Terraform such as a system or
Expand Down Expand Up @@ -664,7 +664,7 @@ type ResourceBehavior struct {
// to change or break without warning. It is not protected by version compatibility guarantees.
type ProviderDeferredBehavior struct {
// When EnablePlanModification is true, the SDK will execute provider-defined logic
// during plan (CustomizeDiff, Default, DiffSupressFunc, etc.) if ConfigureProvider
// during plan (CustomizeDiff, Default, DiffSuppressFunc, etc.) if ConfigureProvider
// returns a deferred response. The SDK will then automatically return a deferred response
// along with the modified plan.
EnablePlanModification bool
Expand Down Expand Up @@ -748,7 +748,7 @@ type StateUpgrader struct {

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

// Instance Diff shoould have the timeout info, need to copy it over to the
// Instance Diff should have the timeout info, need to copy it over to the
// ResourceData meta
rt := ResourceTimeout{}
if _, ok := d.Meta[TimeoutKey]; ok {
Expand Down
2 changes: 1 addition & 1 deletion helper/schema/resource_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (d *ResourceData) GetChange(key string) (interface{}, interface{}) {
// GetOk returns the data for the given key and whether or not the key
// has been set to a non-zero value at some point.
//
// The first result will not necessarilly be nil if the value doesn't exist.
// The first result will not necessarily be nil if the value doesn't exist.
// The second result should be checked to determine this information.
func (d *ResourceData) GetOk(key string) (interface{}, bool) {
r := d.getRaw(key, getSourceSet)
Expand Down
2 changes: 1 addition & 1 deletion helper/schema/resource_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ func TestResourceDataGetOk(t *testing.T) {
Ok: false,
},

// Further illustrates and clarifiies the GetOk semantics from #933, and
// Further illustrates and clarifies the GetOk semantics from #933, and
// highlights the limitation that zero-value config is currently
// indistinguishable from unset config.
{
Expand Down
2 changes: 1 addition & 1 deletion helper/schema/resource_timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (t *ResourceTimeout) ConfigDecode(s *Resource, c *terraform.ResourceConfig)
timeout = t.Default
}

// If the resource has not delcared this in the definition, then error
// If the resource has not declared this in the definition, then error
// with an unsupported message
if timeout == nil {
return unsupportedTimeoutKeyError(timeKey)
Expand Down
18 changes: 9 additions & 9 deletions helper/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ type Schema struct {
//
// The key benefit of activating this flag is that the result of Read or
// ReadContext will be cleaned of normalization-only changes in the same
// way as the planning result would normaly be, which therefore prevents
// way as the planning result would normally be, which therefore prevents
// churn for downstream expressions deriving from this attribute and
// prevents incorrect "Values changed outside of Terraform" messages
// when the remote API returns values which have the same meaning as the
Expand Down Expand Up @@ -1099,7 +1099,7 @@ func isValidFieldName(name string) bool {
}

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

unsupressedDiff := new(terraform.InstanceDiff)
unsupressedDiff.Attributes = make(map[string]*terraform.ResourceAttrDiff)
unsuppressedDiff := new(terraform.InstanceDiff)
unsuppressedDiff.Attributes = make(map[string]*terraform.ResourceAttrDiff)

var err error
switch schema.Type {
case TypeBool, TypeInt, TypeFloat, TypeString:
err = m.diffString(k, schema, unsupressedDiff, d, all)
err = m.diffString(k, schema, unsuppressedDiff, d, all)
case TypeList:
err = m.diffList(ctx, k, schema, unsupressedDiff, d, all)
err = m.diffList(ctx, k, schema, unsuppressedDiff, d, all)
case TypeMap:
err = m.diffMap(k, schema, unsupressedDiff, d, all)
err = m.diffMap(k, schema, unsuppressedDiff, d, all)
case TypeSet:
err = m.diffSet(ctx, k, schema, unsupressedDiff, d, all)
err = m.diffSet(ctx, k, schema, unsuppressedDiff, d, all)
default:
err = fmt.Errorf("%s: unknown type %#v", k, schema.Type)
}

for attrK, attrV := range unsupressedDiff.Attributes {
for attrK, attrV := range unsuppressedDiff.Attributes {
switch rd := d.(type) {
case *ResourceData:
if schema.DiffSuppressFunc != nil && attrV != nil &&
Expand Down
2 changes: 1 addition & 1 deletion helper/schema/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (s *Set) add(item interface{}, computed bool) string {

func (s *Set) hash(item interface{}) string {
code := s.F(item)
// Always return a nonnegative hashcode.
// Always return a non-negative hashcode.
if code < 0 {
code = -code
}
Expand Down
2 changes: 1 addition & 1 deletion helper/schema/shims_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func testApplyDiff(t *testing.T,
}
}

// Resource.Meta will be hanlded separately, so it's OK that we lose the
// Resource.Meta will be handled separately, so it's OK that we lose the
// timeout values here.
expectedState, err := StateValueFromInstanceState(expected, testSchema.Block.ImpliedType())
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion helper/structure/normalize_json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func TestNormalizeJsonString_valid(t *testing.T) {

func TestNormalizeJsonString_invalid(t *testing.T) {
// Well formatted but not valid,
// missing closing squre bracket.
// missing closing square bracket.
invalidJson := `{
"abc": {
"def": 123,
Expand Down
2 changes: 1 addition & 1 deletion helper/validation/uuid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestValidationIsUUID(t *testing.T) {
Value: "00000000-0000-123-0000-000000000000",
Error: true,
},
"ValidUuidWithOutDashs": {
"ValidUuidWithoutDashes": {
Value: "12345678123412341234123456789012",
Error: true,
},
Expand Down
Loading

0 comments on commit b454e07

Please sign in to comment.