Skip to content

Commit efd0948

Browse files
all: fix typos in codebase
1 parent 805a569 commit efd0948

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

cmd/action/fmt.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var (
2222
Use: "fmt [path ...]",
2323
Short: "Formats Atlas HCL files",
2424
Long: "`atlas schema fmt`" + ` formats all ".hcl" files under the given path using
25-
cannonical HCL layout style as defined by the github.com/hashicorp/hcl/v2/hclwrite package.
25+
canonical HCL layout style as defined by the github.com/hashicorp/hcl/v2/hclwrite package.
2626
Unless stated otherwise, the fmt command will use the current directory.
2727
2828
After running, the command will print the names of the files it has formatted. If all

doc/md/cli.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ atlas schema fmt [path ...]
131131

132132
#### Details
133133
`atlas schema fmt` formats all ".hcl" files under the given path using
134-
cannonical HCL layout style as defined by the github.com/hashicorp/hcl/v2/hclwrite package.
134+
canonical HCL layout style as defined by the github.com/hashicorp/hcl/v2/hclwrite package.
135135
Unless stated otherwise, the fmt command will use the current directory.
136136

137137
After running, the command will print the names of the files it has formatted. If all

sql/mysql/diff.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ var noChange struct{ schema.Change }
265265
func (d *diff) typeChanged(from, to *schema.Column) (bool, error) {
266266
fromT, toT := from.Type.Type, to.Type.Type
267267
if fromT == nil || toT == nil {
268-
return false, fmt.Errorf("mysql: missing type infromation for column %q", from.Name)
268+
return false, fmt.Errorf("mysql: missing type information for column %q", from.Name)
269269
}
270270
if reflect.TypeOf(fromT) != reflect.TypeOf(toT) {
271271
return true, nil

sql/mysql/inspect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ var reAutoinc = regexp.MustCompile(`(?i)\s+AUTO_INCREMENT\s*=\s*(\d+)\s+`)
481481
func (i *inspect) autoinc(t *schema.Table) (*AutoIncrement, error) {
482482
var c CreateStmt
483483
if !sqlx.Has(t.Attrs, &c) {
484-
return nil, fmt.Errorf("missing CREATE TABLE statment in attribuets for %q", t.Name)
484+
return nil, fmt.Errorf("missing CREATE TABLE statement in attribuets for %q", t.Name)
485485
}
486486
matches := reAutoinc.FindStringSubmatch(c.S)
487487
if len(matches) != 2 {

sql/postgres/diff.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func (*diff) ReferenceChanged(from, to schema.ReferenceOption) bool {
146146
func (d *diff) typeChanged(from, to *schema.Column) (bool, error) {
147147
fromT, toT := from.Type.Type, to.Type.Type
148148
if fromT == nil || toT == nil {
149-
return false, fmt.Errorf("postgres: missing type infromation for column %q", from.Name)
149+
return false, fmt.Errorf("postgres: missing type information for column %q", from.Name)
150150
}
151151
// Skip checking SERIAL types as they are not real types in the database, but more
152152
// like a convenience way for creating integers types with AUTO_INCREMENT property.

sql/postgres/migrate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ func (s *state) alterType(from, to *schema.EnumType) error {
461461
func (s *state) enumExists(ctx context.Context, name string) (bool, error) {
462462
rows, err := s.QueryContext(ctx, "SELECT * FROM pg_type WHERE typname = $1 AND typtype = 'e'", name)
463463
if err != nil {
464-
return false, fmt.Errorf("check index existance: %w", err)
464+
return false, fmt.Errorf("check index existence: %w", err)
465465
}
466466
defer rows.Close()
467467
return rows.Next(), rows.Err()

sql/sqlite/diff.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (d *diff) ColumnChange(from, to *schema.Column) (schema.ChangeKind, error)
6262
func (d *diff) typeChanged(from, to *schema.Column) (bool, error) {
6363
fromT, toT := from.Type.Type, to.Type.Type
6464
if fromT == nil || toT == nil {
65-
return false, fmt.Errorf("sqlite: missing type infromation for column %q", from.Name)
65+
return false, fmt.Errorf("sqlite: missing type information for column %q", from.Name)
6666
}
6767
// Types are mismatched if they do not have the same "type affinity".
6868
return reflect.TypeOf(fromT) != reflect.TypeOf(toT), nil

sql/sqlite/inspect.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ var reAutoinc = regexp.MustCompile("(?i)(?:[(,]\\s*)[\"`]?(\\w+)[\"`]?\\s+INTEGE
493493
func autoinc(t *schema.Table) error {
494494
var c CreateStmt
495495
if !sqlx.Has(t.Attrs, &c) {
496-
return fmt.Errorf("missing CREATE statment for table: %q", t.Name)
496+
return fmt.Errorf("missing CREATE statement for table: %q", t.Name)
497497
}
498498
if t.PrimaryKey == nil || len(t.PrimaryKey.Parts) != 1 || t.PrimaryKey.Parts[0].C == nil {
499499
return nil
@@ -528,7 +528,7 @@ var (
528528
func fillConstName(t *schema.Table) error {
529529
var c CreateStmt
530530
if !sqlx.Has(t.Attrs, &c) {
531-
return fmt.Errorf("missing CREATE statment for table: %q", t.Name)
531+
return fmt.Errorf("missing CREATE statement for table: %q", t.Name)
532532
}
533533
// Loop over table constraints.
534534
for _, m := range reFKT.FindAllStringSubmatch(c.S, -1) {
@@ -593,7 +593,7 @@ func matchFK(fk *schema.ForeignKey, columns []string, refTable string, refColumn
593593
func fillChecks(t *schema.Table) error {
594594
var c CreateStmt
595595
if !sqlx.Has(t.Attrs, &c) {
596-
return fmt.Errorf("missing CREATE statment for table: %q", t.Name)
596+
return fmt.Errorf("missing CREATE statement for table: %q", t.Name)
597597
}
598598
for i := 0; i < len(c.S); {
599599
idx := reCheck.FindStringSubmatchIndex(c.S[i:])

0 commit comments

Comments
 (0)