Skip to content

Commit

Permalink
Add spellcheck config (woodpecker-ci#3018)
Browse files Browse the repository at this point in the history
Part of woodpecker-ci#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>
  • Loading branch information
4 people committed Jan 27, 2024
1 parent 0b5eef7 commit 94b882f
Show file tree
Hide file tree
Showing 58 changed files with 241 additions and 109 deletions.
113 changes: 113 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -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 changes: 1 addition & 1 deletion .ecrc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -105,6 +105,7 @@ ports:

vscode:
extensions:
# cSpell:disable
- 'golang.go'
- 'EditorConfig.EditorConfig'
- 'dbaeumer.vscode-eslint'
Expand All @@ -114,3 +115,4 @@ vscode:
- 'redhat.vscode-yaml'
- 'davidanson.vscode-markdownlint'
- 'streetsidesoftware.code-spell-checker'
# cSpell:enable
2 changes: 1 addition & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,5 @@ MD046:

# MD048/code-fence-style - Code fence style
MD048:
# Code fence syle
# Code fence style
style: 'backtick'
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# cSpell:ignore checkmake hadolint autofix autoupdate
repos:
- repo: meta
hooks:
Expand Down
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
8 changes: 8 additions & 0 deletions .woodpecker/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License: Apache-2.0">
</a>
<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 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">
Expand Down
1 change: 1 addition & 0 deletions docker-compose.gitpod.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# cSpell:ignore pgdata pgsql localtime
version: '3'

services:
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/30-administration/90-prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ global:

scrape_configs:
- job_name: 'woodpecker'
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
bearer_token: dummyToken...

static_configs:
- targets: ['woodpecker.domain.com']
Expand All @@ -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']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ global:

scrape_configs:
- job_name: 'woodpecker'
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
bearer_token: dummyToken...

static_configs:
- targets: ['woodpecker.domain.com']
Expand All @@ -24,7 +24,7 @@ global:

scrape_configs:
- job_name: 'woodpecker'
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
+ bearer_token: dummyToken...

static_configs:
- targets: ['woodpecker.domain.com']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ global:

scrape_configs:
- job_name: 'woodpecker'
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
bearer_token: dummyToken...

static_configs:
- targets: ['woodpecker.domain.com']
Expand All @@ -24,7 +24,7 @@ global:

scrape_configs:
- job_name: 'woodpecker'
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
+ bearer_token: dummyToken...

static_configs:
- targets: ['woodpecker.domain.com']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ global:

scrape_configs:
- job_name: 'woodpecker'
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
bearer_token: dummyToken...

static_configs:
- targets: ['woodpecker.domain.com']
Expand All @@ -24,7 +24,7 @@ global:

scrape_configs:
- job_name: 'woodpecker'
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
+ bearer_token: dummyToken...

static_configs:
- targets: ['woodpecker.domain.com']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ global:

scrape_configs:
- job_name: 'woodpecker'
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
bearer_token: dummyToken...

static_configs:
- targets: ['woodpecker.domain.com']
Expand All @@ -24,7 +24,7 @@ global:

scrape_configs:
- job_name: 'woodpecker'
+ bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
+ bearer_token: dummyToken...

static_configs:
- targets: ['woodpecker.domain.com']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ global:

scrape_configs:
- job_name: 'woodpecker'
bearer_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
bearer_token: dummyToken...

static_configs:
- targets: ['woodpecker.domain.com']
Expand All @@ -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']
Expand Down
2 changes: 2 additions & 0 deletions pipeline/backend/local/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// cSpell:ignore ERRORLEVEL

package local

import (
Expand Down
6 changes: 3 additions & 3 deletions pipeline/frontend/yaml/linter/linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
20 changes: 10 additions & 10 deletions pipeline/frontend/yaml/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Loading

0 comments on commit 94b882f

Please sign in to comment.