Add spellcheck config (#3018)

Part of #738 

```
pnpx cspell lint --gitignore '{**,.*}/{*,.*}'
```

---------

Co-authored-by: Anbraten <anton@ju60.de>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Lukas 2024-01-27 21:15:10 +01:00 committed by GitHub
parent 0b5eef7d1e
commit 94b882fb95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
58 changed files with 241 additions and 109 deletions

113
.cspell.json Normal file
View file

@ -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"]
}

2
.ecrc
View file

@ -6,7 +6,7 @@
"fixtures", "fixtures",
"LICENSE", "LICENSE",
"node_modules", "node_modules",
"server/store/datastore/migration/testfiles/sqlite.db", "server/store/datastore/migration/test-files/sqlite.db",
"server/store/datastore/feed.go", "server/store/datastore/feed.go",
"cmd/server/docs/docs.go", "cmd/server/docs/docs.go",
"_test.go", "_test.go",

View file

@ -63,7 +63,7 @@ tasks:
git checkout -b main git checkout -b main
git remote add origin http://woodpecker:${GITEA_TOKEN}@localhost:3000/woodpecker/woodpecker-test.git git remote add origin http://woodpecker:${GITEA_TOKEN}@localhost:3000/woodpecker/woodpecker-test.git
git add . git add .
git commit -m ":tada: Initial commit" git commit -m "Initial commit"
git push -u origin main git push -u origin main
cd ../.. cd ../..
gp sync-done gitea gp sync-done gitea
@ -105,6 +105,7 @@ ports:
vscode: vscode:
extensions: extensions:
# cSpell:disable
- 'golang.go' - 'golang.go'
- 'EditorConfig.EditorConfig' - 'EditorConfig.EditorConfig'
- 'dbaeumer.vscode-eslint' - 'dbaeumer.vscode-eslint'
@ -114,3 +115,4 @@ vscode:
- 'redhat.vscode-yaml' - 'redhat.vscode-yaml'
- 'davidanson.vscode-markdownlint' - 'davidanson.vscode-markdownlint'
- 'streetsidesoftware.code-spell-checker' - 'streetsidesoftware.code-spell-checker'
# cSpell:enable

View file

@ -139,5 +139,5 @@ MD046:
# MD048/code-fence-style - Code fence style # MD048/code-fence-style - Code fence style
MD048: MD048:
# Code fence syle # Code fence style
style: 'backtick' style: 'backtick'

View file

@ -1,3 +1,4 @@
# cSpell:ignore checkmake hadolint autofix autoupdate
repos: repos:
- repo: meta - repo: meta
hooks: hooks:

View file

@ -9,7 +9,5 @@
"go.lintTool": "golangci-lint", "go.lintTool": "golangci-lint",
"go.lintFlags": ["--fast"], "go.lintFlags": ["--fast"],
"eslint.workingDirectories": ["./web"], "eslint.workingDirectories": ["./web"],
"prettier.configPath": "./web/.prettierrc.js", "prettier.ignorePath": "./web/.prettierignore"
"prettier.ignorePath": "./web/.prettierignore",
"cSpell.words": ["Curr", "doublestar", "ERRORLEVEL", "multierr"]
} }

View file

@ -91,6 +91,14 @@ steps:
- event: push - event: push
branch: renovate/* branch: renovate/*
spellcheck:
image: docker.io/node:21-alpine
group: test
commands:
- corepack enable
- pnpx cspell lint --no-progress --gitignore '{**,.*}/{*,.*}'
when: *when
test: test:
depends_on: depends_on:
- vendor - vendor

View file

@ -4,7 +4,7 @@ ignore-from-file:
- docs/.gitignore - docs/.gitignore
- docs/plugins/woodpecker-plugins/.gitignore - docs/plugins/woodpecker-plugins/.gitignore
- .gitignore - .gitignore
- server/store/datastore/migration/testfiles/.gitignore - server/store/datastore/migration/test-files/.gitignore
- web/.gitignore - web/.gitignore
rules: rules:

View file

@ -38,7 +38,7 @@
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License: Apache-2.0"> <img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License: Apache-2.0">
</a> </a>
<a href="https://bestpractices.coreinfrastructure.org/projects/5309"> <a href="https://bestpractices.coreinfrastructure.org/projects/5309">
<img src="https://bestpractices.coreinfrastructure.org/projects/5309/badge" alt="openssf best practices"> <img src="https://bestpractices.coreinfrastructure.org/projects/5309/badge" alt="OpenSSF best practices">
</a> </a>
<a href="https://results.pre-commit.ci/repo/github/179344069" title="pre-commit.ci"> <a href="https://results.pre-commit.ci/repo/github/179344069" title="pre-commit.ci">
<img src="https://results.pre-commit.ci/badge/github/woodpecker-ci/woodpecker/main.svg" alt="pre-commit.ci"> <img src="https://results.pre-commit.ci/badge/github/woodpecker-ci/woodpecker/main.svg" alt="pre-commit.ci">

View file

@ -1,3 +1,4 @@
# cSpell:ignore pgdata pgsql localtime
version: '3' version: '3'
services: services:

View file

@ -8,7 +8,7 @@ global:
scrape_configs: scrape_configs:
- job_name: 'woodpecker' - job_name: 'woodpecker'
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... bearer_token: dummyToken...
static_configs: static_configs:
- targets: ['woodpecker.domain.com'] - 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: scrape_configs:
- job_name: 'woodpecker' - job_name: 'woodpecker'
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + bearer_token: dummyToken...
static_configs: static_configs:
- targets: ['woodpecker.domain.com'] - targets: ['woodpecker.domain.com']

View file

@ -8,7 +8,7 @@ global:
scrape_configs: scrape_configs:
- job_name: 'woodpecker' - job_name: 'woodpecker'
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... bearer_token: dummyToken...
static_configs: static_configs:
- targets: ['woodpecker.domain.com'] - targets: ['woodpecker.domain.com']
@ -24,7 +24,7 @@ global:
scrape_configs: scrape_configs:
- job_name: 'woodpecker' - job_name: 'woodpecker'
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + bearer_token: dummyToken...
static_configs: static_configs:
- targets: ['woodpecker.domain.com'] - targets: ['woodpecker.domain.com']

View file

@ -8,7 +8,7 @@ global:
scrape_configs: scrape_configs:
- job_name: 'woodpecker' - job_name: 'woodpecker'
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... bearer_token: dummyToken...
static_configs: static_configs:
- targets: ['woodpecker.domain.com'] - targets: ['woodpecker.domain.com']
@ -24,7 +24,7 @@ global:
scrape_configs: scrape_configs:
- job_name: 'woodpecker' - job_name: 'woodpecker'
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + bearer_token: dummyToken...
static_configs: static_configs:
- targets: ['woodpecker.domain.com'] - targets: ['woodpecker.domain.com']

View file

@ -8,7 +8,7 @@ global:
scrape_configs: scrape_configs:
- job_name: 'woodpecker' - job_name: 'woodpecker'
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... bearer_token: dummyToken...
static_configs: static_configs:
- targets: ['woodpecker.domain.com'] - targets: ['woodpecker.domain.com']
@ -24,7 +24,7 @@ global:
scrape_configs: scrape_configs:
- job_name: 'woodpecker' - job_name: 'woodpecker'
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + bearer_token: dummyToken...
static_configs: static_configs:
- targets: ['woodpecker.domain.com'] - targets: ['woodpecker.domain.com']

View file

@ -8,7 +8,7 @@ global:
scrape_configs: scrape_configs:
- job_name: 'woodpecker' - job_name: 'woodpecker'
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... bearer_token: dummyToken...
static_configs: static_configs:
- targets: ['woodpecker.domain.com'] - targets: ['woodpecker.domain.com']
@ -24,7 +24,7 @@ global:
scrape_configs: scrape_configs:
- job_name: 'woodpecker' - job_name: 'woodpecker'
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + bearer_token: dummyToken...
static_configs: static_configs:
- targets: ['woodpecker.domain.com'] - targets: ['woodpecker.domain.com']

View file

@ -8,7 +8,7 @@ global:
scrape_configs: scrape_configs:
- job_name: 'woodpecker' - job_name: 'woodpecker'
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... bearer_token: dummyToken...
static_configs: static_configs:
- targets: ['woodpecker.domain.com'] - 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: scrape_configs:
- job_name: 'woodpecker' - job_name: 'woodpecker'
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + bearer_token: dummyToken...
static_configs: static_configs:
- targets: ['woodpecker.domain.com'] - targets: ['woodpecker.domain.com']

View file

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// cSpell:ignore ERRORLEVEL
package local package local
import ( import (

View file

@ -209,7 +209,7 @@ func (l *Linter) lintDeprecations(config *WorkflowConfig) (err error) {
return err return err
} }
if parsed.PipelineDontUseIt.ContainerList != nil { if parsed.PipelineDoNotUseIt.ContainerList != nil {
err = multierr.Append(err, &errors.PipelineError{ err = multierr.Append(err, &errors.PipelineError{
Type: errors.PipelineErrorTypeDeprecation, Type: errors.PipelineErrorTypeDeprecation,
Message: "Please use 'steps:' instead of deprecated 'pipeline:' list", 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{ err = multierr.Append(err, &errors.PipelineError{
Type: errors.PipelineErrorTypeDeprecation, Type: errors.PipelineErrorTypeDeprecation,
Message: "Please use labels instead of deprecated 'platform' filters", 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{ err = multierr.Append(err, &errors.PipelineError{
Type: errors.PipelineErrorTypeDeprecation, Type: errors.PipelineErrorTypeDeprecation,
Message: "Please use global when instead of deprecated 'branches' filter", Message: "Please use global when instead of deprecated 'branches' filter",

View file

@ -33,34 +33,34 @@ func ParseBytes(b []byte) (*types.Workflow, error) {
} }
// support deprecated branch filter // support deprecated branch filter
if out.BranchesDontUseIt != nil { if out.BranchesDoNotUseIt != nil {
switch { switch {
case out.When.Constraints == nil: 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(): 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: default:
return nil, fmt.Errorf("could not apply deprecated branches filter into global when filter") return nil, fmt.Errorf("could not apply deprecated branches filter into global when filter")
} }
out.BranchesDontUseIt = nil out.BranchesDoNotUseIt = nil
} }
// support deprecated pipeline keyword // support deprecated pipeline keyword
if len(out.PipelineDontUseIt.ContainerList) != 0 && len(out.Steps.ContainerList) == 0 { if len(out.PipelineDoNotUseIt.ContainerList) != 0 && len(out.Steps.ContainerList) == 0 {
out.Steps.ContainerList = out.PipelineDontUseIt.ContainerList out.Steps.ContainerList = out.PipelineDoNotUseIt.ContainerList
} }
// support deprecated platform filter // support deprecated platform filter
if out.PlatformDontUseIt != "" { if out.PlatformDoNotUseIt != "" {
if out.Labels == nil { if out.Labels == nil {
out.Labels = make(base.SliceOrMap) out.Labels = make(base.SliceOrMap)
} }
if _, set := out.Labels["platform"]; !set { 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 return out, nil
} }

View file

@ -33,10 +33,10 @@ type (
func (s *Secrets) UnmarshalYAML(value *yaml.Node) error { func (s *Secrets) UnmarshalYAML(value *yaml.Node) error {
y, _ := yaml.Marshal(value) y, _ := yaml.Marshal(value)
var strslice []string var secrets []string
err := yaml.Unmarshal(y, &strslice) err := yaml.Unmarshal(y, &secrets)
if err == nil { if err == nil {
for _, str := range strslice { for _, str := range secrets {
s.Secrets = append(s.Secrets, &Secret{ s.Secrets = append(s.Secrets, &Secret{
Source: str, Source: str,
Target: str, Target: str,

View file

@ -38,11 +38,11 @@ type (
Volumes WorkflowVolumes `yaml:"volumes,omitempty"` Volumes WorkflowVolumes `yaml:"volumes,omitempty"`
// Deprecated // Deprecated
PlatformDontUseIt string `yaml:"platform,omitempty"` // TODO: remove in next major version PlatformDoNotUseIt string `yaml:"platform,omitempty"` // TODO: remove in next major version
// Deprecated // 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 // 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. // Workspace defines a pipeline workspace.

View file

@ -312,11 +312,11 @@ func PostApproval(c *gin.Context) {
return return
} }
newpipeline, err := pipeline.Approve(c, _store, pl, user, repo) newPipeline, err := pipeline.Approve(c, _store, pl, user, repo)
if err != nil { if err != nil {
handlePipelineErr(c, err) handlePipelineErr(c, err)
} else { } else {
c.JSON(http.StatusOK, newpipeline) c.JSON(http.StatusOK, newPipeline)
} }
} }

View file

@ -22,7 +22,7 @@ import (
var ( var (
ServiceHookMethod = http.MethodPost ServiceHookMethod = http.MethodPost
ServiceHookURL, _ = url.Parse( 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") "eyJ0ZXh0IjoidGVzdC93b29kcGVja2VyIiwidHlwZSI6Imhvb2sifQ.x3kPnmZtxZQ_9_eMhfQ1HSmj_SLhdT_Lu2hMczWjKh0")
ServiceHookHeaders = http.Header{ ServiceHookHeaders = http.Header{
"Content-Type": []string{"application/json"}, "Content-Type": []string{"application/json"},

View file

@ -75,7 +75,7 @@ const (
RepoPerforce SCMKind = "perforce" 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 type RepoVisibility string // @name RepoVisibility
const ( const (

View file

@ -39,9 +39,9 @@ func Send(ctx context.Context, method, path string, privateKey crypto.PrivateKey
var buf io.ReadWriter var buf io.ReadWriter
if in != nil { if in != nil {
buf = new(bytes.Buffer) buf = new(bytes.Buffer)
jsonerr := json.NewEncoder(buf).Encode(in) jsonErr := json.NewEncoder(buf).Encode(in)
if jsonerr != nil { if jsonErr != nil {
return 0, jsonerr return 0, jsonErr
} }
} }

View file

@ -77,8 +77,8 @@ func (q *persistentQueue) Poll(c context.Context, agentID int64, f FilterFn) (*m
task, err := q.Queue.Poll(c, agentID, f) task, err := q.Queue.Poll(c, agentID, f)
if task != nil { if task != nil {
log.Debug().Msgf("pull queue item: %s: remove from backup", task.ID) log.Debug().Msgf("pull queue item: %s: remove from backup", task.ID)
if derr := q.store.TaskDelete(task.ID); derr != nil { if deleteErr := q.store.TaskDelete(task.ID); deleteErr != nil {
log.Error().Err(derr).Msgf("pull queue item: %s: failed to remove from backup", task.ID) log.Error().Err(deleteErr).Msgf("pull queue item: %s: failed to remove from backup", task.ID)
} else { } else {
log.Debug().Msgf("pull queue item: %s: successfully removed from backup", task.ID) log.Debug().Msgf("pull queue item: %s: successfully removed from backup", task.ID)
} }

View file

@ -29,7 +29,7 @@ import (
) )
const ( const (
sqliteDB = "./testfiles/sqlite.db" sqliteDB = "./test-files/sqlite.db"
) )
func testDriver() string { func testDriver() string {
@ -41,7 +41,7 @@ func testDriver() string {
} }
func createSQLiteDB(t *testing.T) 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) { if !assert.NoError(t, err) {
t.FailNow() t.FailNow()
} }

View file

@ -52,11 +52,11 @@ func TestUsers(t *testing.T) {
} }
err1 := store.CreateUser(&user) err1 := store.CreateUser(&user)
err2 := store.UpdateUser(&user) err2 := store.UpdateUser(&user)
getuser, err3 := store.GetUser(user.ID) getUser, err3 := store.GetUser(user.ID)
g.Assert(err1).IsNil() g.Assert(err1).IsNil()
g.Assert(err2).IsNil() g.Assert(err2).IsNil()
g.Assert(err3).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() { g.It("Should Add a new User", func() {
@ -80,14 +80,14 @@ func TestUsers(t *testing.T) {
} }
g.Assert(store.CreateUser(user)).IsNil() g.Assert(store.CreateUser(user)).IsNil()
getuser, err := store.GetUser(user.ID) getUser, err := store.GetUser(user.ID)
g.Assert(err).IsNil() g.Assert(err).IsNil()
g.Assert(user.ID).Equal(getuser.ID) g.Assert(user.ID).Equal(getUser.ID)
g.Assert(user.Login).Equal(getuser.Login) g.Assert(user.Login).Equal(getUser.Login)
g.Assert(user.Token).Equal(getuser.Token) g.Assert(user.Token).Equal(getUser.Token)
g.Assert(user.Secret).Equal(getuser.Secret) g.Assert(user.Secret).Equal(getUser.Secret)
g.Assert(user.Email).Equal(getuser.Email) g.Assert(user.Email).Equal(getUser.Email)
g.Assert(user.Avatar).Equal(getuser.Avatar) g.Assert(user.Avatar).Equal(getUser.Avatar)
}) })
g.It("Should Get a User By Login", func() { g.It("Should Get a User By Login", func() {
@ -97,10 +97,10 @@ func TestUsers(t *testing.T) {
Token: "e42080dddf012c718e476da161d21ad5", Token: "e42080dddf012c718e476da161d21ad5",
} }
g.Assert(store.CreateUser(user)) g.Assert(store.CreateUser(user))
getuser, err := store.GetUserLogin(user.Login) getUser, err := store.GetUserLogin(user.Login)
g.Assert(err).IsNil() g.Assert(err).IsNil()
g.Assert(user.ID).Equal(getuser.ID) g.Assert(user.ID).Equal(getUser.ID)
g.Assert(user.Login).Equal(getuser.Login) g.Assert(user.Login).Equal(getUser.Login)
}) })
g.It("Should Enforce Unique User Login", func() { g.It("Should Enforce Unique User Login", func() {

View file

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// cSpell:ignore ldflags
package version package version
// Version of Woodpecker, set with ldflags, from Git tag // Version of Woodpecker, set with ldflags, from Git tag

View file

@ -1,3 +1,4 @@
// cSpell:ignore TSES
// @ts-check // @ts-check
/** @type {import('@typescript-eslint/experimental-utils').TSESLint.Linter.Config} */ /** @type {import('@typescript-eslint/experimental-utils').TSESLint.Linter.Config} */

View file

@ -385,7 +385,7 @@
"placeholder": "Adresa registru (např. docker.io)" "placeholder": "Adresa registru (např. docker.io)"
}, },
"created": "Vytvořená pověření k registru", "created": "Vytvořená pověření k registru",
"creds": "Pověření k registraci", "credentials": "Pověření k registraci",
"delete": "Odstranění registru", "delete": "Odstranění registru",
"deleted": "Odstranění pověření registru", "deleted": "Odstranění pověření registru",
"desc": "Lze přidat pověření k registrům a používat soukromé obrazy pro potrubí.", "desc": "Lze přidat pověření k registrům a používat soukromé obrazy pro potrubí.",
@ -434,7 +434,7 @@
"min_short": "min", "min_short": "min",
"not_started": "zatím nezačal", "not_started": "zatím nezačal",
"sec_short": "sek", "sec_short": "sek",
"tmpl": "MMM D, RRRR, HH:mm z", "template": "MMM D, RRRR, HH:mm z",
"weeks_short": "t" "weeks_short": "t"
}, },
"unknown_error": "Došlo k neznámé chybě", "unknown_error": "Došlo k neznámé chybě",

View file

@ -398,7 +398,7 @@
"placeholder": "Registry-Adresse (z. B. docker.io)" "placeholder": "Registry-Adresse (z. B. docker.io)"
}, },
"created": "Registry-Zugangsdaten erstellt", "created": "Registry-Zugangsdaten erstellt",
"creds": "Zugangsdaten für die Registry", "credentials": "Zugangsdaten für die Registry",
"delete": "Registry löschen", "delete": "Registry löschen",
"deleted": "Registry-Zugangsdaten gelöscht", "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.", "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", "min_short": "min",
"not_started": "noch nicht gestartet", "not_started": "noch nicht gestartet",
"sec_short": "sek", "sec_short": "sek",
"tmpl": "DD.MM.YYYY, HH:mm z", "template": "DD.MM.YYYY, HH:mm z",
"weeks_short": "w" "weeks_short": "w"
}, },
"unknown_error": "Ein unbekannter Fehler ist aufgetreten", "unknown_error": "Ein unbekannter Fehler ist aufgetreten",

View file

@ -24,7 +24,7 @@
"not_found": "Server could not find requested object" "not_found": "Server could not find requested object"
}, },
"time": { "time": {
"tmpl": "MMM D, YYYY, HH:mm z", "template": "MMM D, YYYY, HH:mm z",
"weeks_short": "w", "weeks_short": "w",
"days_short": "d", "days_short": "d",
"hours_short": "h", "hours_short": "h",
@ -153,7 +153,7 @@
}, },
"registries": { "registries": {
"registries": "Registries", "registries": "Registries",
"creds": "Registry credentials", "credentials": "Registry credentials",
"desc": "Registries credentials can be added to use private images for your pipeline.", "desc": "Registries credentials can be added to use private images for your pipeline.",
"show": "Show registries", "show": "Show registries",
"add": "Add registry", "add": "Add registry",

View file

@ -395,7 +395,7 @@
"placeholder": "Dirección del registry (por ejemplo, docker.io)" "placeholder": "Dirección del registry (por ejemplo, docker.io)"
}, },
"created": "Credenciales del registry creadas", "created": "Credenciales del registry creadas",
"creds": "Credenciales del registry", "credentials": "Credenciales del registry",
"delete": "Eliminar registry", "delete": "Eliminar registry",
"deleted": "Credenciales del registry eliminadas", "deleted": "Credenciales del registry eliminadas",
"desc": "Se pueden añadir credenciales de registries para utilizar imágenes privadas para su pipeline.", "desc": "Se pueden añadir credenciales de registries para utilizar imágenes privadas para su pipeline.",
@ -445,7 +445,7 @@
"min_short": "min", "min_short": "min",
"not_started": "no iniciado aún", "not_started": "no iniciado aún",
"sec_short": "s", "sec_short": "s",
"tmpl": "MMM D, YYYY, HH:mm z", "template": "MMM D, YYYY, HH:mm z",
"weeks_short": "w" "weeks_short": "w"
}, },
"unknown_error": "Se ha producido un error desconocido", "unknown_error": "Se ha producido un error desconocido",

View file

@ -397,7 +397,7 @@
"placeholder": "Adresse du registre (e.g. docker.io)" "placeholder": "Adresse du registre (e.g. docker.io)"
}, },
"created": "Authentifiant de connexion à un registre crée", "created": "Authentifiant de connexion à un registre crée",
"creds": "Authentifiants de connexion à un registre", "credentials": "Authentifiants de connexion à un registre",
"delete": "Effacer le registre", "delete": "Effacer le registre",
"deleted": "Authentifiant de connexion à un registre effacé", "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.", "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", "min_short": "min",
"not_started": "pas encore démarré", "not_started": "pas encore démarré",
"sec_short": "sec", "sec_short": "sec",
"tmpl": "D MMM, YYYY, HH:mm z", "template": "D MMM, YYYY, HH:mm z",
"weeks_short": "s" "weeks_short": "s"
}, },
"unknown_error": "Une erreur inconnue est survenue", "unknown_error": "Une erreur inconnue est survenue",

View file

@ -398,7 +398,7 @@
"placeholder": "Alamat registri (mis. docker.io)" "placeholder": "Alamat registri (mis. docker.io)"
}, },
"created": "Kredensial registri dibuat", "created": "Kredensial registri dibuat",
"creds": "Kredensial registri", "credentials": "Kredensial registri",
"delete": "Hapus registri", "delete": "Hapus registri",
"deleted": "Kredensial registri dihapus", "deleted": "Kredensial registri dihapus",
"desc": "Kredensial registri dapat ditambahkan untuk menggunakan citra pribadi untuk jalur pipa Anda.", "desc": "Kredensial registri dapat ditambahkan untuk menggunakan citra pribadi untuk jalur pipa Anda.",
@ -448,7 +448,7 @@
"min_short": "mnt", "min_short": "mnt",
"not_started": "belum dimulai", "not_started": "belum dimulai",
"sec_short": "dtk", "sec_short": "dtk",
"tmpl": "BBB H, TTTT, JJ:mm z", "template": "BBB H, TTTT, JJ:mm z",
"weeks_short": "m" "weeks_short": "m"
}, },
"unknown_error": "Terjadi sebuah kesalahan yang tidak diketahui", "unknown_error": "Terjadi sebuah kesalahan yang tidak diketahui",

View file

@ -395,7 +395,7 @@
"placeholder": "Reģistra adrese, piemēram, docker.io" "placeholder": "Reģistra adrese, piemēram, docker.io"
}, },
"created": "Reģistra autorizācijas dati pievienoti", "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", "delete": "Dzēst reģistra autorizācijas datus",
"deleted": "Reģistra autorizācijas dati dzēsti", "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.", "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.", "min_short": "min.",
"not_started": "nav uzsākts", "not_started": "nav uzsākts",
"sec_short": "sek.", "sec_short": "sek.",
"tmpl": "YYYY. [gada] D. MMMM, HH:mm z", "template": "YYYY. [gada] D. MMMM, HH:mm z",
"weeks_short": "ned." "weeks_short": "ned."
}, },
"unknown_error": "Notika neparedzēta kļūda", "unknown_error": "Notika neparedzēta kļūda",

View file

@ -103,7 +103,7 @@
"min_short": "min", "min_short": "min",
"not_started": "nog niet gestart", "not_started": "nog niet gestart",
"sec_short": "sec", "sec_short": "sec",
"tmpl": "DD.MM.YYYY, HH:mm z", "template": "DD.MM.YYYY, HH:mm z",
"weeks_short": "w" "weeks_short": "w"
}, },
"unknown_error": "Er is een onbekende fout opgetreden", "unknown_error": "Er is een onbekende fout opgetreden",

View file

@ -362,7 +362,7 @@
"placeholder": "Adres rejestru (np. docker.io)" "placeholder": "Adres rejestru (np. docker.io)"
}, },
"created": "Utworzono dane rejestru", "created": "Utworzono dane rejestru",
"creds": "Dane rejestrów", "credentials": "Dane rejestrów",
"delete": "Usuń rejestr", "delete": "Usuń rejestr",
"deleted": "Usunięto dane rejestru", "deleted": "Usunięto dane rejestru",
"desc": "Możesz dodać dane rejestrów aby używać prywatnych obrazów w twoim potoku.", "desc": "Możesz dodać dane rejestrów aby używać prywatnych obrazów w twoim potoku.",
@ -411,7 +411,7 @@
"min_short": "min", "min_short": "min",
"not_started": "jeszcze nie rozpoczęto", "not_started": "jeszcze nie rozpoczęto",
"sec_short": "sek", "sec_short": "sek",
"tmpl": "DD.MM.YYYY, HH:mm z", "template": "DD.MM.YYYY, HH:mm z",
"weeks_short": "tyg" "weeks_short": "tyg"
}, },
"unknown_error": "Wystąpił nieznany błąd", "unknown_error": "Wystąpił nieznany błąd",

View file

@ -397,7 +397,7 @@
"placeholder": "Адрес реестра (например: docker.io)" "placeholder": "Адрес реестра (например: docker.io)"
}, },
"created": "Данные для доступа к реестру добавлены", "created": "Данные для доступа к реестру добавлены",
"creds": "Учётные данные для авторизации в реестре", "credentials": "Учётные данные для авторизации в реестре",
"delete": "Удалить реестр", "delete": "Удалить реестр",
"deleted": "Данные для доступа к реестру удалены", "deleted": "Данные для доступа к реестру удалены",
"desc": "Можно добавить учетные данные для доступа к реестру, чтобы использовать приветные образы из этого реестра в конвейере.", "desc": "Можно добавить учетные данные для доступа к реестру, чтобы использовать приветные образы из этого реестра в конвейере.",
@ -447,7 +447,7 @@
"min_short": "мин.", "min_short": "мин.",
"not_started": "не запускался ни разу", "not_started": "не запускался ни разу",
"sec_short": "сек.", "sec_short": "сек.",
"tmpl": "D MMM, YYYY, HH:mm z", "template": "D MMM, YYYY, HH:mm z",
"weeks_short": "нед." "weeks_short": "нед."
}, },
"unknown_error": "Произошла неизвестная ошибка", "unknown_error": "Произошла неизвестная ошибка",

View file

@ -247,7 +247,7 @@
"placeholder": "Адреса реєстру (наприклад, docker.io)" "placeholder": "Адреса реєстру (наприклад, docker.io)"
}, },
"created": "Створено облікові дані реєстру", "created": "Створено облікові дані реєстру",
"creds": "Реквізити реєстру", "credentials": "Реквізити реєстру",
"delete": "Видалення реєстру", "delete": "Видалення реєстру",
"deleted": "Видалено облікові дані реєстру", "deleted": "Видалено облікові дані реєстру",
"desc": "Облікові дані реєстрів можуть бути додані для використання приватних зображень для вашого конвеєра.", "desc": "Облікові дані реєстрів можуть бути додані для використання приватних зображень для вашого конвеєра.",
@ -294,7 +294,7 @@
"min_short": "хв", "min_short": "хв",
"not_started": "ще не розпочато", "not_started": "ще не розпочато",
"sec_short": "сек", "sec_short": "сек",
"tmpl": "MMM D, РРРР, ГГ:п z", "template": "MMM D, РРРР, ГГ:п z",
"weeks_short": "т" "weeks_short": "т"
}, },
"unknown_error": "Виникла невідома помилка", "unknown_error": "Виникла невідома помилка",

View file

@ -395,7 +395,7 @@
"placeholder": "Registry 地址(如 docker.io" "placeholder": "Registry 地址(如 docker.io"
}, },
"created": "Registry 密码已创建", "created": "Registry 密码已创建",
"creds": "注册表凭据", "credentials": "注册表凭据",
"delete": "删除 registry", "delete": "删除 registry",
"deleted": "Registry 密码已删除", "deleted": "Registry 密码已删除",
"desc": "可以添加 Registry 密码,以在流水线中使用私有镜像。", "desc": "可以添加 Registry 密码,以在流水线中使用私有镜像。",
@ -445,7 +445,7 @@
"min_short": "分钟", "min_short": "分钟",
"not_started": "还没有运行过", "not_started": "还没有运行过",
"sec_short": "秒", "sec_short": "秒",
"tmpl": "YYYY 年 MM 月 D 日 HH:mm z", "template": "YYYY 年 MM 月 D 日 HH:mm z",
"weeks_short": "周" "weeks_short": "周"
}, },
"unknown_error": "发生了未知错误", "unknown_error": "发生了未知错误",

View file

@ -92,7 +92,7 @@
<InputField <InputField
v-slot="{ id }" v-slot="{ id }"
:label="$t('admin.settings.agents.capacity.capacity')" :label="$t('admin.settings.agents.capacity.capacity')"
docs-url="docs/next/administration/agent-config#woodpecker_max_procs" docs-url="docs/next/administration/agent-config#woodpecker_max_workflows"
> >
<span class="text-wp-text-alt-100">{{ $t('admin.settings.agents.capacity.desc') }}</span> <span class="text-wp-text-alt-100">{{ $t('admin.settings.agents.capacity.desc') }}</span>
<TextField :id="id" :model-value="selectedAgent.capacity?.toString()" disabled /> <TextField :id="id" :model-value="selectedAgent.capacity?.toString()" disabled />

View file

@ -22,7 +22,7 @@
:key="item.key" :key="item.key"
class="h-full" class="h-full"
:class="`${item.color}`" :class="`${item.color}`"
:style="{ width: `${item.perc}%` }" :style="{ width: `${item.percentage}%` }"
> >
&nbsp; &nbsp;
</div> </div>
@ -82,28 +82,28 @@ const data = computed(() => {
key: 'worker_count', key: 'worker_count',
label: t('admin.settings.queue.stats.worker_count'), label: t('admin.settings.queue.stats.worker_count'),
value: props.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', color: 'bg-wp-state-ok-100',
}, },
{ {
key: 'running_count', key: 'running_count',
label: t('admin.settings.queue.stats.running_count'), label: t('admin.settings.queue.stats.running_count'),
value: props.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', color: 'bg-wp-state-info-100',
}, },
{ {
key: 'pending_count', key: 'pending_count',
label: t('admin.settings.queue.stats.pending_count'), label: t('admin.settings.queue.stats.pending_count'),
value: props.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', color: 'bg-wp-state-neutral-100',
}, },
{ {
key: 'waiting_on_deps_count', key: 'waiting_on_deps_count',
label: t('admin.settings.queue.stats.waiting_on_deps_count'), label: t('admin.settings.queue.stats.waiting_on_deps_count'),
value: props.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', color: 'bg-wp-state-error-100',
}, },
]; ];

View file

@ -1,3 +1,4 @@
<!-- cSpell:ignore teenyicons radiobox vaadin twotone iconoir timelapse -->
<template> <template>
<i-ic-sharp-timelapse v-if="name === 'duration'" class="h-6 w-6" /> <i-ic-sharp-timelapse v-if="name === 'duration'" class="h-6 w-6" />
<i-mdi-clock-time-eight-outline v-else-if="name === 'since'" class="h-6 w-6" /> <i-mdi-clock-time-eight-outline v-else-if="name === 'since'" class="h-6 w-6" />
@ -7,7 +8,7 @@
<i-mdi-gesture-tap v-else-if="name === 'manual-pipeline'" class="h-6 w-6" /> <i-mdi-gesture-tap v-else-if="name === 'manual-pipeline'" class="h-6 w-6" />
<i-mdi-tag-outline v-else-if="name === 'tag'" class="h-6 w-6" /> <i-mdi-tag-outline v-else-if="name === 'tag'" class="h-6 w-6" />
<i-clarity-deploy-line v-else-if="name === 'deployment'" class="h-6 w-6" /> <i-clarity-deploy-line v-else-if="name === 'deployment'" class="h-6 w-6" />
<i-mdisource-commit v-else-if="name === 'commit'" class="h-6 w-6" /> <i-mdi-source-commit v-else-if="name === 'commit'" class="h-6 w-6" />
<i-iconoir-arrow-left v-else-if="name === 'back'" class="w-8 h-8" /> <i-iconoir-arrow-left v-else-if="name === 'back'" class="w-8 h-8" />
<i-mdi-github v-else-if="name === 'github'" class="h-8 w-8" /> <i-mdi-github v-else-if="name === 'github'" class="h-8 w-8" />
<i-teenyicons-git-solid v-else-if="name === 'repo'" class="h-8 w-8" /> <i-teenyicons-git-solid v-else-if="name === 'repo'" class="h-8 w-8" />

View file

@ -1,6 +1,6 @@
<template> <template>
<Settings <Settings
:title="$t('repo.settings.registries.creds')" :title="$t('repo.settings.registries.credentials')"
:desc="$t('repo.settings.registries.desc')" :desc="$t('repo.settings.registries.desc')"
docs-url="docs/usage/registries" docs-url="docs/usage/registries"
> >

View file

@ -14,7 +14,7 @@ dayjs.extend(duration);
export function useDate() { export function useDate() {
function toLocaleString(date: Date) { function toLocaleString(date: Date) {
return dayjs(date).format(useI18n().t('time.tmpl')); return dayjs(date).format(useI18n().t('time.template'));
} }
function timeAgo(date: Date | string | number) { function timeAgo(date: Date | string | number) {

View file

@ -34,7 +34,7 @@ export default (pipeline: Ref<Pipeline | undefined>) => {
return null; return null;
} }
// TODO check whetehr elapsed works // TODO check whether elapsed works
return timeAgo(sinceElapsed.value); return timeAgo(sinceElapsed.value);
}); });

View file

@ -31,13 +31,13 @@ async function fetchVersion(): Promise<VersionInfo | undefined> {
} }
} }
const isInitialised = ref(false); const isInitialized = ref(false);
export function useVersion() { export function useVersion() {
if (isInitialised.value) { if (isInitialized.value) {
return version; return version;
} }
isInitialised.value = true; isInitialized.value = true;
const config = useConfig(); const config = useConfig();
const current = config.version as string; const current = config.version as string;

View file

@ -1,3 +1,4 @@
/* cSpell:ignore atrule hexcode */
.token.atrule { .token.atrule {
color: #7c4dff; color: #7c4dff;
} }

View file

@ -1,3 +1,4 @@
// cSpell:ignore emojify
import { emojify } from 'node-emoji'; import { emojify } from 'node-emoji';
export function convertEmojis(input: string): string { export function convertEmojis(input: string): string {

View file

@ -1,3 +1,4 @@
// cSpell:ignore Segoe Roboto Neue Noto
/* eslint-disable import/no-extraneous-dependencies */ /* eslint-disable import/no-extraneous-dependencies */
import tinycolor from 'tinycolor2'; import tinycolor from 'tinycolor2';
import colors from 'windicss/colors'; import colors from 'windicss/colors';

View file

@ -7,7 +7,7 @@ import (
) )
const ( const (
token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" token = "dummyToken"
host = "http://woodpecker.company.tld" host = "http://woodpecker.company.tld"
) )

View file

@ -408,7 +408,7 @@ func (c *client) Org(orgID int64) (*Org, error) {
return out, err return out, err
} }
// OrgLookup returns a organsization by its name. // OrgLookup returns a organization by its name.
func (c *client) OrgLookup(name string) (*Org, error) { func (c *client) OrgLookup(name string) (*Org, error) {
out := new(Org) out := new(Org)
uri := fmt.Sprintf(pathOrgLookup, c.addr, name) uri := fmt.Sprintf(pathOrgLookup, c.addr, name)
@ -629,9 +629,9 @@ func (c *client) open(rawurl, method string, in any) (io.ReadCloser, error) {
return nil, err return nil, err
} }
if in != nil { if in != nil {
decoded, derr := json.Marshal(in) decoded, decodeErr := json.Marshal(in)
if derr != nil { if decodeErr != nil {
return nil, derr return nil, decodeErr
} }
buf := bytes.NewBuffer(decoded) buf := bytes.NewBuffer(decoded)
req.Body = io.NopCloser(buf) req.Body = io.NopCloser(buf)