diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfff80ef9..ebb35dad5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,18 @@ on: - 'doc/**' jobs: + typos-check: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v3 + - name: Check spelling with custom config file + uses: crate-ci/typos@v1.13.10 + with: + config: .github/workflows/typos.toml + + lint: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/typos.toml b/.github/workflows/typos.toml new file mode 100644 index 000000000..c25ebe164 --- /dev/null +++ b/.github/workflows/typos.toml @@ -0,0 +1,12 @@ +# See https://github.com/crate-ci/typos/blob/master/docs/reference.md to configure typos +[default.extend-words] +ba = "ba" +importent = "importent" +mis = "mis" +nd = "nd" +ons = "ons" +ser = "ser" +ue = "ue" +[files] +extend-exclude = [] + diff --git a/dialect/gremlin/config.go b/dialect/gremlin/config.go index a578173e3..a5bbc0a5d 100644 --- a/dialect/gremlin/config.go +++ b/dialect/gremlin/config.go @@ -25,7 +25,7 @@ type ( httpClient *http.Client } - // Endpoint wraps a url to add flag unmarshaling. + // Endpoint wraps a url to add flag unmarshalling. Endpoint struct { *url.URL } diff --git a/dialect/gremlin/graph/edge.go b/dialect/gremlin/graph/edge.go index b2343609a..02f4b475a 100644 --- a/dialect/gremlin/graph/edge.go +++ b/dialect/gremlin/graph/edge.go @@ -56,7 +56,7 @@ func (e Edge) MarshalGraphson() ([]byte, error) { func (e *Edge) UnmarshalGraphson(data []byte) error { var edge edge if err := graphson.Unmarshal(data, &edge); err != nil { - return fmt.Errorf("unmarshaling edge: %w", err) + return fmt.Errorf("unmarshalling edge: %w", err) } *e = NewEdge( diff --git a/dialect/gremlin/request_test.go b/dialect/gremlin/request_test.go index e3b929cf6..6622224b8 100644 --- a/dialect/gremlin/request_test.go +++ b/dialect/gremlin/request_test.go @@ -119,7 +119,7 @@ func TestCredentialsBadEncodingMarshaling(t *testing.T) { text: []byte("Kg=="), }, { - name: "NoSeperator", + name: "NoSeparator", text: []byte("AHVzZXI="), }, } diff --git a/dialect/sql/builder.go b/dialect/sql/builder.go index 92779d2d0..9e1452f79 100644 --- a/dialect/sql/builder.go +++ b/dialect/sql/builder.go @@ -140,7 +140,7 @@ func (t *TableBuilder) Column(c *ColumnBuilder) *TableBuilder { return t } -// Columns appends the a list of columns to the builder. +// Columns appends a list of columns to the builder. func (t *TableBuilder) Columns(columns ...*ColumnBuilder) *TableBuilder { t.columns = make([]Querier, 0, len(columns)) for i := range columns { @@ -195,7 +195,7 @@ func (t *TableBuilder) Collate(s string) *TableBuilder { return t } -// Options appends additional options to to the statement (MySQL only). +// Options appends additional options to the statement (MySQL only). func (t *TableBuilder) Options(s string) *TableBuilder { t.options = s return t @@ -484,7 +484,7 @@ type ReferenceBuilder struct { columns []string // referenced columns. } -// Reference create a reference builder for the reference_option clause. +// Reference creates a reference builder for the reference_option clause. // // Reference().Table("groups").Columns("id") func Reference() *ReferenceBuilder { return &ReferenceBuilder{} } @@ -2095,7 +2095,7 @@ func (s *SelectTable) Columns(columns ...string) []string { } // Unquote makes the table name to be formatted as raw string (unquoted). -// It is useful whe you don't want to query tables under the current database. +// It is useful when you don't want to query tables under the current database. // For example: "INFORMATION_SCHEMA.TABLE_CONSTRAINTS" in MySQL. func (s *SelectTable) Unquote() *SelectTable { s.quote = false @@ -2254,7 +2254,7 @@ func (s *Selector) SelectedColumns() []string { return columns } -// UnqualifiedColumns returns the an unqualified version of the +// UnqualifiedColumns returns an unqualified version of the // selected columns in the Selector. e.g. "t1"."c" => "c". func (s *Selector) UnqualifiedColumns() []string { columns := make([]string, 0, len(s.selection)) @@ -3130,7 +3130,7 @@ type WindowBuilder struct { } // RowNumber returns a new window clause with the ROW_NUMBER() as a function. -// Using this function will assign a each row a number, from 1 to N, in the +// Using this function will assign each row a number, from 1 to N, in the // order defined by the ORDER BY clause in the window spec. func RowNumber() *WindowBuilder { return Window(func(b *Builder) { @@ -3493,7 +3493,7 @@ type ( } // ParamFormatter wraps the FormatPram function. ParamFormatter interface { - // The FormatParam function lets users to define + // The FormatParam function lets users define // custom placeholder formatting for their types. // For example, formatting the default placeholder // from '?' to 'ST_GeomFromWKB(?)' for MySQL dialect. diff --git a/dialect/sql/schema/postgres.go b/dialect/sql/schema/postgres.go index 2b31ac484..b778b2e5f 100644 --- a/dialect/sql/schema/postgres.go +++ b/dialect/sql/schema/postgres.go @@ -817,7 +817,7 @@ func (d *Postgres) atIndex(idx1 *Index, t2 *schema.Table, idx2 *schema.Index) er if v, ok := opc[c1.Name]; ok { var op postgres.IndexOpClass if err := op.UnmarshalText([]byte(v)); err != nil { - return fmt.Errorf("unmarshaling operator-class %q for column %q: %v", v, c1.Name, err) + return fmt.Errorf("unmarshalling operator-class %q for column %q: %v", v, c1.Name, err) } part.Attrs = append(part.Attrs, &op) } diff --git a/dialect/sql/sqlgraph/graph.go b/dialect/sql/sqlgraph/graph.go index 76fb2c4a4..23b957539 100644 --- a/dialect/sql/sqlgraph/graph.go +++ b/dialect/sql/sqlgraph/graph.go @@ -1313,7 +1313,7 @@ func (c *batchCreator) nodes(ctx context.Context, drv dialect.Driver) error { // If the ID value was provided to one of the nodes, it should be // provided to all others because this affects the way we calculate // their values in MySQL and SQLite dialects. - return fmt.Errorf("incosistent id values for batch insert") + return fmt.Errorf("inconsistent id values for batch insert") } // Assign NULL values for empty placeholders. values[i][column] = nil diff --git a/doc/md/tutorial-grpc-edges.md b/doc/md/tutorial-grpc-edges.md index 4574e2bb1..b05bf3f95 100644 --- a/doc/md/tutorial-grpc-edges.md +++ b/doc/md/tutorial-grpc-edges.md @@ -93,13 +93,13 @@ Observe the following changes: * A new message, `Category` was created. This message has a field named `admin` corresponding to the `admin` edge on the `Category` schema. It is a non-repeated field because we set the edge to be `.Unique()`. It's field number is `3`, corresponding to the `entproto.Field` annotation on the edge definition. -* A new field `administered` was added to the `User` message definition. It is a `repeated` field, correspending to the +* A new field `administered` was added to the `User` message definition. It is a `repeated` field, corresponding to the fact that we did not mark the edge as `Unique` in this direction. It's field number is `5`, corresponding to the `entproto.Field` annotation on the edge. ### Creating Entities with their Edges -Let's demonstrate how to create an entity with it's edges by writing a test: +Let's demonstrate how to create an entity with its edges by writing a test: ```go package main diff --git a/doc/md/versioned-migrations.mdx b/doc/md/versioned-migrations.mdx index 01a22d941..a8e555fb5 100644 --- a/doc/md/versioned-migrations.mdx +++ b/doc/md/versioned-migrations.mdx @@ -678,7 +678,7 @@ Counter Initialization** header) and re-calculated on startup by looking at the you happen to have a table with no rows yet, the autoincrement starting value is set to 0 for every table without any entries. With the online migration feature this wasn't an issue, because the migration engine looked at the `ent_types` tables and made sure to update the counter, if it wasn't set correctly. However, with versioned migration, this is no -longer the case. In oder to ensure, that everything is set up correctly after a server restart, make sure to call +longer the case. In order to ensure, that everything is set up correctly after a server restart, make sure to call the `VerifyTableRange` method on the Atlas struct: ```go @@ -862,7 +862,7 @@ generation, use the `schema.DisableChecksum()` option. In addition to the usual `.sql` migration files the migration directory will contain the `atlas.sum` file. Every time you let Ent generate a new migration file, this file is updated for you. However, every manual change made to the -mitration directory will render the migration directory and the `atlas.sum` file out-of-sync. With the Atlas CLI you can +migration directory will render the migration directory and the `atlas.sum` file out-of-sync. With the Atlas CLI you can both check if the file and migration directory are in-sync, and fix it if not: ```shell diff --git a/doc/website/blog/2021-03-12-announcing-edge-field-support.md b/doc/website/blog/2021-03-12-announcing-edge-field-support.md index f625f69e8..25714ec0d 100644 --- a/doc/website/blog/2021-03-12-announcing-edge-field-support.md +++ b/doc/website/blog/2021-03-12-announcing-edge-field-support.md @@ -116,7 +116,7 @@ func (Pet) Fields() []ent.Field { return []ent.Field{ field.String("name"). NotEmpty(), - field.Int("owner_id"), // <-- explictly add the field we want to contain the FK + field.Int("owner_id"), // <-- explicitly add the field we want to contain the FK } } diff --git a/doc/website/blog/2022-01-04-serverless-graphql-using-aws.md b/doc/website/blog/2022-01-04-serverless-graphql-using-aws.md index 9652c6198..1de7b842e 100644 --- a/doc/website/blog/2022-01-04-serverless-graphql-using-aws.md +++ b/doc/website/blog/2022-01-04-serverless-graphql-using-aws.md @@ -29,7 +29,7 @@ The landing page of the AppSync service should render you a "Create API" button,
- Getting started from sratch with AWS AppSync
+Getting started from scratch with AWS AppSync
- AWS Lambda environemnt variables settings of Ent function.
+AWS Lambda environment variables settings of Ent function.