This commit is contained in:
6543 2024-05-14 04:04:27 +02:00
parent d05ccce040
commit 2ba0954478
12 changed files with 36 additions and 31 deletions

View file

@ -97,6 +97,9 @@
"ppid",
"prismjs",
"proto",
"protobuf",
"protoimpl",
"protoreflect",
"protoc",
"rawurl",
"riscv",
@ -111,6 +114,7 @@
"testdata",
"tink",
"tinycolor",
"tmpfs",
"tmpl",
"typecheck",
"unplugin",
@ -131,6 +135,7 @@
"**/node_modules/**/*",
"*.excalidraw",
"*.svg",
"*_test.go",
".cspell.json",
".git/**/*",
".gitignore",
@ -142,13 +147,13 @@
"flake.nix",
"go.mod",
"go.sum",
"pipeline/rpc/proto/woodpecker.pb.go",
"pnpm-lock.yaml",
"server/store/datastore/migration/**/*",
"web/components.d.ts",
"web/src/assets/locales/**/*",
// TODO: remove the following
"docs/",
"pipeline/",
"server/"
],
"enableFiletypes": ["dockercompose"]

View file

@ -47,7 +47,7 @@ var Command = &cli.Command{
}
func pipelineOutput(c *cli.Context, resources []woodpecker.Pipeline, fd ...io.Writer) error {
outfmt, outopt := output.ParseOutputOptions(c.String("output"))
outFmt, outOpt := output.ParseOutputOptions(c.String("output"))
noHeader := c.Bool("output-no-headers")
var out io.Writer
@ -60,13 +60,13 @@ func pipelineOutput(c *cli.Context, resources []woodpecker.Pipeline, fd ...io.Wr
out = os.Stdout
}
switch outfmt {
switch outFmt {
case "go-template":
if len(outopt) < 1 {
if len(outOpt) < 1 {
return fmt.Errorf("%w: missing template", output.ErrOutputOptionRequired)
}
tmpl, err := template.New("_").Parse(outopt[0] + "\n")
tmpl, err := template.New("_").Parse(outOpt[0] + "\n")
if err != nil {
return err
}
@ -79,8 +79,8 @@ func pipelineOutput(c *cli.Context, resources []woodpecker.Pipeline, fd ...io.Wr
table := output.NewTable(out)
cols := []string{"Number", "Status", "Event", "Branch", "Commit", "Author"}
if len(outopt) > 0 {
cols = outopt
if len(outOpt) > 0 {
cols = outOpt
}
if !noHeader {
table.WriteHeader(cols)

View file

@ -31,7 +31,7 @@ import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/urfave/cli/v2"
"golang.org/x/sync/errgroup"
"golang.org/x/sync/errgroup" // cspell:words errgroup
"google.golang.org/grpc"
"google.golang.org/grpc/keepalive"

View file

@ -25,7 +25,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/rs/zerolog/log"
"github.com/urfave/cli/v2"
"golang.org/x/sync/errgroup"
"golang.org/x/sync/errgroup" // cspell:words errgroup
"go.woodpecker-ci.org/woodpecker/v2/server"
"go.woodpecker-ci.org/woodpecker/v2/server/cache"

View file

@ -159,12 +159,12 @@ func WithNetworks(networks ...string) Option {
// WithResourceLimit configures the compiler with default resource limits that
// are applied each container in the pipeline.
func WithResourceLimit(swap, mem, shmsize, cpuQuota, cpuShares int64, cpuSet string) Option {
func WithResourceLimit(swap, mem, shmSize, cpuQuota, cpuShares int64, cpuSet string) Option {
return func(compiler *Compiler) {
compiler.reslimit = ResourceLimit{
MemSwapLimit: swap,
MemLimit: mem,
ShmSize: shmsize,
ShmSize: shmSize,
CPUQuota: cpuQuota,
CPUShares: cpuShares,
CPUSet: cpuSet,

View file

@ -17,7 +17,7 @@ package linter
import (
"fmt"
"codeberg.org/6543/xyaml"
"codeberg.org/6543/xyaml" // cspell:words xyaml
"go.uber.org/multierr"
"go.woodpecker-ci.org/woodpecker/v2/pipeline/errors"

View file

@ -17,7 +17,7 @@ package matrix
import (
"strings"
"codeberg.org/6543/xyaml"
"codeberg.org/6543/xyaml" // cspell:words xyaml
errorTypes "go.woodpecker-ci.org/woodpecker/v2/pipeline/errors/types"
)

View file

@ -17,7 +17,7 @@ package yaml
import (
"fmt"
"codeberg.org/6543/xyaml"
"codeberg.org/6543/xyaml" // cspell:words xyaml
"go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/yaml/constraint"
"go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/yaml/types"

View file

@ -66,24 +66,24 @@ func (v *Volumes) UnmarshalYAML(unmarshal func(any) error) error {
if !ok {
return fmt.Errorf("cannot unmarshal '%v' to type %T into a string value", name, name)
}
elts := strings.SplitN(name, ":", 3)
elements := strings.SplitN(name, ":", 3)
var vol *Volume
//nolint:mnd
switch {
case len(elts) == 1:
case len(elements) == 1:
vol = &Volume{
Destination: elts[0],
Destination: elements[0],
}
case len(elts) == 2:
case len(elements) == 2:
vol = &Volume{
Source: elts[0],
Destination: elts[1],
Source: elements[0],
Destination: elements[1],
}
case len(elts) == 3:
case len(elements) == 3:
vol = &Volume{
Source: elts[0],
Destination: elts[1],
AccessMode: elts[2],
Source: elements[0],
Destination: elements[1],
AccessMode: elements[2],
}
default:
// FIXME

View file

@ -21,10 +21,10 @@ import (
"sync"
"time"
"github.com/oklog/ulid/v2"
"github.com/oklog/ulid/v2" // cspell:disable-line
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"golang.org/x/sync/errgroup"
"golang.org/x/sync/errgroup" // cspell:words errgroup
backend "go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"
"go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/metadata"

View file

@ -134,7 +134,7 @@ message RegisterAgentResponse {
int64 agent_id = 1;
}
// Woodpecker auth service is a simple service to authenticate agents and aquire a token
// Woodpecker auth service is a simple service to authenticate agents and acquire a token
service WoodpeckerAuth {
rpc Auth (AuthRequest) returns (AuthResponse) {}

View file

@ -22,7 +22,7 @@ import "strings"
// secrets with asterisks. Each secret string is split on newlines to
// handle multi-line secrets.
func NewSecretsReplacer(secrets []string) *strings.Replacer {
var oldnew []string
var oldNew []string
// Strings shorter than minStringLength are not considered secrets.
// Do not sanitize them.
@ -38,10 +38,10 @@ func NewSecretsReplacer(secrets []string) *strings.Replacer {
if len(part) == 0 {
continue
}
oldnew = append(oldnew, part)
oldnew = append(oldnew, "********")
oldNew = append(oldNew, part)
oldNew = append(oldNew, "********")
}
}
return strings.NewReplacer(oldnew...)
return strings.NewReplacer(oldNew...)
}