1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-11-29 21:48:14 +02:00

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
58 changed files with 241 additions and 109 deletions

View File

@@ -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",

View File

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

View File

@@ -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,

View File

@@ -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.