Skip to content

Commit c4e8e8c

Browse files
authored
Merge pull request #102 from hyp3rd/feat/modernize
refactor(tests,lint): introduce shared cluster/eviction helpers and drop ireturn suppressions
2 parents b223bbf + 2b650e1 commit c4e8e8c

52 files changed

Lines changed: 2510 additions & 2804 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.golangci.yaml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -63,37 +63,6 @@ linters:
6363
# (access to unexported helpers without re-exporting). Documented choice.
6464
- testpackage
6565

66-
exclusions:
67-
# Path-based exclusions for rules that produce false-positive noise on test
68-
# code without corresponding signal. Production code remains under the full
69-
# rule set; only `_test.go` files are exempted from these specific rules.
70-
#
71-
# Justification per rule:
72-
# - funlen / cyclop / gocognit: tests legitimately have long bodies
73-
# (setup -> many actions -> many assertions); splitting into helpers
74-
# adds noise without surfacing real defects.
75-
# - dupl: table-driven test bodies repeat by design.
76-
# - gocritic: subjective stylistic suggestions, low signal on tests.
77-
# - goconst: short fixture strings ("v1", "key1") naturally repeat in
78-
# tests; constants would obscure intent.
79-
# - noinlineerr: stylistic preference, not a defect.
80-
# - revive function-length / cognitive-complexity / cyclomatic: same
81-
# reasons as funlen / cyclop / gocognit (revive's variants).
82-
rules:
83-
- path: _test\.go$
84-
linters:
85-
- funlen
86-
- cyclop
87-
- gocognit
88-
- dupl
89-
- gocritic
90-
- goconst
91-
- noinlineerr
92-
- path: _test\.go$
93-
linters:
94-
- revive
95-
text: '^(function-length|cognitive-complexity|cyclomatic):'
96-
9766
settings:
9867
cyclop:
9968
# The maximal code complexity to report.

bench-step3.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
goos: darwin
2+
goarch: arm64
3+
pkg: github.com/hyp3rd/hypercache/pkg/cache/v2
4+
cpu: Apple M4 Pro
5+
BenchmarkConcurrentMap_Count-14 122877582 9.726 ns/op 0 B/op 0 allocs/op
6+
BenchmarkConcurrentMap_Count-14 122084272 9.828 ns/op 0 B/op 0 allocs/op
7+
BenchmarkConcurrentMap_Count-14 123835690 9.683 ns/op 0 B/op 0 allocs/op
8+
BenchmarkConcurrentMap_Count-14 122782857 9.763 ns/op 0 B/op 0 allocs/op
9+
BenchmarkConcurrentMap_Count-14 124295282 9.649 ns/op 0 B/op 0 allocs/op
10+
BenchmarkConcurrentMap_CountParallel-14 79226004 13.44 ns/op 9 B/op 0 allocs/op
11+
BenchmarkConcurrentMap_CountParallel-14 82377501 13.32 ns/op 9 B/op 0 allocs/op
12+
BenchmarkConcurrentMap_CountParallel-14 93374600 12.83 ns/op 9 B/op 0 allocs/op
13+
BenchmarkConcurrentMap_CountParallel-14 74157042 14.11 ns/op 9 B/op 0 allocs/op
14+
BenchmarkConcurrentMap_CountParallel-14 89445556 13.49 ns/op 8 B/op 0 allocs/op
15+
BenchmarkConcurrentMap_GetShard-14 100000000 10.08 ns/op 0 B/op 0 allocs/op
16+
BenchmarkConcurrentMap_GetShard-14 120268629 10.01 ns/op 0 B/op 0 allocs/op
17+
BenchmarkConcurrentMap_GetShard-14 100000000 10.22 ns/op 0 B/op 0 allocs/op
18+
BenchmarkConcurrentMap_GetShard-14 100000000 10.03 ns/op 0 B/op 0 allocs/op
19+
BenchmarkConcurrentMap_GetShard-14 100000000 10.07 ns/op 0 B/op 0 allocs/op
20+
BenchmarkConcurrentMap_All-14 46454 26087 ns/op 0 B/op 0 allocs/op
21+
BenchmarkConcurrentMap_All-14 44976 26633 ns/op 0 B/op 0 allocs/op
22+
BenchmarkConcurrentMap_All-14 45357 26457 ns/op 0 B/op 0 allocs/op
23+
BenchmarkConcurrentMap_All-14 41589 27827 ns/op 0 B/op 0 allocs/op
24+
BenchmarkConcurrentMap_All-14 45512 26454 ns/op 0 B/op 0 allocs/op
25+
PASS
26+
ok github.com/hyp3rd/hypercache/pkg/cache/v2 23.302s

cspell.config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ ignorePaths:
2727
- "*.http"
2828
- compose.*.yaml
2929
- docs/mkdocs.yml
30+
- bench-*.txt
31+
- lint-*.txt
32+
- race-*.log
3033
dictionaryDefinitions: []
3134
dictionaries: []
3235
words:
3336
- acks
37+
- autosync
3438
- backpressure
3539
- benchmarkdist
3640
- benchmem
@@ -64,6 +68,7 @@ words:
6468
- excludeonly
6569
- exhaustruct
6670
- Fanout
71+
- fatals
6772
- fctx
6873
- ferr
6974
- FLUSHALL
@@ -80,6 +85,8 @@ words:
8085
- gocache
8186
- goccy
8287
- gochecknoglobals
88+
- goconst
89+
- histogramcollector
8390
- gofiber
8491
- GOFILES
8592
- gofumpt
@@ -114,6 +121,7 @@ words:
114121
- Merkle
115122
- mfinal
116123
- Mgmt
124+
- microbenchmark
117125
- mkdocs
118126
- mrand
119127
- mset
@@ -151,6 +159,7 @@ words:
151159
- stretchr
152160
- strfnv
153161
- strs
162+
- subtest
154163
- subtests
155164
- sval
156165
- thelper

0 commit comments

Comments
 (0)