From 94b882fb95fb8b5c2d2b411cf7bd6ac1525710da Mon Sep 17 00:00:00 2001 From: Lukas Date: Sat, 27 Jan 2024 21:15:10 +0100 Subject: [PATCH] Add spellcheck config (#3018) Part of #738 ``` pnpx cspell lint --gitignore '{**,.*}/{*,.*}' ``` --------- Co-authored-by: Anbraten Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de> --- .cspell.json | 113 ++++++++++++++++++ .ecrc | 2 +- .gitpod.yml | 4 +- .markdownlint.yaml | 2 +- .pre-commit-config.yaml | 1 + .vscode/settings.json | 4 +- .woodpecker/test.yaml | 8 ++ .yamllint.yaml | 2 +- README.md | 2 +- docker-compose.gitpod.yaml | 1 + docs/docs/30-administration/90-prometheus.md | 4 +- .../30-administration/90-prometheus.md | 4 +- .../30-administration/90-prometheus.md | 4 +- .../30-administration/90-prometheus.md | 4 +- .../30-administration/90-prometheus.md | 4 +- .../30-administration/90-prometheus.md | 4 +- pipeline/backend/local/command.go | 2 + pipeline/frontend/yaml/linter/linter.go | 6 +- pipeline/frontend/yaml/parse.go | 20 ++-- pipeline/frontend/yaml/types/secret.go | 6 +- pipeline/frontend/yaml/types/workflow.go | 6 +- server/api/pipeline.go | 4 +- server/forge/gitlab/testdata/hooks.go | 2 +- server/model/const.go | 2 +- server/plugins/utils/http.go | 6 +- server/queue/fifo_test.go | 10 +- server/queue/persistent.go | 4 +- .../datastore/migration/migration_test.go | 4 +- .../{testfiles => test-files}/.gitignore | 0 .../{testfiles => test-files}/sqlite.db | Bin server/store/datastore/users_test.go | 24 ++-- version/version.go | 2 + web/.eslintrc.js | 1 + web/LICENSE | 2 +- web/src/assets/locales/cs.json | 4 +- web/src/assets/locales/de.json | 4 +- web/src/assets/locales/en.json | 4 +- web/src/assets/locales/es.json | 4 +- web/src/assets/locales/fr.json | 4 +- web/src/assets/locales/id.json | 4 +- web/src/assets/locales/lv.json | 4 +- web/src/assets/locales/nl.json | 2 +- web/src/assets/locales/pl.json | 4 +- web/src/assets/locales/ru.json | 4 +- web/src/assets/locales/uk.json | 4 +- web/src/assets/locales/zh-Hans.json | 4 +- .../admin/settings/AdminAgentsTab.vue | 2 +- .../admin/settings/queue/AdminQueueStats.vue | 10 +- web/src/components/atomic/Icon.vue | 3 +- .../repo/settings/RegistriesTab.vue | 2 +- web/src/compositions/useDate.ts | 2 +- web/src/compositions/usePipeline.ts | 2 +- web/src/compositions/useVersion.ts | 6 +- web/src/style/prism.css | 1 + web/src/utils/emoji.ts | 1 + web/windi.config.ts | 1 + woodpecker-go/README.md | 2 +- woodpecker-go/woodpecker/client.go | 8 +- 58 files changed, 241 insertions(+), 109 deletions(-) create mode 100644 .cspell.json rename server/store/datastore/migration/{testfiles => test-files}/.gitignore (100%) rename server/store/datastore/migration/{testfiles => test-files}/sqlite.db (100%) diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 000000000..7e65ae9d0 --- /dev/null +++ b/.cspell.json @@ -0,0 +1,113 @@ +{ + "version": "0.2", + "language": "en", + "words": [ + "ciphertext", + "evenodd", + "gitea", + "gonic", + "Netrc", + "prismjs", + "rawurl", + "Refspec", + "securecookie", + "sess", + "techknowlogick", + "vueuse", + "windicss", + "xorm", + "xormigrate", + "zerolog", + "Msgf", + "varchar", + "autoincr", + "stretchr", + "bradrydzewski", + "octocat", + "brightbox", + "anbraten", + "Codeberg", + "Fediverse", + "Weblate", + "Hetzner", + "windi", + "intlify", + "unplugin", + "Pinia", + "woodpeckerci", + "tinycolor", + "favicons", + "Laszlo", + "Fogas", + "Georgiana", + "Ionescu", + "typecheck", + "HTTPFS", + "Println", + "ppid", + "xlog", + "Debugf", + "Warnf", + "Infof", + "Wrapf", + "urfave", + "creativecommons", + "compatiblelicenses", + "sublicensable", + "waivable", + "kyvg", + "iconify", + "Upsert", + "Rydzewski", + "fsnotify", + "tink", + "desaturate", + "golangci", + "Kaniko", + "Reviewdog", + "DATASOURCE", + "httpsig", + "envsubst", + "TARGETOS", + "TARGETARCH", + "GOARCH", + "Curr", + "doublestar", + "multierr", + "markdownlint", + "buildx", + "HEALTHCHECK", + "devx", + "gomod", + "laszlocph" + ], + "ignorePaths": [ + "**/node_modules/**/*", + "pnpm-lock.yaml", + ".gitignore", + ".git/**/*", + ".cspell.json", + ".golangci.yaml", + ".vscode/extensions.json", + "web/src/assets/locales/**/*", + "web/components.d.ts", + "server/store/datastore/migration/**/*", + "go.mod", + "go.sum", + "*.excalidraw", + "*.svg", + "Makefile", + // TODO: remove the following + "CHANGELOG.md", + ".woodpecker/", + "agent/", + "cli/", + "cmd/", + "docker/", + "docs/", + "pipeline/", + "shared/", + "server/" + ], + "enableFiletypes": ["dockercompose"] +} diff --git a/.ecrc b/.ecrc index 1e2188c4e..21b8d92b8 100644 --- a/.ecrc +++ b/.ecrc @@ -6,7 +6,7 @@ "fixtures", "LICENSE", "node_modules", - "server/store/datastore/migration/testfiles/sqlite.db", + "server/store/datastore/migration/test-files/sqlite.db", "server/store/datastore/feed.go", "cmd/server/docs/docs.go", "_test.go", diff --git a/.gitpod.yml b/.gitpod.yml index e0bc90840..a4d940a3c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -63,7 +63,7 @@ tasks: git checkout -b main git remote add origin http://woodpecker:${GITEA_TOKEN}@localhost:3000/woodpecker/woodpecker-test.git git add . - git commit -m ":tada: Initial commit" + git commit -m "Initial commit" git push -u origin main cd ../.. gp sync-done gitea @@ -105,6 +105,7 @@ ports: vscode: extensions: + # cSpell:disable - 'golang.go' - 'EditorConfig.EditorConfig' - 'dbaeumer.vscode-eslint' @@ -114,3 +115,4 @@ vscode: - 'redhat.vscode-yaml' - 'davidanson.vscode-markdownlint' - 'streetsidesoftware.code-spell-checker' + # cSpell:enable diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 7e3dc6a57..2d62a22af 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -139,5 +139,5 @@ MD046: # MD048/code-fence-style - Code fence style MD048: - # Code fence syle + # Code fence style style: 'backtick' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 63debc5bb..ef389123e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,4 @@ +# cSpell:ignore checkmake hadolint autofix autoupdate repos: - repo: meta hooks: diff --git a/.vscode/settings.json b/.vscode/settings.json index 40853bbdb..fb61c272a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,5 @@ "go.lintTool": "golangci-lint", "go.lintFlags": ["--fast"], "eslint.workingDirectories": ["./web"], - "prettier.configPath": "./web/.prettierrc.js", - "prettier.ignorePath": "./web/.prettierignore", - "cSpell.words": ["Curr", "doublestar", "ERRORLEVEL", "multierr"] + "prettier.ignorePath": "./web/.prettierignore" } diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml index 20038cdf9..dd87ad9e1 100644 --- a/.woodpecker/test.yaml +++ b/.woodpecker/test.yaml @@ -91,6 +91,14 @@ steps: - event: push branch: renovate/* + spellcheck: + image: docker.io/node:21-alpine + group: test + commands: + - corepack enable + - pnpx cspell lint --no-progress --gitignore '{**,.*}/{*,.*}' + when: *when + test: depends_on: - vendor diff --git a/.yamllint.yaml b/.yamllint.yaml index f5190b172..37a80852c 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -4,7 +4,7 @@ ignore-from-file: - docs/.gitignore - docs/plugins/woodpecker-plugins/.gitignore - .gitignore - - server/store/datastore/migration/testfiles/.gitignore + - server/store/datastore/migration/test-files/.gitignore - web/.gitignore rules: diff --git a/README.md b/README.md index 6a5528e9b..39f75d2a6 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ License: Apache-2.0 - openssf best practices + OpenSSF best practices pre-commit.ci diff --git a/docker-compose.gitpod.yaml b/docker-compose.gitpod.yaml index 8c9f1a460..55a591090 100644 --- a/docker-compose.gitpod.yaml +++ b/docker-compose.gitpod.yaml @@ -1,3 +1,4 @@ +# cSpell:ignore pgdata pgsql localtime version: '3' services: diff --git a/docs/docs/30-administration/90-prometheus.md b/docs/docs/30-administration/90-prometheus.md index 567f270d3..2264f3b09 100644 --- a/docs/docs/30-administration/90-prometheus.md +++ b/docs/docs/30-administration/90-prometheus.md @@ -8,7 +8,7 @@ global: scrape_configs: - job_name: 'woodpecker' - bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + bearer_token: dummyToken... static_configs: - targets: ['woodpecker.domain.com'] @@ -24,7 +24,7 @@ An administrator will need to generate a user API token and configure in the Pro scrape_configs: - job_name: 'woodpecker' -+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... ++ bearer_token: dummyToken... static_configs: - targets: ['woodpecker.domain.com'] diff --git a/docs/versioned_docs/version-0.15/30-administration/90-prometheus.md b/docs/versioned_docs/version-0.15/30-administration/90-prometheus.md index 75d1aa1f4..e95ef5e59 100644 --- a/docs/versioned_docs/version-0.15/30-administration/90-prometheus.md +++ b/docs/versioned_docs/version-0.15/30-administration/90-prometheus.md @@ -8,7 +8,7 @@ global: scrape_configs: - job_name: 'woodpecker' - bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + bearer_token: dummyToken... static_configs: - targets: ['woodpecker.domain.com'] @@ -24,7 +24,7 @@ global: scrape_configs: - job_name: 'woodpecker' -+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... ++ bearer_token: dummyToken... static_configs: - targets: ['woodpecker.domain.com'] diff --git a/docs/versioned_docs/version-1.0/30-administration/90-prometheus.md b/docs/versioned_docs/version-1.0/30-administration/90-prometheus.md index 78e009351..20c0a5096 100644 --- a/docs/versioned_docs/version-1.0/30-administration/90-prometheus.md +++ b/docs/versioned_docs/version-1.0/30-administration/90-prometheus.md @@ -8,7 +8,7 @@ global: scrape_configs: - job_name: 'woodpecker' - bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + bearer_token: dummyToken... static_configs: - targets: ['woodpecker.domain.com'] @@ -24,7 +24,7 @@ global: scrape_configs: - job_name: 'woodpecker' -+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... ++ bearer_token: dummyToken... static_configs: - targets: ['woodpecker.domain.com'] diff --git a/docs/versioned_docs/version-2.0/30-administration/90-prometheus.md b/docs/versioned_docs/version-2.0/30-administration/90-prometheus.md index eb7a66b61..9be5770b0 100644 --- a/docs/versioned_docs/version-2.0/30-administration/90-prometheus.md +++ b/docs/versioned_docs/version-2.0/30-administration/90-prometheus.md @@ -8,7 +8,7 @@ global: scrape_configs: - job_name: 'woodpecker' - bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + bearer_token: dummyToken... static_configs: - targets: ['woodpecker.domain.com'] @@ -24,7 +24,7 @@ global: scrape_configs: - job_name: 'woodpecker' -+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... ++ bearer_token: dummyToken... static_configs: - targets: ['woodpecker.domain.com'] diff --git a/docs/versioned_docs/version-2.1/30-administration/90-prometheus.md b/docs/versioned_docs/version-2.1/30-administration/90-prometheus.md index 2b3ba3d8a..d3cfc3b37 100644 --- a/docs/versioned_docs/version-2.1/30-administration/90-prometheus.md +++ b/docs/versioned_docs/version-2.1/30-administration/90-prometheus.md @@ -8,7 +8,7 @@ global: scrape_configs: - job_name: 'woodpecker' - bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + bearer_token: dummyToken... static_configs: - targets: ['woodpecker.domain.com'] @@ -24,7 +24,7 @@ global: scrape_configs: - job_name: 'woodpecker' -+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... ++ bearer_token: dummyToken... static_configs: - targets: ['woodpecker.domain.com'] diff --git a/docs/versioned_docs/version-2.2/30-administration/90-prometheus.md b/docs/versioned_docs/version-2.2/30-administration/90-prometheus.md index 567f270d3..2264f3b09 100644 --- a/docs/versioned_docs/version-2.2/30-administration/90-prometheus.md +++ b/docs/versioned_docs/version-2.2/30-administration/90-prometheus.md @@ -8,7 +8,7 @@ global: scrape_configs: - job_name: 'woodpecker' - bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + bearer_token: dummyToken... static_configs: - targets: ['woodpecker.domain.com'] @@ -24,7 +24,7 @@ An administrator will need to generate a user API token and configure in the Pro scrape_configs: - job_name: 'woodpecker' -+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... ++ bearer_token: dummyToken... static_configs: - targets: ['woodpecker.domain.com'] diff --git a/pipeline/backend/local/command.go b/pipeline/backend/local/command.go index 2f6715ca2..52187ff91 100644 --- a/pipeline/backend/local/command.go +++ b/pipeline/backend/local/command.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// cSpell:ignore ERRORLEVEL + package local import ( diff --git a/pipeline/frontend/yaml/linter/linter.go b/pipeline/frontend/yaml/linter/linter.go index 6da6f5fcd..78a5a0711 100644 --- a/pipeline/frontend/yaml/linter/linter.go +++ b/pipeline/frontend/yaml/linter/linter.go @@ -209,7 +209,7 @@ func (l *Linter) lintDeprecations(config *WorkflowConfig) (err error) { return err } - if parsed.PipelineDontUseIt.ContainerList != nil { + if parsed.PipelineDoNotUseIt.ContainerList != nil { err = multierr.Append(err, &errors.PipelineError{ Type: errors.PipelineErrorTypeDeprecation, Message: "Please use 'steps:' instead of deprecated 'pipeline:' list", @@ -222,7 +222,7 @@ func (l *Linter) lintDeprecations(config *WorkflowConfig) (err error) { }) } - if parsed.PlatformDontUseIt != "" { + if parsed.PlatformDoNotUseIt != "" { err = multierr.Append(err, &errors.PipelineError{ Type: errors.PipelineErrorTypeDeprecation, Message: "Please use labels instead of deprecated 'platform' filters", @@ -235,7 +235,7 @@ func (l *Linter) lintDeprecations(config *WorkflowConfig) (err error) { }) } - if parsed.BranchesDontUseIt != nil { + if parsed.BranchesDoNotUseIt != nil { err = multierr.Append(err, &errors.PipelineError{ Type: errors.PipelineErrorTypeDeprecation, Message: "Please use global when instead of deprecated 'branches' filter", diff --git a/pipeline/frontend/yaml/parse.go b/pipeline/frontend/yaml/parse.go index 2aaf6d940..52b868642 100644 --- a/pipeline/frontend/yaml/parse.go +++ b/pipeline/frontend/yaml/parse.go @@ -33,34 +33,34 @@ func ParseBytes(b []byte) (*types.Workflow, error) { } // support deprecated branch filter - if out.BranchesDontUseIt != nil { + if out.BranchesDoNotUseIt != nil { switch { case out.When.Constraints == nil: - out.When.Constraints = []constraint.Constraint{{Branch: *out.BranchesDontUseIt}} + out.When.Constraints = []constraint.Constraint{{Branch: *out.BranchesDoNotUseIt}} case len(out.When.Constraints) == 1 && out.When.Constraints[0].Branch.IsEmpty(): - out.When.Constraints[0].Branch = *out.BranchesDontUseIt + out.When.Constraints[0].Branch = *out.BranchesDoNotUseIt default: return nil, fmt.Errorf("could not apply deprecated branches filter into global when filter") } - out.BranchesDontUseIt = nil + out.BranchesDoNotUseIt = nil } // support deprecated pipeline keyword - if len(out.PipelineDontUseIt.ContainerList) != 0 && len(out.Steps.ContainerList) == 0 { - out.Steps.ContainerList = out.PipelineDontUseIt.ContainerList + if len(out.PipelineDoNotUseIt.ContainerList) != 0 && len(out.Steps.ContainerList) == 0 { + out.Steps.ContainerList = out.PipelineDoNotUseIt.ContainerList } // support deprecated platform filter - if out.PlatformDontUseIt != "" { + if out.PlatformDoNotUseIt != "" { if out.Labels == nil { out.Labels = make(base.SliceOrMap) } if _, set := out.Labels["platform"]; !set { - out.Labels["platform"] = out.PlatformDontUseIt + out.Labels["platform"] = out.PlatformDoNotUseIt } - out.PlatformDontUseIt = "" + out.PlatformDoNotUseIt = "" } - out.PipelineDontUseIt.ContainerList = nil + out.PipelineDoNotUseIt.ContainerList = nil return out, nil } diff --git a/pipeline/frontend/yaml/types/secret.go b/pipeline/frontend/yaml/types/secret.go index 7e982a8e5..9958b41aa 100644 --- a/pipeline/frontend/yaml/types/secret.go +++ b/pipeline/frontend/yaml/types/secret.go @@ -33,10 +33,10 @@ type ( func (s *Secrets) UnmarshalYAML(value *yaml.Node) error { y, _ := yaml.Marshal(value) - var strslice []string - err := yaml.Unmarshal(y, &strslice) + var secrets []string + err := yaml.Unmarshal(y, &secrets) if err == nil { - for _, str := range strslice { + for _, str := range secrets { s.Secrets = append(s.Secrets, &Secret{ Source: str, Target: str, diff --git a/pipeline/frontend/yaml/types/workflow.go b/pipeline/frontend/yaml/types/workflow.go index 1d7621d0d..1fe6daaff 100644 --- a/pipeline/frontend/yaml/types/workflow.go +++ b/pipeline/frontend/yaml/types/workflow.go @@ -38,11 +38,11 @@ type ( Volumes WorkflowVolumes `yaml:"volumes,omitempty"` // Deprecated - PlatformDontUseIt string `yaml:"platform,omitempty"` // TODO: remove in next major version + PlatformDoNotUseIt string `yaml:"platform,omitempty"` // TODO: remove in next major version // Deprecated - BranchesDontUseIt *constraint.List `yaml:"branches,omitempty"` // TODO: remove in next major version + BranchesDoNotUseIt *constraint.List `yaml:"branches,omitempty"` // TODO: remove in next major version // Deprecated - PipelineDontUseIt ContainerList `yaml:"pipeline,omitempty"` // TODO: remove in next major version + PipelineDoNotUseIt ContainerList `yaml:"pipeline,omitempty"` // TODO: remove in next major version } // Workspace defines a pipeline workspace. diff --git a/server/api/pipeline.go b/server/api/pipeline.go index d58249e17..00a9f843a 100644 --- a/server/api/pipeline.go +++ b/server/api/pipeline.go @@ -312,11 +312,11 @@ func PostApproval(c *gin.Context) { return } - newpipeline, err := pipeline.Approve(c, _store, pl, user, repo) + newPipeline, err := pipeline.Approve(c, _store, pl, user, repo) if err != nil { handlePipelineErr(c, err) } else { - c.JSON(http.StatusOK, newpipeline) + c.JSON(http.StatusOK, newPipeline) } } diff --git a/server/forge/gitlab/testdata/hooks.go b/server/forge/gitlab/testdata/hooks.go index 715c666a5..d736420c8 100644 --- a/server/forge/gitlab/testdata/hooks.go +++ b/server/forge/gitlab/testdata/hooks.go @@ -22,7 +22,7 @@ import ( var ( ServiceHookMethod = http.MethodPost ServiceHookURL, _ = url.Parse( - "http://10.40.8.5:8000/hook?owner=test&name=woodpecker&access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9." + + "http://10.40.8.5:8000/hook?owner=test&name=woodpecker&access_token=dummyToken." + "eyJ0ZXh0IjoidGVzdC93b29kcGVja2VyIiwidHlwZSI6Imhvb2sifQ.x3kPnmZtxZQ_9_eMhfQ1HSmj_SLhdT_Lu2hMczWjKh0") ServiceHookHeaders = http.Header{ "Content-Type": []string{"application/json"}, diff --git a/server/model/const.go b/server/model/const.go index c2084ce9d..fc0585896 100644 --- a/server/model/const.go +++ b/server/model/const.go @@ -75,7 +75,7 @@ const ( RepoPerforce SCMKind = "perforce" ) -// RepoVisibility represent to wat state a repo in woodpecker is visible to others +// RepoVisibility represent to what state a repo in woodpecker is visible to others type RepoVisibility string // @name RepoVisibility const ( diff --git a/server/plugins/utils/http.go b/server/plugins/utils/http.go index 2c1742dc7..728234012 100644 --- a/server/plugins/utils/http.go +++ b/server/plugins/utils/http.go @@ -39,9 +39,9 @@ func Send(ctx context.Context, method, path string, privateKey crypto.PrivateKey var buf io.ReadWriter if in != nil { buf = new(bytes.Buffer) - jsonerr := json.NewEncoder(buf).Encode(in) - if jsonerr != nil { - return 0, jsonerr + jsonErr := json.NewEncoder(buf).Encode(in) + if jsonErr != nil { + return 0, jsonErr } } diff --git a/server/queue/fifo_test.go b/server/queue/fifo_test.go index e9c07d131..d1d3a2ebc 100644 --- a/server/queue/fifo_test.go +++ b/server/queue/fifo_test.go @@ -154,7 +154,7 @@ func TestFifoErrors(t *testing.T) { assert.NoError(t, err) assert.Equal(t, task1, got) - assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exitcode 1, there was an error"))) + assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exit code 1, there was an error"))) got, err = q.Poll(noContext, 1, func(*model.Task) bool { return true }) assert.NoError(t, err) @@ -194,7 +194,7 @@ func TestFifoErrors2(t *testing.T) { assert.NoError(t, q.Done(noContext, got.ID, model.StatusSuccess)) } if got != task2 { - assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exitcode 1, there was an error"))) + assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exit code 1, there was an error"))) } } @@ -249,7 +249,7 @@ func TestFifoErrorsMultiThread(t *testing.T) { case !task1Processed: assert.Equal(t, task1, got) task1Processed = true - assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exitcode 1, there was an error"))) + assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exit code 1, there was an error"))) go func() { for { fmt.Printf("Worker spawned\n") @@ -306,7 +306,7 @@ func TestFifoTransitiveErrors(t *testing.T) { got, err := q.Poll(noContext, 1, func(*model.Task) bool { return true }) assert.NoError(t, err) assert.Equal(t, task1, got) - assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exitcode 1, there was an error"))) + assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exit code 1, there was an error"))) got, err = q.Poll(noContext, 1, func(*model.Task) bool { return true }) assert.NoError(t, err) @@ -419,7 +419,7 @@ func TestWaitingVsPending(t *testing.T) { info := q.Info(noContext) assert.Equal(t, 2, info.Stats.WaitingOnDeps) - assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exitcode 1, there was an error"))) + assert.NoError(t, q.Error(noContext, got.ID, fmt.Errorf("exit code 1, there was an error"))) got, err := q.Poll(noContext, 1, func(*model.Task) bool { return true }) assert.NoError(t, err) assert.EqualValues(t, task2, got) diff --git a/server/queue/persistent.go b/server/queue/persistent.go index afb21609c..df8c2cea6 100644 --- a/server/queue/persistent.go +++ b/server/queue/persistent.go @@ -77,8 +77,8 @@ func (q *persistentQueue) Poll(c context.Context, agentID int64, f FilterFn) (*m task, err := q.Queue.Poll(c, agentID, f) if task != nil { log.Debug().Msgf("pull queue item: %s: remove from backup", task.ID) - if derr := q.store.TaskDelete(task.ID); derr != nil { - log.Error().Err(derr).Msgf("pull queue item: %s: failed to remove from backup", task.ID) + if deleteErr := q.store.TaskDelete(task.ID); deleteErr != nil { + log.Error().Err(deleteErr).Msgf("pull queue item: %s: failed to remove from backup", task.ID) } else { log.Debug().Msgf("pull queue item: %s: successfully removed from backup", task.ID) } diff --git a/server/store/datastore/migration/migration_test.go b/server/store/datastore/migration/migration_test.go index 858b5f7cd..073d8c33a 100644 --- a/server/store/datastore/migration/migration_test.go +++ b/server/store/datastore/migration/migration_test.go @@ -29,7 +29,7 @@ import ( ) const ( - sqliteDB = "./testfiles/sqlite.db" + sqliteDB = "./test-files/sqlite.db" ) func testDriver() string { @@ -41,7 +41,7 @@ func testDriver() string { } func createSQLiteDB(t *testing.T) string { - tmpF, err := os.CreateTemp("./testfiles", "tmp_") + tmpF, err := os.CreateTemp("./test-files", "tmp_") if !assert.NoError(t, err) { t.FailNow() } diff --git a/server/store/datastore/migration/testfiles/.gitignore b/server/store/datastore/migration/test-files/.gitignore similarity index 100% rename from server/store/datastore/migration/testfiles/.gitignore rename to server/store/datastore/migration/test-files/.gitignore diff --git a/server/store/datastore/migration/testfiles/sqlite.db b/server/store/datastore/migration/test-files/sqlite.db similarity index 100% rename from server/store/datastore/migration/testfiles/sqlite.db rename to server/store/datastore/migration/test-files/sqlite.db diff --git a/server/store/datastore/users_test.go b/server/store/datastore/users_test.go index de6de5820..d8225bda4 100644 --- a/server/store/datastore/users_test.go +++ b/server/store/datastore/users_test.go @@ -52,11 +52,11 @@ func TestUsers(t *testing.T) { } err1 := store.CreateUser(&user) err2 := store.UpdateUser(&user) - getuser, err3 := store.GetUser(user.ID) + getUser, err3 := store.GetUser(user.ID) g.Assert(err1).IsNil() g.Assert(err2).IsNil() g.Assert(err3).IsNil() - g.Assert(user.ID).Equal(getuser.ID) + g.Assert(user.ID).Equal(getUser.ID) }) g.It("Should Add a new User", func() { @@ -80,14 +80,14 @@ func TestUsers(t *testing.T) { } g.Assert(store.CreateUser(user)).IsNil() - getuser, err := store.GetUser(user.ID) + getUser, err := store.GetUser(user.ID) g.Assert(err).IsNil() - g.Assert(user.ID).Equal(getuser.ID) - g.Assert(user.Login).Equal(getuser.Login) - g.Assert(user.Token).Equal(getuser.Token) - g.Assert(user.Secret).Equal(getuser.Secret) - g.Assert(user.Email).Equal(getuser.Email) - g.Assert(user.Avatar).Equal(getuser.Avatar) + g.Assert(user.ID).Equal(getUser.ID) + g.Assert(user.Login).Equal(getUser.Login) + g.Assert(user.Token).Equal(getUser.Token) + g.Assert(user.Secret).Equal(getUser.Secret) + g.Assert(user.Email).Equal(getUser.Email) + g.Assert(user.Avatar).Equal(getUser.Avatar) }) g.It("Should Get a User By Login", func() { @@ -97,10 +97,10 @@ func TestUsers(t *testing.T) { Token: "e42080dddf012c718e476da161d21ad5", } g.Assert(store.CreateUser(user)) - getuser, err := store.GetUserLogin(user.Login) + getUser, err := store.GetUserLogin(user.Login) g.Assert(err).IsNil() - g.Assert(user.ID).Equal(getuser.ID) - g.Assert(user.Login).Equal(getuser.Login) + g.Assert(user.ID).Equal(getUser.ID) + g.Assert(user.Login).Equal(getUser.Login) }) g.It("Should Enforce Unique User Login", func() { diff --git a/version/version.go b/version/version.go index d44d28431..a17edc156 100644 --- a/version/version.go +++ b/version/version.go @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +// cSpell:ignore ldflags + package version // Version of Woodpecker, set with ldflags, from Git tag diff --git a/web/.eslintrc.js b/web/.eslintrc.js index d5019b5bf..873fc9528 100644 --- a/web/.eslintrc.js +++ b/web/.eslintrc.js @@ -1,3 +1,4 @@ +// cSpell:ignore TSES // @ts-check /** @type {import('@typescript-eslint/experimental-utils').TSESLint.Linter.Config} */ diff --git a/web/LICENSE b/web/LICENSE index 83affadf9..b7c9478af 100644 --- a/web/LICENSE +++ b/web/LICENSE @@ -17,5 +17,5 @@ limitations under the License. --- Woodpecker icon by Georgiana Ionescu from the Noun Project -Licensed as Creative Commons CCBY +Licensed as Creative Commons CC BY https://thenounproject.com/term/woodpecker/1761314/ diff --git a/web/src/assets/locales/cs.json b/web/src/assets/locales/cs.json index 5db641ac9..1e6149c1d 100644 --- a/web/src/assets/locales/cs.json +++ b/web/src/assets/locales/cs.json @@ -385,7 +385,7 @@ "placeholder": "Adresa registru (např. docker.io)" }, "created": "Vytvořená pověření k registru", - "creds": "Pověření k registraci", + "credentials": "Pověření k registraci", "delete": "Odstranění registru", "deleted": "Odstranění pověření registru", "desc": "Lze přidat pověření k registrům a používat soukromé obrazy pro potrubí.", @@ -434,7 +434,7 @@ "min_short": "min", "not_started": "zatím nezačal", "sec_short": "sek", - "tmpl": "MMM D, RRRR, HH:mm z", + "template": "MMM D, RRRR, HH:mm z", "weeks_short": "t" }, "unknown_error": "Došlo k neznámé chybě", diff --git a/web/src/assets/locales/de.json b/web/src/assets/locales/de.json index 5ea9354aa..fed54d874 100644 --- a/web/src/assets/locales/de.json +++ b/web/src/assets/locales/de.json @@ -398,7 +398,7 @@ "placeholder": "Registry-Adresse (z. B. docker.io)" }, "created": "Registry-Zugangsdaten erstellt", - "creds": "Zugangsdaten für die Registry", + "credentials": "Zugangsdaten für die Registry", "delete": "Registry löschen", "deleted": "Registry-Zugangsdaten gelöscht", "desc": "Zugangsdaten für die Registries können hinzugefügt werden, um private Images für deine Pipelines zu verwenden.", @@ -448,7 +448,7 @@ "min_short": "min", "not_started": "noch nicht gestartet", "sec_short": "sek", - "tmpl": "DD.MM.YYYY, HH:mm z", + "template": "DD.MM.YYYY, HH:mm z", "weeks_short": "w" }, "unknown_error": "Ein unbekannter Fehler ist aufgetreten", diff --git a/web/src/assets/locales/en.json b/web/src/assets/locales/en.json index 5d87b0311..bc9110707 100644 --- a/web/src/assets/locales/en.json +++ b/web/src/assets/locales/en.json @@ -24,7 +24,7 @@ "not_found": "Server could not find requested object" }, "time": { - "tmpl": "MMM D, YYYY, HH:mm z", + "template": "MMM D, YYYY, HH:mm z", "weeks_short": "w", "days_short": "d", "hours_short": "h", @@ -153,7 +153,7 @@ }, "registries": { "registries": "Registries", - "creds": "Registry credentials", + "credentials": "Registry credentials", "desc": "Registries credentials can be added to use private images for your pipeline.", "show": "Show registries", "add": "Add registry", diff --git a/web/src/assets/locales/es.json b/web/src/assets/locales/es.json index 824fdf3a8..ede8b7899 100644 --- a/web/src/assets/locales/es.json +++ b/web/src/assets/locales/es.json @@ -395,7 +395,7 @@ "placeholder": "Dirección del registry (por ejemplo, docker.io)" }, "created": "Credenciales del registry creadas", - "creds": "Credenciales del registry", + "credentials": "Credenciales del registry", "delete": "Eliminar registry", "deleted": "Credenciales del registry eliminadas", "desc": "Se pueden añadir credenciales de registries para utilizar imágenes privadas para su pipeline.", @@ -445,7 +445,7 @@ "min_short": "min", "not_started": "no iniciado aún", "sec_short": "s", - "tmpl": "MMM D, YYYY, HH:mm z", + "template": "MMM D, YYYY, HH:mm z", "weeks_short": "w" }, "unknown_error": "Se ha producido un error desconocido", diff --git a/web/src/assets/locales/fr.json b/web/src/assets/locales/fr.json index bf2f56ffe..f5393dd59 100644 --- a/web/src/assets/locales/fr.json +++ b/web/src/assets/locales/fr.json @@ -397,7 +397,7 @@ "placeholder": "Adresse du registre (e.g. docker.io)" }, "created": "Authentifiant de connexion à un registre crée", - "creds": "Authentifiants de connexion à un registre", + "credentials": "Authentifiants de connexion à un registre", "delete": "Effacer le registre", "deleted": "Authentifiant de connexion à un registre effacé", "desc": "Des authentifiants de connexion pour les registres peuvent être ajouté pour permettre d'utiliser des images privées pour vos pipelines.", @@ -447,7 +447,7 @@ "min_short": "min", "not_started": "pas encore démarré", "sec_short": "sec", - "tmpl": "D MMM, YYYY, HH:mm z", + "template": "D MMM, YYYY, HH:mm z", "weeks_short": "s" }, "unknown_error": "Une erreur inconnue est survenue", diff --git a/web/src/assets/locales/id.json b/web/src/assets/locales/id.json index 6e40ae4b8..485ce2004 100644 --- a/web/src/assets/locales/id.json +++ b/web/src/assets/locales/id.json @@ -398,7 +398,7 @@ "placeholder": "Alamat registri (mis. docker.io)" }, "created": "Kredensial registri dibuat", - "creds": "Kredensial registri", + "credentials": "Kredensial registri", "delete": "Hapus registri", "deleted": "Kredensial registri dihapus", "desc": "Kredensial registri dapat ditambahkan untuk menggunakan citra pribadi untuk jalur pipa Anda.", @@ -448,7 +448,7 @@ "min_short": "mnt", "not_started": "belum dimulai", "sec_short": "dtk", - "tmpl": "BBB H, TTTT, JJ:mm z", + "template": "BBB H, TTTT, JJ:mm z", "weeks_short": "m" }, "unknown_error": "Terjadi sebuah kesalahan yang tidak diketahui", diff --git a/web/src/assets/locales/lv.json b/web/src/assets/locales/lv.json index ba4a3cf40..f21332615 100644 --- a/web/src/assets/locales/lv.json +++ b/web/src/assets/locales/lv.json @@ -395,7 +395,7 @@ "placeholder": "Reģistra adrese, piemēram, docker.io" }, "created": "Reģistra autorizācijas dati pievienoti", - "creds": "Reģistru autorizācijas dati", + "credentials": "Reģistru autorizācijas dati", "delete": "Dzēst reģistra autorizācijas datus", "deleted": "Reģistra autorizācijas dati dzēsti", "desc": "Reģistru autorizācijas dati var tikt izmantoti, lai izmantotu attēlos no privātiem reģistriem, konvjerdarbu soļos.", @@ -445,7 +445,7 @@ "min_short": "min.", "not_started": "nav uzsākts", "sec_short": "sek.", - "tmpl": "YYYY. [gada] D. MMMM, HH:mm z", + "template": "YYYY. [gada] D. MMMM, HH:mm z", "weeks_short": "ned." }, "unknown_error": "Notika neparedzēta kļūda", diff --git a/web/src/assets/locales/nl.json b/web/src/assets/locales/nl.json index 86f32dc3d..d98cda660 100644 --- a/web/src/assets/locales/nl.json +++ b/web/src/assets/locales/nl.json @@ -103,7 +103,7 @@ "min_short": "min", "not_started": "nog niet gestart", "sec_short": "sec", - "tmpl": "DD.MM.YYYY, HH:mm z", + "template": "DD.MM.YYYY, HH:mm z", "weeks_short": "w" }, "unknown_error": "Er is een onbekende fout opgetreden", diff --git a/web/src/assets/locales/pl.json b/web/src/assets/locales/pl.json index 6b1664641..d74fa1f26 100644 --- a/web/src/assets/locales/pl.json +++ b/web/src/assets/locales/pl.json @@ -362,7 +362,7 @@ "placeholder": "Adres rejestru (np. docker.io)" }, "created": "Utworzono dane rejestru", - "creds": "Dane rejestrów", + "credentials": "Dane rejestrów", "delete": "Usuń rejestr", "deleted": "Usunięto dane rejestru", "desc": "Możesz dodać dane rejestrów aby używać prywatnych obrazów w twoim potoku.", @@ -411,7 +411,7 @@ "min_short": "min", "not_started": "jeszcze nie rozpoczęto", "sec_short": "sek", - "tmpl": "DD.MM.YYYY, HH:mm z", + "template": "DD.MM.YYYY, HH:mm z", "weeks_short": "tyg" }, "unknown_error": "Wystąpił nieznany błąd", diff --git a/web/src/assets/locales/ru.json b/web/src/assets/locales/ru.json index f930476b1..3772c78f6 100644 --- a/web/src/assets/locales/ru.json +++ b/web/src/assets/locales/ru.json @@ -397,7 +397,7 @@ "placeholder": "Адрес реестра (например: docker.io)" }, "created": "Данные для доступа к реестру добавлены", - "creds": "Учётные данные для авторизации в реестре", + "credentials": "Учётные данные для авторизации в реестре", "delete": "Удалить реестр", "deleted": "Данные для доступа к реестру удалены", "desc": "Можно добавить учетные данные для доступа к реестру, чтобы использовать приветные образы из этого реестра в конвейере.", @@ -447,7 +447,7 @@ "min_short": "мин.", "not_started": "не запускался ни разу", "sec_short": "сек.", - "tmpl": "D MMM, YYYY, HH:mm z", + "template": "D MMM, YYYY, HH:mm z", "weeks_short": "нед." }, "unknown_error": "Произошла неизвестная ошибка", diff --git a/web/src/assets/locales/uk.json b/web/src/assets/locales/uk.json index 921f57601..6e0c6b0bf 100644 --- a/web/src/assets/locales/uk.json +++ b/web/src/assets/locales/uk.json @@ -247,7 +247,7 @@ "placeholder": "Адреса реєстру (наприклад, docker.io)" }, "created": "Створено облікові дані реєстру", - "creds": "Реквізити реєстру", + "credentials": "Реквізити реєстру", "delete": "Видалення реєстру", "deleted": "Видалено облікові дані реєстру", "desc": "Облікові дані реєстрів можуть бути додані для використання приватних зображень для вашого конвеєра.", @@ -294,7 +294,7 @@ "min_short": "хв", "not_started": "ще не розпочато", "sec_short": "сек", - "tmpl": "MMM D, РРРР, ГГ:п z", + "template": "MMM D, РРРР, ГГ:п z", "weeks_short": "т" }, "unknown_error": "Виникла невідома помилка", diff --git a/web/src/assets/locales/zh-Hans.json b/web/src/assets/locales/zh-Hans.json index 1a2c42d3c..f54e0ce8b 100644 --- a/web/src/assets/locales/zh-Hans.json +++ b/web/src/assets/locales/zh-Hans.json @@ -395,7 +395,7 @@ "placeholder": "Registry 地址(如 docker.io)" }, "created": "Registry 密码已创建", - "creds": "注册表凭据", + "credentials": "注册表凭据", "delete": "删除 registry", "deleted": "Registry 密码已删除", "desc": "可以添加 Registry 密码,以在流水线中使用私有镜像。", @@ -445,7 +445,7 @@ "min_short": "分钟", "not_started": "还没有运行过", "sec_short": "秒", - "tmpl": "YYYY 年 MM 月 D 日 HH:mm z", + "template": "YYYY 年 MM 月 D 日 HH:mm z", "weeks_short": "周" }, "unknown_error": "发生了未知错误", diff --git a/web/src/components/admin/settings/AdminAgentsTab.vue b/web/src/components/admin/settings/AdminAgentsTab.vue index d3aed08eb..20371e5f3 100644 --- a/web/src/components/admin/settings/AdminAgentsTab.vue +++ b/web/src/components/admin/settings/AdminAgentsTab.vue @@ -92,7 +92,7 @@ {{ $t('admin.settings.agents.capacity.desc') }} diff --git a/web/src/components/admin/settings/queue/AdminQueueStats.vue b/web/src/components/admin/settings/queue/AdminQueueStats.vue index 022bdc300..f56f93fb2 100644 --- a/web/src/components/admin/settings/queue/AdminQueueStats.vue +++ b/web/src/components/admin/settings/queue/AdminQueueStats.vue @@ -22,7 +22,7 @@ :key="item.key" class="h-full" :class="`${item.color}`" - :style="{ width: `${item.perc}%` }" + :style="{ width: `${item.percentage}%` }" >   @@ -82,28 +82,28 @@ const data = computed(() => { key: 'worker_count', label: t('admin.settings.queue.stats.worker_count'), value: props.stats.worker_count, - perc: total.value > 0 ? (props.stats.worker_count / total.value) * 100 : 0, + percentage: total.value > 0 ? (props.stats.worker_count / total.value) * 100 : 0, color: 'bg-wp-state-ok-100', }, { key: 'running_count', label: t('admin.settings.queue.stats.running_count'), value: props.stats.running_count, - perc: total.value > 0 ? (props.stats.running_count / total.value) * 100 : 100, + percentage: total.value > 0 ? (props.stats.running_count / total.value) * 100 : 100, color: 'bg-wp-state-info-100', }, { key: 'pending_count', label: t('admin.settings.queue.stats.pending_count'), value: props.stats.pending_count, - perc: total.value > 0 ? (props.stats.pending_count / total.value) * 100 : 0, + percentage: total.value > 0 ? (props.stats.pending_count / total.value) * 100 : 0, color: 'bg-wp-state-neutral-100', }, { key: 'waiting_on_deps_count', label: t('admin.settings.queue.stats.waiting_on_deps_count'), value: props.stats.waiting_on_deps_count, - perc: total.value > 0 ? (props.stats.waiting_on_deps_count / total.value) * 100 : 0, + percentage: total.value > 0 ? (props.stats.waiting_on_deps_count / total.value) * 100 : 0, color: 'bg-wp-state-error-100', }, ]; diff --git a/web/src/components/atomic/Icon.vue b/web/src/components/atomic/Icon.vue index 45a2bce4a..2c1ad1863 100644 --- a/web/src/components/atomic/Icon.vue +++ b/web/src/components/atomic/Icon.vue @@ -1,3 +1,4 @@ +