Skip to content

Commit

Permalink
#12 Update processor to support nil values.
Browse files Browse the repository at this point in the history
  • Loading branch information
lexbritvin committed Oct 5, 2024
1 parent c1497f2 commit 42ccac2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@
*.gz
*.gen.go
dist/
vendor/
.plasmactl/
keyring.yaml.age
*.age
27 changes: 15 additions & 12 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,24 @@ run:
deadline: 10s
issues-exit-code: 1
tests: true
skip-dirs:
- bin
- vendor
- var
- tmp
skip-files:
- \.pb\.go$
- \.pb\.goclay\.go$

output:
format: colored-line-number
formats:
- format: colored-line-number
print-issued-lines: true
print-linter-name: true

linters-settings:
govet:
check-shadowing: true
shadow: true
golint:
min-confidence: 0
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2

linters:
disable-all: true
enable:
Expand All @@ -41,10 +34,20 @@ linters:
- goconst
- gosec
- goimports
- megacheck # (staticcheck + gosimple + unused in one linter) - enable before push
- gosimple
- staticcheck
- unused

issues:
exclude-use-default: false
exclude-dirs:
- bin
- vendor
- var
- tmp
exclude-files:
- \.pb\.go$
- \.pb\.goclay\.go$
exclude:
# # _ instead of err checks
# - G104
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ LOCAL_BIN:=$(CURDIR)/bin

# Linter config.
GOLANGCI_BIN:=$(LOCAL_BIN)/golangci-lint
GOLANGCI_TAG:=1.55.2
GOLANGCI_TAG:=1.61.0

.PHONY: all
all: deps test build
Expand Down Expand Up @@ -74,4 +74,4 @@ endif
.PHONY: .lint
.lint:
$(info Running lint...)
$(GOLANGCI_BIN) run --fix --timeout 3m0s ./...
$(GOLANGCI_BIN) run --fix ./...
2 changes: 1 addition & 1 deletion plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func AddValueProcessors(m action.Manager, keyring Keyring) {

func getByKeyProcessor(value interface{}, options map[string]interface{}, k Keyring) (interface{}, error) {
val, ok := value.(string)
if !ok {
if !ok && value != nil {
return val, fmt.Errorf(
"string type is expected for %q processor. Change value type or remove the processor", getByKeyProc,
)
Expand Down

0 comments on commit 42ccac2

Please sign in to comment.