From 505396ac32308338d9b4f0038c6745e682604700 Mon Sep 17 00:00:00 2001 From: Nathan Baulch Date: Fri, 13 Sep 2024 18:05:25 +1000 Subject: [PATCH] Fix typos --- cmd/atlas/internal/cmdapi/migrate.go | 2 +- cmd/atlas/internal/cmdext/cmdext_test.go | 4 ++-- cmd/atlas/internal/docker/docker.go | 2 +- cmd/atlas/internal/sqlparse/sqliteparse/sqliteparse.go | 2 +- internal/integration/testdata/postgres/cli-inspect-file.txt | 2 +- schemahcl/schemahcl.go | 2 +- sql/internal/specutil/convert.go | 2 +- sql/migrate/dir.go | 2 +- sql/postgres/inspect_oss.go | 2 +- sql/schema/migrate.go | 2 +- sql/sqlite/inspect.go | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cmd/atlas/internal/cmdapi/migrate.go b/cmd/atlas/internal/cmdapi/migrate.go index 41d32a3f9d6..1aa1cb6ea86 100644 --- a/cmd/atlas/internal/cmdapi/migrate.go +++ b/cmd/atlas/internal/cmdapi/migrate.go @@ -1321,7 +1321,7 @@ const applyLockValue = "atlas_migrate_execute" func checkRevisionSchemaClarity(cmd *cobra.Command, c *sqlclient.Client, revisionSchemaFlag string) error { // The "old" default behavior for the revision schema location was to store the revision table in its own schema. - // Now, the table is saved in the connected schema, if any. To keep the backwards compatability, we now require + // Now, the table is saved in the connected schema, if any. To keep the backwards compatibility, we now require // for schema bound connections to have the schema-revision flag present if there is no revision table in the schema // but the old default schema does have one. if c.URL.Schema != "" && revisionSchemaFlag == "" { diff --git a/cmd/atlas/internal/cmdext/cmdext_test.go b/cmd/atlas/internal/cmdext/cmdext_test.go index da7edbe5871..e11d56c7808 100644 --- a/cmd/atlas/internal/cmdext/cmdext_test.go +++ b/cmd/atlas/internal/cmdext/cmdext_test.go @@ -100,7 +100,7 @@ data "aws_rds_token" "token" { username = "root" endpoint = "localhost:3306" region = "us-east-1" - profile = "errorneous" + profile = "erroneous" } v = data.aws_rds_token.token @@ -112,7 +112,7 @@ v = data.aws_rds_token.token state = schemahcl.New(cmdext.SpecOptions...) ) err := state.EvalBytes([]byte(doc), &v, nil) - require.EqualError(t, err, "data.aws_rds_token.token: loading aws config: failed to get shared config profile, errorneous") + require.EqualError(t, err, "data.aws_rds_token.token: loading aws config: failed to get shared config profile, erroneous") } func TestGCPToken(t *testing.T) { diff --git a/cmd/atlas/internal/docker/docker.go b/cmd/atlas/internal/docker/docker.go index a8070d58451..1348b4f404d 100644 --- a/cmd/atlas/internal/docker/docker.go +++ b/cmd/atlas/internal/docker/docker.go @@ -39,7 +39,7 @@ type ( Image string // Env vars to pass to the docker container. Env []string - // Internal Port to expose anc connect to. + // Internal Port to expose and connect to. Port string // Database name to create and connect on init. Database string diff --git a/cmd/atlas/internal/sqlparse/sqliteparse/sqliteparse.go b/cmd/atlas/internal/sqlparse/sqliteparse/sqliteparse.go index da16613e467..6359081fd8d 100644 --- a/cmd/atlas/internal/sqlparse/sqliteparse/sqliteparse.go +++ b/cmd/atlas/internal/sqlparse/sqliteparse/sqliteparse.go @@ -222,7 +222,7 @@ func (p *FileParser) FixChange(_ migrate.Driver, s string, changes schema.Change } if r, ok := stmt.RenameColumn(); ok { if len(changes) != 1 { - return nil, fmt.Errorf("unexpected number fo changes: %d", len(changes)) + return nil, fmt.Errorf("unexpected number of changes: %d", len(changes)) } modify, ok := changes[0].(*schema.ModifyTable) if !ok { diff --git a/internal/integration/testdata/postgres/cli-inspect-file.txt b/internal/integration/testdata/postgres/cli-inspect-file.txt index 4ea4b6b8685..15a6feac4a4 100644 --- a/internal/integration/testdata/postgres/cli-inspect-file.txt +++ b/internal/integration/testdata/postgres/cli-inspect-file.txt @@ -1,4 +1,4 @@ -# inspect without dev-db will failed +# inspect without dev-db will fail ! atlas schema inspect -u file://a.sql stderr 'Error: --dev-url cannot be empty' diff --git a/schemahcl/schemahcl.go b/schemahcl/schemahcl.go index 7612322d789..04b0eba1c6f 100644 --- a/schemahcl/schemahcl.go +++ b/schemahcl/schemahcl.go @@ -598,7 +598,7 @@ func (s *State) mayScopeContext(ctx *hcl.EvalContext, scope []string) *hcl.EvalC return ctx } nctx := ctx.NewChild() - // Use the same variables/functions maps to avoid copying per scope, but return a + // Use the same variables/functions maps to avoid copying per scope, but return // another child context to prevent writes from different blocks to the same maps. nctx.Variables, nctx.Functions = vars, funcs return nctx.NewChild() diff --git a/sql/internal/specutil/convert.go b/sql/internal/specutil/convert.go index f4613114166..1f8e63b06c9 100644 --- a/sql/internal/specutil/convert.go +++ b/sql/internal/specutil/convert.go @@ -832,7 +832,7 @@ func fromDependsOn[T interface{ AddDeps(...schema.Object) T }](loc string, t T, }) } if err != nil { - return fmt.Errorf("find %s refrence for %s.depends_on[%d]: %w", loc, p[0].T, i, err) + return fmt.Errorf("find %s reference for %s.depends_on[%d]: %w", loc, p[0].T, i, err) } t.AddDeps(o) } diff --git a/sql/migrate/dir.go b/sql/migrate/dir.go index 38b04540663..b6bf5c8d60a 100644 --- a/sql/migrate/dir.go +++ b/sql/migrate/dir.go @@ -727,7 +727,7 @@ type ( // Error implements the error interface. func (err *ChecksumError) Error() string { return ErrChecksumMismatch.Error() } -// Is exists for backwards compatability reasons. +// Is exists for backwards compatibility reasons. func (err *ChecksumError) Is(target error) bool { return errors.Is(ErrChecksumMismatch, target) } diff --git a/sql/postgres/inspect_oss.go b/sql/postgres/inspect_oss.go index ed7834c19e8..4c6ca11e200 100644 --- a/sql/postgres/inspect_oss.go +++ b/sql/postgres/inspect_oss.go @@ -686,7 +686,7 @@ func (i *inspect) partitions(s *schema.Schema) error { for i := range idxs { switch idx, err := strconv.Atoi(idxs[i]); { case err != nil: - return fmt.Errorf("postgres: faild parsing partition key index %q", idxs[i]) + return fmt.Errorf("postgres: failed parsing partition key index %q", idxs[i]) // An expression. case idx == 0: j := sqlx.ExprLastIndex(d.exprs) diff --git a/sql/schema/migrate.go b/sql/schema/migrate.go index 658294cdd7a..0306f809e48 100644 --- a/sql/schema/migrate.go +++ b/sql/schema/migrate.go @@ -390,7 +390,7 @@ const ( // List of diff modes. const ( - DiffModeUnset DiffMode = iota // Default, backwards compatability. + DiffModeUnset DiffMode = iota // Default, backwards compatibility. DiffModeNotNormalized // Diff objects are considered to be in not normalized state. DiffModeNormalized // Diff objects are considered to be in normalized state. ) diff --git a/sql/sqlite/inspect.go b/sql/sqlite/inspect.go index 2b56d7bbb85..e372bf66f25 100644 --- a/sql/sqlite/inspect.go +++ b/sql/sqlite/inspect.go @@ -551,7 +551,7 @@ func defaultExpr(x string) schema.Expr { } } -// blob literals are hex strings preceded by 'x' (or 'X). +// blob literals are hex strings preceded by 'x' (or 'X'). func isBlob(s string) bool { if (strings.HasPrefix(s, "x'") || strings.HasPrefix(s, "X'")) && strings.HasSuffix(s, "'") { _, err := strconv.ParseUint(s[2:len(s)-1], 16, 64)