From 9b687a923edf473b207944babd050a8543f469a2 Mon Sep 17 00:00:00 2001 From: luzpaz Date: Fri, 8 Oct 2021 12:35:56 -0400 Subject: [PATCH] Fix various typos (#416) Fix various typos found via `codespell -q 3 -S vendor -L pullrequest,pullrequests` --- cli/internal/util.go | 6 ++--- docs/docs/10-intro.md | 2 +- .../20-vcs/60-bitbucket_server.md | 2 +- docs/docs/90-faq.md | 2 +- pipeline/frontend/yaml/compiler/option.go | 6 ++--- pipeline/frontend/yaml/matrix/matrix.go | 2 +- pipeline/rpc/peer.go | 2 +- pipeline/tracer.go | 2 +- server/logging/log.go | 10 ++++----- server/pubsub/topic_test.go | 6 ++--- server/remote/gitlab/convert.go | 2 +- server/remote/gitlab/gitlab.go | 4 ++-- server/remote/gitlab/gitlab_test.go | 2 +- server/remote/gitlab/testdata/hooks.go | 22 +++++++++---------- server/router/middleware/session/agent.go | 2 +- server/shared/procStatus.go | 2 +- server/store/datastore/config_test.go | 2 +- server/store/datastore/files_test.go | 2 +- server/store/datastore/procs_test.go | 4 ++-- server/store/datastore/registry_test.go | 2 +- server/store/datastore/secret_test.go | 2 +- server/store/datastore/sender_test.go | 2 +- server/store/datastore/store.go | 2 +- server/swagger/files/swagger.yml | 4 ++-- shared/token/token.go | 2 +- web/src/shared/components/breadcrumb.js | 2 +- web/src/shared/utils/feed.js | 2 +- woodpecker-go/README.md | 4 ++-- 28 files changed, 52 insertions(+), 52 deletions(-) diff --git a/cli/internal/util.go b/cli/internal/util.go index 7865ddb81..fe16902f0 100644 --- a/cli/internal/util.go +++ b/cli/internal/util.go @@ -42,14 +42,14 @@ func NewClient(c *cli.Context) (woodpecker.Client, error) { } config := new(oauth2.Config) - auther := config.Client( + client := config.Client( oauth2.NoContext, &oauth2.Token{ AccessToken: token, }, ) - trans, _ := auther.Transport.(*oauth2.Transport) + trans, _ := client.Transport.(*oauth2.Transport) if len(socks) != 0 && !socksoff { dialer, err := proxy.SOCKS5("tcp", socks, nil, proxy.Direct) @@ -68,7 +68,7 @@ func NewClient(c *cli.Context) (woodpecker.Client, error) { } } - return woodpecker.NewClient(server, auther), nil + return woodpecker.NewClient(server, client), nil } // ParseRepo parses the repository owner and name from a string. diff --git a/docs/docs/10-intro.md b/docs/docs/10-intro.md index 692040d24..459eb9961 100644 --- a/docs/docs/10-intro.md +++ b/docs/docs/10-intro.md @@ -55,7 +55,7 @@ pipeline: - cat myfile ``` -## Plugins are straighforward +## Plugins are straightforward - If you copy the same shell script from project to project - Pack it into a plugin instead diff --git a/docs/docs/30-administration/20-vcs/60-bitbucket_server.md b/docs/docs/30-administration/20-vcs/60-bitbucket_server.md index 84db21933..b1d7d0159 100644 --- a/docs/docs/30-administration/20-vcs/60-bitbucket_server.md +++ b/docs/docs/30-administration/20-vcs/60-bitbucket_server.md @@ -38,7 +38,7 @@ This stores the private RSA certificate in `key.pem`. The next command generates openssl rsa -in /etc/bitbucket/key.pem -pubout >> /etc/bitbucket/key.pub ``` -Please note that the private key file can be mounted into your Woodpecker conatiner at runtime or as an environment variable +Please note that the private key file can be mounted into your Woodpecker container at runtime or as an environment variable Private key file mounted into your Woodpecker container at runtime as a volume. diff --git a/docs/docs/90-faq.md b/docs/docs/90-faq.md index 0c6105936..2e59c344d 100644 --- a/docs/docs/90-faq.md +++ b/docs/docs/90-faq.md @@ -8,4 +8,4 @@ Apart from Woodpecker staying free and OpenSource forever, the growing community - [More features are already in the pipeline :wink:](https://github.com/woodpecker-ci/woodpecker/pulls) ... ## Why is Woodpecker a fork of Drone version 0.8? -The Drone CI license was changed after the 0.8 release from Apache 2 to a proprietary license. Woodpecker is based on this lastest freely available version. +The Drone CI license was changed after the 0.8 release from Apache 2 to a proprietary license. Woodpecker is based on this latest freely available version. diff --git a/pipeline/frontend/yaml/compiler/option.go b/pipeline/frontend/yaml/compiler/option.go index 1e7706b2a..119fb78f3 100644 --- a/pipeline/frontend/yaml/compiler/option.go +++ b/pipeline/frontend/yaml/compiler/option.go @@ -23,7 +23,7 @@ func WithOption(option Option, b bool) Option { } } -// WithVolumes configutes the compiler with default volumes that +// WithVolumes configures the compiler with default volumes that // are mounted to each container in the pipeline. func WithVolumes(volumes ...string) Option { return func(compiler *Compiler) { @@ -49,7 +49,7 @@ func WithSecret(secrets ...Secret) Option { } } -// WithMetadata configutes the compiler with the repostiory, build +// WithMetadata configures the compiler with the repository, build // and system metadata. The metadata is used to remove steps from // the compiled pipeline configuration that should be skipped. The // metadata is also added to each container as environment variables. @@ -189,7 +189,7 @@ func WithProxy() Option { ) } -// WithNetworks configures the compiler with additionnal networks +// WithNetworks configures the compiler with additional networks // to be connected to build containers func WithNetworks(networks ...string) Option { return func(compiler *Compiler) { diff --git a/pipeline/frontend/yaml/matrix/matrix.go b/pipeline/frontend/yaml/matrix/matrix.go index 8ca8569b8..6c353f091 100644 --- a/pipeline/frontend/yaml/matrix/matrix.go +++ b/pipeline/frontend/yaml/matrix/matrix.go @@ -68,7 +68,7 @@ func calc(matrix Matrix) []Axis { // structure to hold the transformed result set var axisList []Axis - // for each axis calculate the uniqe set of values that should be used. + // for each axis calculate the unique set of values that should be used. for p := 0; p < perm; p++ { axis := map[string]string{} decr := perm diff --git a/pipeline/rpc/peer.go b/pipeline/rpc/peer.go index 874a8f504..afbd9299e 100644 --- a/pipeline/rpc/peer.go +++ b/pipeline/rpc/peer.go @@ -6,7 +6,7 @@ import ( "github.com/woodpecker-ci/woodpecker/pipeline/backend" ) -// ErrCancelled signals the pipeine is cancelled. +// ErrCancelled signals the pipeline is cancelled. // var ErrCancelled = errors.New("cancelled") type ( diff --git a/pipeline/tracer.go b/pipeline/tracer.go index 14e3a196f..75c1b0800 100644 --- a/pipeline/tracer.go +++ b/pipeline/tracer.go @@ -19,7 +19,7 @@ func (f TraceFunc) Trace(state *State) error { return f(state) } -// DefaultTracer provides a tracer that updates the CI_ enviornment +// DefaultTracer provides a tracer that updates the CI_ environment // variables to include the correct timestamp and status. // TODO(bradrydzewski) find either a new home or better name for this. var DefaultTracer = TraceFunc(func(state *State) error { diff --git a/server/logging/log.go b/server/logging/log.go index 1bb53a2e4..5ef0cf064 100644 --- a/server/logging/log.go +++ b/server/logging/log.go @@ -28,7 +28,7 @@ type stream struct { sync.Mutex path string - hist []*Entry + list []*Entry subs map[*subscriber]struct{} done chan struct{} wait sync.WaitGroup @@ -69,7 +69,7 @@ func (l *log) Write(c context.Context, path string, entry *Entry) error { return ErrNotFound } s.Lock() - s.hist = append(s.hist, entry) + s.list = append(s.list, entry) for sub := range s.subs { go sub.handler(entry) } @@ -89,8 +89,8 @@ func (l *log) Tail(c context.Context, path string, handler Handler) error { handler: handler, } s.Lock() - if len(s.hist) != 0 { - sub.handler(s.hist...) + if len(s.list) != 0 { + sub.handler(s.list...) } s.subs[sub] = struct{}{} s.Unlock() @@ -132,7 +132,7 @@ func (l *log) Snapshot(c context.Context, path string, w io.Writer) error { return ErrNotFound } s.Lock() - for _, entry := range s.hist { + for _, entry := range s.list { w.Write(entry.Data) w.Write(cr) } diff --git a/server/pubsub/topic_test.go b/server/pubsub/topic_test.go index b50624773..53785839a 100644 --- a/server/pubsub/topic_test.go +++ b/server/pubsub/topic_test.go @@ -10,7 +10,7 @@ func TestTopicSubscribe(t *testing.T) { top := newTopic("foo") top.subscribe(sub) if _, ok := top.subs[sub]; !ok { - t.Errorf("Exepect subscription registered with topic on subscribe") + t.Errorf("Expect subscription registered with topic on subscribe") } } @@ -19,11 +19,11 @@ func TestTopicUnsubscribe(t *testing.T) { top := newTopic("foo") top.subscribe(sub) if _, ok := top.subs[sub]; !ok { - t.Errorf("Exepect subscription registered with topic on subscribe") + t.Errorf("Expect subscription registered with topic on subscribe") } top.unsubscribe(sub) if _, ok := top.subs[sub]; ok { - t.Errorf("Exepect subscription de-registered with topic on unsubscribe") + t.Errorf("Expect subscription de-registered with topic on unsubscribe") } } diff --git a/server/remote/gitlab/convert.go b/server/remote/gitlab/convert.go index fabbb01c4..17f09877b 100644 --- a/server/remote/gitlab/convert.go +++ b/server/remote/gitlab/convert.go @@ -72,7 +72,7 @@ func convertMergeRequestHock(hook *gitlab.MergeEvent, req *http.Request) (*model } else if target == nil { return nil, nil, fmt.Errorf("target key expected in merge request hook") } else if source == nil { - return nil, nil, fmt.Errorf("source key exptected in merge request hook") + return nil, nil, fmt.Errorf("source key expected in merge request hook") } if target.PathWithNamespace != "" { diff --git a/server/remote/gitlab/gitlab.go b/server/remote/gitlab/gitlab.go index 189e135fc..77dc8dc9d 100644 --- a/server/remote/gitlab/gitlab.go +++ b/server/remote/gitlab/gitlab.go @@ -175,7 +175,7 @@ func (g *Gitlab) Teams(ctx context.Context, user *model.User) ([]*model.Team, er batch, _, err := client.Groups.ListGroups(&gitlab.ListGroupsOptions{ ListOptions: gitlab.ListOptions{Page: i, PerPage: perPage}, AllAvailable: gitlab.Bool(false), - MinAccessLevel: gitlab.AccessLevel(gitlab.DeveloperPermissions), // TODO: check whats best here + MinAccessLevel: gitlab.AccessLevel(gitlab.DeveloperPermissions), // TODO: check what's best here }, gitlab.WithContext(ctx)) if err != nil { return nil, err @@ -232,7 +232,7 @@ func (g *Gitlab) Repos(ctx context.Context, user *model.User) ([]*model.Repo, er repos := make([]*model.Repo, 0, perPage) opts := &gitlab.ListProjectsOptions{ ListOptions: gitlab.ListOptions{PerPage: perPage}, - MinAccessLevel: gitlab.AccessLevel(gitlab.DeveloperPermissions), // TODO: check whats best here + MinAccessLevel: gitlab.AccessLevel(gitlab.DeveloperPermissions), // TODO: check what's best here } if g.HideArchives { opts.Archived = gitlab.Bool(false) diff --git a/server/remote/gitlab/gitlab_test.go b/server/remote/gitlab/gitlab_test.go index cb386ef2b..9ec441ae0 100644 --- a/server/remote/gitlab/gitlab_test.go +++ b/server/remote/gitlab/gitlab_test.go @@ -155,7 +155,7 @@ func Test_Gitlab(t *testing.T) { // Test hook method g.Describe("Hook", func() { g.Describe("Push hook", func() { - g.It("Should parse actual push hoook", func() { + g.It("Should parse actual push hook", func() { req, _ := http.NewRequest( testdata.ServiceHookMethod, testdata.ServiceHookURL.String(), diff --git a/server/remote/gitlab/testdata/hooks.go b/server/remote/gitlab/testdata/hooks.go index cd81dce85..f691abfdc 100644 --- a/server/remote/gitlab/testdata/hooks.go +++ b/server/remote/gitlab/testdata/hooks.go @@ -41,7 +41,7 @@ var ServiceHookPushBody = []byte(`{ "checkout_sha": "16862e368d8ab812e48833b741dad720d6e2cb7f", "message": null, "user_id": 2, - "user_name": "te st", + "user_name": "the test", "user_username": "test", "user_email": "", "user_avatar": "https://www.gravatar.com/avatar/dd46a756faad4727fb679320751f6dea?s=80&d=identicon", @@ -54,7 +54,7 @@ var ServiceHookPushBody = []byte(`{ "avatar_url": "http://example.com/uploads/project/avatar/555/Outh-20-Logo.jpg", "git_ssh_url": "git@10.40.8.5:test/woodpecker.git", "git_http_url": "http://10.40.8.5:3200/test/woodpecker.git", - "namespace": "te st", + "namespace": "the test", "visibility_level": 20, "path_with_namespace": "test/woodpecker", "default_branch": "develop", @@ -72,7 +72,7 @@ var ServiceHookPushBody = []byte(`{ "timestamp": "2021-09-27T04:46:14+00:00", "url": "http://10.40.8.5:3200/test/woodpecker/-/commit/16862e368d8ab812e48833b741dad720d6e2cb7f", "author": { - "name": "te st", + "name": "the test", "email": "test@test.test" }, "added": [ @@ -110,7 +110,7 @@ var ServiceHookTagPushBody = []byte(`{ "checkout_sha": "16862e368d8ab812e48833b741dad720d6e2cb7f", "message": "hi", "user_id": 2, - "user_name": "te st", + "user_name": "the test", "user_username": "test", "user_email": "", "user_avatar": "https://www.gravatar.com/avatar/dd46a756faad4727fb679320751f6dea?s=80&d=identicon", @@ -123,7 +123,7 @@ var ServiceHookTagPushBody = []byte(`{ "avatar_url": "http://example.com/uploads/project/avatar/555/Outh-20-Logo.jpg", "git_ssh_url": "git@10.40.8.5:test/woodpecker.git", "git_http_url": "http://10.40.8.5:3200/test/woodpecker.git", - "namespace": "te st", + "namespace": "the test", "visibility_level": 20, "path_with_namespace": "test/woodpecker", "default_branch": "develop", @@ -141,7 +141,7 @@ var ServiceHookTagPushBody = []byte(`{ "timestamp": "2021-09-27T04:46:14+00:00", "url": "http://10.40.8.5:3200/test/woodpecker/-/commit/16862e368d8ab812e48833b741dad720d6e2cb7f", "author": { - "name": "te st", + "name": "the test", "email": "test@test.test" }, "added": [ @@ -175,7 +175,7 @@ var ServiceHookMergeRequestBody = []byte(`{ "event_type": "merge_request", "user": { "id": 2, - "name": "te st", + "name": "the test", "username": "test", "avatar_url": "https://www.gravatar.com/avatar/dd46a756faad4727fb679320751f6dea?s=80&d=identicon", "email": "test@test.test" @@ -188,7 +188,7 @@ var ServiceHookMergeRequestBody = []byte(`{ "avatar_url": null, "git_ssh_url": "git@10.40.8.5:test/woodpecker.git", "git_http_url": "http://10.40.8.5:3200/test/woodpecker.git", - "namespace": "te st", + "namespace": "the test", "visibility_level": 20, "path_with_namespace": "test/woodpecker", "default_branch": "master", @@ -235,7 +235,7 @@ var ServiceHookMergeRequestBody = []byte(`{ "avatar_url": "http://example.com/uploads/project/avatar/555/Outh-20-Logo.jpg", "git_ssh_url": "git@10.40.8.5:test/woodpecker.git", "git_http_url": "http://10.40.8.5:3200/test/woodpecker.git", - "namespace": "te st", + "namespace": "the test", "visibility_level": 20, "path_with_namespace": "test/woodpecker", "default_branch": "develop", @@ -253,7 +253,7 @@ var ServiceHookMergeRequestBody = []byte(`{ "avatar_url": "http://example.com/uploads/project/avatar/555/Outh-20-Logo.jpg", "git_ssh_url": "git@10.40.8.5:test/woodpecker.git", "git_http_url": "http://10.40.8.5:3200/test/woodpecker.git", - "namespace": "te st", + "namespace": "the test", "visibility_level": 20, "path_with_namespace": "test/woodpecker", "default_branch": "develop", @@ -270,7 +270,7 @@ var ServiceHookMergeRequestBody = []byte(`{ "timestamp": "2021-09-27T05:01:20+00:00", "url": "http://10.40.8.5:3200/test/woodpecker/-/commit/0ab96a10266b95b4b533dcfd98738015fbe70889", "author": { - "name": "te st", + "name": "the test", "email": "test@test.test" } }, diff --git a/server/router/middleware/session/agent.go b/server/router/middleware/session/agent.go index 2c639fc1f..da9a814d5 100644 --- a/server/router/middleware/session/agent.go +++ b/server/router/middleware/session/agent.go @@ -19,7 +19,7 @@ import ( "github.com/woodpecker-ci/woodpecker/shared/token" ) -// AuthorizeAgent authorizes requsts from build agents to access the queue. +// AuthorizeAgent authorizes requests from build agents to access the queue. func AuthorizeAgent(c *gin.Context) { secret := c.MustGet("agent").(string) if secret == "" { diff --git a/server/shared/procStatus.go b/server/shared/procStatus.go index aac73ae2f..b9eee8192 100644 --- a/server/shared/procStatus.go +++ b/server/shared/procStatus.go @@ -57,7 +57,7 @@ func UpdateProcToStatusStarted(store UpdateProcStore, proc model.Proc, state rpc func UpdateProcToStatusSkipped(store UpdateProcStore, proc model.Proc, stopped int64) (*model.Proc, error) { proc.State = model.StatusSkipped if proc.Started != 0 { - proc.State = model.StatusSuccess // for deamons that are killed + proc.State = model.StatusSuccess // for daemons that are killed proc.Stopped = stopped } return &proc, store.ProcUpdate(&proc) diff --git a/server/store/datastore/config_test.go b/server/store/datastore/config_test.go index af1f8ec4a..984148d53 100644 --- a/server/store/datastore/config_test.go +++ b/server/store/datastore/config_test.go @@ -239,6 +239,6 @@ func TestConfigIndexes(t *testing.T) { Hash: hash, }, ); err == nil { - t.Errorf("Unexpected error: dupliate sha") + t.Errorf("Unexpected error: duplicate sha") } } diff --git a/server/store/datastore/files_test.go b/server/store/datastore/files_test.go index 9b3bab3e5..3af8c41d1 100644 --- a/server/store/datastore/files_test.go +++ b/server/store/datastore/files_test.go @@ -149,7 +149,7 @@ func TestFileIndexes(t *testing.T) { }, bytes.NewBufferString("hello world"), ); err == nil { - t.Errorf("Unexpected error: dupliate pid") + t.Errorf("Unexpected error: duplicate pid") } } diff --git a/server/store/datastore/procs_test.go b/server/store/datastore/procs_test.go index e7080d6e7..17147c4b7 100644 --- a/server/store/datastore/procs_test.go +++ b/server/store/datastore/procs_test.go @@ -230,7 +230,7 @@ func TestProcIndexes(t *testing.T) { Name: "clone", }, }); err == nil { - t.Errorf("Unexpected error: dupliate pid") + t.Errorf("Unexpected error: duplicate pid") } // // fail due to duplicate process name @@ -244,7 +244,7 @@ func TestProcIndexes(t *testing.T) { // Name: "build", // }, // }); err == nil { - // t.Errorf("Unexpected error: dupliate name") + // t.Errorf("Unexpected error: duplicate name") // } } diff --git a/server/store/datastore/registry_test.go b/server/store/datastore/registry_test.go index 12a4588ca..220bab820 100644 --- a/server/store/datastore/registry_test.go +++ b/server/store/datastore/registry_test.go @@ -151,6 +151,6 @@ func TestRegistryIndexes(t *testing.T) { Username: "baz", Password: "qux", }); err == nil { - t.Errorf("Unexpected error: dupliate address") + t.Errorf("Unexpected error: duplicate address") } } diff --git a/server/store/datastore/secret_test.go b/server/store/datastore/secret_test.go index 9389b55ab..86cad79d6 100644 --- a/server/store/datastore/secret_test.go +++ b/server/store/datastore/secret_test.go @@ -176,6 +176,6 @@ func TestSecretIndexes(t *testing.T) { Name: "foo", Value: "baz", }); err == nil { - t.Errorf("Unexpected error: dupliate name") + t.Errorf("Unexpected error: duplicate name") } } diff --git a/server/store/datastore/sender_test.go b/server/store/datastore/sender_test.go index 7e96db60c..b5b4519d5 100644 --- a/server/store/datastore/sender_test.go +++ b/server/store/datastore/sender_test.go @@ -140,6 +140,6 @@ func TestSenderIndexes(t *testing.T) { Allow: true, Block: false, }); err == nil { - t.Errorf("Unexpected error: dupliate login") + t.Errorf("Unexpected error: duplicate login") } } diff --git a/server/store/datastore/store.go b/server/store/datastore/store.go index ec9e9f6ec..87c3e8bac 100644 --- a/server/store/datastore/store.go +++ b/server/store/datastore/store.go @@ -126,7 +126,7 @@ func pingDatabase(db *sql.DB) (err error) { return } -// helper function to setup the databsae by performing +// helper function to setup the database by performing // automated database migration steps. func setupDatabase(driver string, db *sql.DB) error { return ddl.Migrate(driver, db) diff --git a/server/swagger/files/swagger.yml b/server/swagger/files/swagger.yml index 08c01adc0..7005b7a93 100644 --- a/server/swagger/files/swagger.yml +++ b/server/swagger/files/swagger.yml @@ -181,7 +181,7 @@ paths: # - # Repos Param Encryption Enpoint + # Repos Param Encryption Endpoint # TODO: properly add the input output schema /repos/{owner}/{name}/encrypt: @@ -600,7 +600,7 @@ definitions: description: The url for the avatar image. type: string admin: - description: Whether the account has administrative priviledges. + description: Whether the account has administrative privileges. type: boolean active: description: Whether the account is currently active. diff --git a/shared/token/token.go b/shared/token/token.go index 6383a3916..d0245b9c5 100644 --- a/shared/token/token.go +++ b/shared/token/token.go @@ -143,7 +143,7 @@ func keyFunc(token *Token, fn SecretFunc) jwt.Keyfunc { token.Kind, _ = kindv.(string) // extract the token value and cast to - // exepected type. + // expected type. textv, ok := claims["text"] if !ok { return nil, jwt.ValidationError{} diff --git a/web/src/shared/components/breadcrumb.js b/web/src/shared/components/breadcrumb.js index 736b18d30..b358a0206 100644 --- a/web/src/shared/components/breadcrumb.js +++ b/web/src/shared/components/breadcrumb.js @@ -2,7 +2,7 @@ import React, { Component } from "react"; import { ExpandIcon, BackIcon } from "shared/components/icons/index"; import style from "./breadcrumb.less"; -// breadcrumb separater icon. +// breadcrumb separator icon. export const SEPARATOR = ; // breadcrumb back button. diff --git a/web/src/shared/utils/feed.js b/web/src/shared/utils/feed.js index ee4007ce7..d51dda753 100644 --- a/web/src/shared/utils/feed.js +++ b/web/src/shared/utils/feed.js @@ -42,7 +42,7 @@ export function fetchFeedOnce(tree, client) { } /** - * Subscribes to the server-side event feed and synchonizes + * Subscribes to the server-side event feed and synchronizes * event data with the state tree. * * @param {Object} tree - The drone state tree. diff --git a/woodpecker-go/README.md b/woodpecker-go/README.md index b092ff934..ccb1ef3c2 100644 --- a/woodpecker-go/README.md +++ b/woodpecker-go/README.md @@ -14,7 +14,7 @@ const ( func main() { // create an http client with oauth authentication. config := new(oauth2.Config) - auther := config.Client( + authenticator := config.Client( oauth2.NoContext, &oauth2.Token{ AccessToken: token, @@ -22,7 +22,7 @@ func main() { ) // create the woodpecker client with authenticator - client := woodpecker.NewClient(host, auther) + client := woodpecker.NewClient(host, authenticator) // gets the current user user, err := client.Self()