Skip to content

Commit

Permalink
all: fix a few minor typos spotted by gospel
Browse files Browse the repository at this point in the history
I skimmed its output and picked the lowest hanging fruit.
See https://github.com/kortschak/gospel.

Change-Id: Id2af07ad85ec40c9a248f27d7813ad1142cedc77
Signed-off-by: Daniel Martí <[email protected]>
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/536357
Unity-Result: CUEcueckoo <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Roger Peppe <[email protected]>
  • Loading branch information
mvdan committed Apr 29, 2022
1 parent db398ad commit 7881588
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion cmd/cue/cmd/get_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ func (e *extractor) reportDecl(x *ast.GenDecl) (a []cueast.Decl) {
panic(fmt.Errorf("failed to parse %v: %v", sv, err))
}

// Use orignal Go value if compatible with CUE (octal is okay)
// Use the original Go value if compatible with CUE (octal is okay)
if b, ok := cv.(*cueast.BasicLit); ok {
if b.Kind == cuetoken.INT && val != "" && val[0] != '\'' {
b.Value = val
Expand Down
2 changes: 1 addition & 1 deletion cmd/cue/cmd/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ func (h *hoister) hoist(f *ast.File) {
return false
}

// found a replacable string
// found a replaceable string
dataField := h.uniqueName(name, "_", "cue_")

f.Value = ast.NewCall(
Expand Down
2 changes: 1 addition & 1 deletion cue/ast/astutil/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (s *scope) Before(n ast.Node) (w visitor) {
// references to bind to these illegally.
// We need this kind of administration anyway to detect
// illegal name clashes, and it allows giving better error
// messages. This puts the burdon on clients of this library
// messages. This puts the burden on clients of this library
// to detect illegal usage, though.
name, err := ast.ParseIdent(a.Ident)
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion cue/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ func Concrete(concrete bool) Option {
}
}

// DisallowCycles forces validation in the precense of cycles, even if
// DisallowCycles forces validation in the presence of cycles, even if
// non-concrete values are allowed. This is implied by Concrete(true).
func DisallowCycles(disallow bool) Option {
return func(p *options) { p.disallowCycles = disallow }
Expand Down
2 changes: 1 addition & 1 deletion encoding/gocode/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const defaultPrefix = "cuegen"
//
// Generate will not generate any code for fields that have no go attribute
// and that are not exported or for which there is no namesake Go type.
// If the go attribute has the special value '-' as its name it wil be dropped
// If the go attribute has the special value '-' as its name it will be dropped
// as well. In all other cases Generate will generate Go code, even if the
// resulting code will not compile. For instance, Generate will generate Go
// code even if the user defines a Go type in the attribute that does not
Expand Down
2 changes: 1 addition & 1 deletion encoding/openapi/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ outer:

if op == cue.NoOp && len(args) == 1 {
// TODO: this is to deal with default value removal. This may change
// whe we completely separate default values from values.
// when we completely separate default values from values.
a = append(a, args...)
} else if op != splitBy {
a = append(a, v)
Expand Down
6 changes: 3 additions & 3 deletions internal/core/adt/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ func (n *nodeContext) incompleteErrors() *Bottom {
//
// In practice this should not be a problem: when disjuncts originate
// from the same disjunct, they will have the same StructInfos, and thus
// Equal is able to equate them even in the precense of optional field.
// Equal is able to equate them even in the presence of optional field.
// In general, combining any limited set of disjuncts will soon reach
// a fixed point where duplicate elements can be eliminated this way.
//
Expand Down Expand Up @@ -1757,7 +1757,7 @@ func (n *nodeContext) addStruct(
n.updateCyclicStatus(env) // to handle empty structs.

// NOTE: This is a crucial point in the code:
// Unification derferencing happens here. The child nodes are set to
// Unification dereferencing happens here. The child nodes are set to
// an Environment linked to the current node. Together with the De Bruijn
// indices, this determines to which Vertex a reference resolves.

Expand Down Expand Up @@ -1811,7 +1811,7 @@ func (n *nodeContext) addStruct(
n.addExprConjunct(MakeConjunct(childEnv, x, id))

case *OptionalField, *BulkOptionalField, *Ellipsis:
// Nothing to do here. Note that the precense of these fields do not
// Nothing to do here. Note that the presence of these fields do not
// excluded embedded scalars: only when they match actual fields
// does it exclude those.

Expand Down
2 changes: 1 addition & 1 deletion internal/core/adt/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ func (x *BoundExpr) evaluate(ctx *OpContext) Value {
// evaluation strategy that makes nodes increasingly more specific.
//
// For instance, a completely different implementation would be to allow
// the precense of a concrete value to ignore incomplete errors.
// the presence of a concrete value to ignore incomplete errors.
//
// TODO: consider an alternative approach.
switch y := v.(type) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// - no querying of the file system of any kind
// - no communication on the network
// - no information about the type of environment
// - only reproduceable random generators
// - only reproducible random generators
//
// Hermetic configurations allow for fast and advanced analysis that otherwise
// would not be possible or practical. The cue "cmd" command can be used to mix
Expand Down
4 changes: 2 additions & 2 deletions pkg/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Drop(x []cue.Value, n int) ([]cue.Value, error) {
// extensions are introduced, which may provide flatten functionality
// natively.
//
// // Flatten reports a flattend sequence of the list xs by expanding any elements
// // Flatten reports a flattened sequence of the list xs by expanding any elements
// // that are lists.
// //
// // For instance:
Expand Down Expand Up @@ -86,7 +86,7 @@ func Drop(x []cue.Value, n int) ([]cue.Value, error) {
// return flatten(xs)
// }

// FlattenN reports a flattend sequence of the list xs by expanding any elements
// FlattenN reports a flattened sequence of the list xs by expanding any elements
// depth levels deep. If depth is negative all elements are expanded.
//
// For instance:
Expand Down
2 changes: 1 addition & 1 deletion pkg/tool/cli/cli.cue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Print: {
// Example:
// task: ask: cli.Ask({
// prompt: "Are you okay?"
// repsonse: bool
// response: bool
// })
Ask: {
$id: "tool/cli.Ask"
Expand Down
2 changes: 1 addition & 1 deletion pkg/tool/cli/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/tool/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/tool/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

const msg = `// Code generated by cue get go. DO NOT EDIT.
// Package tool defines statefull operation types for cue commands.
// Package tool defines stateful operation types for cue commands.
//
// This package is only visible in cue files with a _tool.cue or _tool_test.cue
// ending.
Expand Down
2 changes: 1 addition & 1 deletion tools/flow/flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (c *Controller) Value() cue.Value {
// Terminated
//
// A Task may move from Waiting to Terminating if one of
// the tasks on which it dependends fails.
// the tasks on which it depends fails.
//
// NOTE: transitions from Running to Waiting are currently not supported. In
// the future this may be possible if a task depends on continuously running
Expand Down

0 comments on commit 7881588

Please sign in to comment.