Skip to content

Commit a9d4efc

Browse files
feat(configuration): flagset-native config resolution — FlagMetadata, prefix keys, ConfigResolver [IDE-1786] (#561)
1 parent b9ea94f commit a9d4efc

File tree

23 files changed

+2302
-235
lines changed

23 files changed

+2302
-235
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ orbs:
88
base_image: &base_image
99
resource_class: small
1010
docker:
11-
- image: cimg/go:1.24
11+
- image: cimg/go:1.26
1212

1313
# Define the jobs we want to run for this project
1414
jobs:

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,7 @@ Thumbs.db
4545
._*
4646
webidentity.json
4747
.cursor
48-
.windsurf
48+
.windsurf
49+
50+
*IDE-*
51+
.vscode/

.golangci.yaml

Lines changed: 107 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,10 @@
1+
version: "2"
12
run:
3+
concurrency: 4
24
build-tags:
35
- integration
4-
concurrency: 4
56
issues-exit-code: 1
6-
skip-dirs: []
77
tests: true
8-
timeout: 5m
9-
10-
linters-settings:
11-
errcheck:
12-
check-blank: true
13-
check-type-assertions: true
14-
exhaustive:
15-
default-signifies-exhaustive: true
16-
goconst:
17-
ignore-calls: false
18-
gocritic:
19-
enabled-tags:
20-
- diagnostic
21-
- experimental
22-
- opinionated
23-
- performance
24-
- style
25-
gocyclo:
26-
min-complexity: 15
27-
gofumpt:
28-
module-path: github.com/snyk/go-application-framework
29-
extra-rules: true
30-
goimports:
31-
local-prefixes: github.com/snyk/go-application-framework
32-
gosimple:
33-
checks: ['all']
34-
govet:
35-
enable-all: true
36-
disable:
37-
- fieldalignment
38-
lll:
39-
line-length: 160
40-
misspell:
41-
locale: US
42-
nolintlint:
43-
allow-unused: false
44-
require-explanation: true
45-
require-specific: true
46-
prealloc:
47-
simple: true
48-
range-loops: true
49-
for-loops: true
50-
promlinter:
51-
strict: true
52-
revive:
53-
rules:
54-
- name: blank-imports
55-
disabled: true
56-
- name: context-as-argument
57-
- name: context-keys-type
58-
- name: dot-imports
59-
- name: error-return
60-
- name: error-strings
61-
- name: error-naming
62-
- name: exported
63-
disable-stuttering-check: true
64-
- name: if-return
65-
- name: increment-decrement
66-
- name: var-naming
67-
- name: var-declaration
68-
disabled: true
69-
- name: package-comments
70-
- name: range
71-
- name: receiver-naming
72-
- name: time-naming
73-
- name: unexported-return
74-
- name: indent-error-flow
75-
- name: errorf
76-
- name: empty-block
77-
- name: superfluous-else
78-
- name: unused-parameter
79-
- name: unreachable-code
80-
- name: redefines-builtin-id
81-
staticcheck:
82-
checks: ['all']
83-
stylecheck:
84-
checks: ['all']
85-
http-status-code-whitelist: []
86-
varcheck:
87-
exported-fields: true
88-
898
linters:
909
enable:
9110
- asasalint
@@ -95,82 +14,131 @@ linters:
9514
- containedctx
9615
- contextcheck
9716
- dogsled
98-
# TODO(dupl): revisit
99-
#- dupl
10017
- durationcheck
10118
- errname
10219
- errorlint
10320
- exhaustive
104-
# TODO(forbidigo): revisit
105-
#- forbidigo
10621
- forcetypeassert
107-
# TODO(goconst): revisit
108-
#- goconst
109-
# TODO(gocritic): revisit
110-
#- gocritic
11122
- gocyclo
112-
# TODO(godot): revisit
113-
#- godot
114-
# TODO(gofumpt): revisit
115-
#- gofumpt
116-
# TODO(goimports): revisit
117-
#- goimports
11823
- goprintffuncname
119-
# TODO(gosec): revisit; consequences of revoking non-owner file permissions?
120-
#- gosec
121-
# TODO(interfacebloat): revisit in a followup; will require a breaking API change
122-
#- interfacebloat
123-
# TODO(ireturn): revisit in a followup; will require a breaking API change
124-
#- ireturn
125-
# TODO(lll): revisit in followup; formatting
126-
#- lll
12724
- misspell
12825
- nakedret
129-
# TODO(nestif): revisit in a followup; refactor will need more careful review
130-
#- nestif
13126
- nilerr
13227
- nilnil
133-
# TODO(noctx): revisit in a followup; context lifecycle consequences and/or breaking API change
134-
#- noctx
13528
- nolintlint
136-
# TODO(prealloc): revisit in a followup; some logic around slices are ignoring errors
137-
#- prealloc
13829
- predeclared
13930
- promlinter
140-
# TODO(revive): revisit in a followup; extensive changes, some breaking. godoc requirement would be good to introduce
141-
#- revive
14231
- rowserrcheck
14332
- sqlclosecheck
144-
# TODO(stylecheck): revisit in a followup; some breaking API changes
145-
#- stylecheck
146-
# NOTE: removed tagliatelle as it conflicts too much with existing API wireformats
147-
# - TODO(usetesting)
148-
# TODO(testpackage): improve open vs closed-box testing in a followup
149-
#- testpackage
15033
- thelper
15134
- tparallel
15235
- unconvert
15336
- unparam
15437
- usestdlibvars
15538
- wastedassign
15639
- whitespace
157-
# TODO(wrapcheck): wrap errors in a followup
158-
#- wrapcheck
159-
160-
issues:
161-
exclude-rules:
162-
- linters:
163-
- staticcheck
164-
text: "SA1019"
165-
- path: _test\.go
166-
linters:
167-
- bodyclose
168-
- forcetypeassert
169-
- goconst
170-
- ireturn
171-
- path: test/
172-
linters:
173-
- testpackage
174-
include:
175-
- EXC0012
176-
- EXC0014
40+
settings:
41+
errcheck:
42+
check-type-assertions: true
43+
check-blank: true
44+
exhaustive:
45+
default-signifies-exhaustive: true
46+
goconst:
47+
ignore-calls: false
48+
gocritic:
49+
enabled-tags:
50+
- diagnostic
51+
- experimental
52+
- opinionated
53+
- performance
54+
- style
55+
gocyclo:
56+
min-complexity: 15
57+
govet:
58+
disable:
59+
- fieldalignment
60+
enable-all: true
61+
lll:
62+
line-length: 160
63+
misspell:
64+
locale: US
65+
nolintlint:
66+
require-explanation: true
67+
require-specific: true
68+
allow-unused: false
69+
prealloc:
70+
simple: true
71+
range-loops: true
72+
for-loops: true
73+
promlinter:
74+
strict: true
75+
revive:
76+
rules:
77+
- name: blank-imports
78+
disabled: true
79+
- name: context-as-argument
80+
- name: context-keys-type
81+
- name: dot-imports
82+
- name: error-return
83+
- name: error-strings
84+
- name: error-naming
85+
- name: exported
86+
- name: if-return
87+
- name: increment-decrement
88+
- name: var-naming
89+
- name: var-declaration
90+
disabled: true
91+
- name: package-comments
92+
- name: range
93+
- name: receiver-naming
94+
- name: time-naming
95+
- name: unexported-return
96+
- name: indent-error-flow
97+
- name: errorf
98+
- name: empty-block
99+
- name: superfluous-else
100+
- name: unused-parameter
101+
- name: unreachable-code
102+
- name: redefines-builtin-id
103+
staticcheck:
104+
checks:
105+
- all
106+
- -ST*
107+
- -QF*
108+
exclusions:
109+
generated: lax
110+
presets:
111+
- common-false-positives
112+
- legacy
113+
- std-error-handling
114+
rules:
115+
- linters:
116+
- staticcheck
117+
text: SA1019
118+
- linters:
119+
- bodyclose
120+
- forcetypeassert
121+
- goconst
122+
- ireturn
123+
path: _test\.go
124+
- linters:
125+
- testpackage
126+
path: test/
127+
paths:
128+
- third_party$
129+
- builtin$
130+
- examples$
131+
formatters:
132+
settings:
133+
gofumpt:
134+
module-path: github.com/snyk/go-application-framework
135+
extra-rules: true
136+
goimports:
137+
local-prefixes:
138+
- github.com/snyk/go-application-framework
139+
exclusions:
140+
generated: lax
141+
paths:
142+
- third_party$
143+
- builtin$
144+
- examples$

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ GOOS = $(shell go env GOOS)
33
GOARCH = $(shell go env GOARCH)
44

55
GO_BIN := $(shell pwd)/.bin
6-
OVERRIDE_GOCI_LINT_V := v1.64.8
6+
OVERRIDE_GOCI_LINT_V := v2.10.1
77
SHELL := env PATH=$(GO_BIN):$(shell go env GOROOT)/bin:$(PATH) $(SHELL)
88

99
.PHONY: format
@@ -47,7 +47,7 @@ generate:
4747
tools: $(GO_BIN)/golangci-lint
4848

4949
$(GO_BIN)/golangci-lint:
50-
curl -sSfL 'https://raw.githubusercontent.com/golangci/golangci-lint/${OVERRIDE_GOCI_LINT_V}/install.sh' | sh -s -- -b ${GO_BIN} ${OVERRIDE_GOCI_LINT_V}
50+
curl -sSfL 'https://golangci-lint.run/install.sh' | sh -s -- -b ${GO_BIN} ${OVERRIDE_GOCI_LINT_V}
5151

5252
.PHONY: update-dragonfly
5353
update-dragonfly:

go.mod

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/snyk/go-application-framework
22

3-
go 1.24.0
3+
go 1.26.1
44

55
require (
66
github.com/charmbracelet/lipgloss v1.1.0
@@ -25,13 +25,12 @@ require (
2525

2626
require (
2727
github.com/cenkalti/backoff/v5 v5.0.2
28-
github.com/go-git/go-git/v5 v5.14.0
28+
github.com/go-git/go-git/v5 v5.16.5
2929
github.com/gofrs/flock v0.12.1
3030
github.com/manifoldco/promptui v0.9.0
3131
github.com/mattn/go-isatty v0.0.20
3232
github.com/oapi-codegen/runtime v1.1.1
3333
github.com/patrickmn/go-cache v2.1.0+incompatible
34-
github.com/puzpuzpuz/xsync v1.5.2
3534
github.com/snyk/error-catalog-golang-public v0.0.0-20260205094614-116c03822905
3635
github.com/subosito/gotenv v1.6.0
3736
golang.org/x/mod v0.30.0
@@ -53,7 +52,7 @@ require (
5352
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
5453
github.com/charmbracelet/x/term v0.2.1 // indirect
5554
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
56-
github.com/cloudflare/circl v1.6.0 // indirect
55+
github.com/cloudflare/circl v1.6.1 // indirect
5756
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
5857
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
5958
github.com/dprotaso/go-yit v0.0.0-20240618133044-5a0af90af097 // indirect
@@ -66,7 +65,7 @@ require (
6665
github.com/go-git/go-billy/v5 v5.6.2 // indirect
6766
github.com/go-openapi/jsonpointer v0.21.1 // indirect
6867
github.com/go-openapi/swag v0.23.1 // indirect
69-
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
68+
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
7069
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
7170
github.com/inconshreveable/mousetrap v1.1.0 // indirect
7271
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect

0 commit comments

Comments
 (0)