Skip to content

Commit cf47aa5

Browse files
committed
fix(lint): gofmt alignment and US-spelling in drop_summary + family_nu
- Align const block in drop_summary.go per gofmt (tab-aligned values) - Fix "synchronisation" -> "synchronization" in drop_summary.go comment - Fix "unrecognised/recognised" -> "unrecognized/recognized" in new family_nu.go comments added by this branch (lines 20, 59, 147, 181) - Add missing blank comment line before "The second return value" in sizeRDSFamilyRecs godoc (gofmt list-item paragraph separator)
1 parent 5093403 commit cf47aa5

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

‎cmd/multi_service_filters_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ func TestApplyFilters_DropMinPoolSize(t *testing.T) {
459459
d := common.NewDropSummary()
460460
result := applyFilters(
461461
[]common.Recommendation{rec},
462-
toolCfg,
462+
&toolCfg,
463463
make(map[string][]InstanceEngineVersion),
464464
make(map[string]MajorEngineVersionInfo),
465465
"",
@@ -516,7 +516,7 @@ func TestApplyFilters_DropExtendedSupport(t *testing.T) {
516516
d := common.NewDropSummary()
517517
result := applyFilters(
518518
[]common.Recommendation{rec},
519-
toolCfg,
519+
&toolCfg,
520520
instanceVersions,
521521
versionInfo,
522522
"",

‎pkg/common/drop_summary.go‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ import (
99
// Drop reason keys used by all filter and sizing stages. Using typed constants
1010
// avoids typos at call sites and lets tests assert on the exact key.
1111
const (
12-
DropMinPoolSize = "--min-pool-size"
13-
DropExtendedSupport = "--include-extended-support"
14-
DropTargetAlreadyMet = "target-already-met"
15-
DropTargetSizedToZero = "target-sized-to-zero"
12+
DropMinPoolSize = "--min-pool-size"
13+
DropExtendedSupport = "--include-extended-support"
14+
DropTargetAlreadyMet = "target-already-met"
15+
DropTargetSizedToZero = "target-sized-to-zero"
1616
DropFamilyAlreadyAtTarget = "family-nu-already-at-target"
17-
DropFamilyNoNUSignal = "family-nu-no-nu-signal"
18-
DropFamilySizedToZero = "family-nu-sized-to-zero"
19-
DropDuplicateDedup = "duplicate-dedup"
17+
DropFamilyNoNUSignal = "family-nu-no-nu-signal"
18+
DropFamilySizedToZero = "family-nu-sized-to-zero"
19+
DropDuplicateDedup = "duplicate-dedup"
2020
)
2121

2222
// DropSummary accumulates the count of recommendations dropped per reason
2323
// across the full fetch-filter-size pipeline. It is not safe for concurrent
2424
// use from multiple goroutines; the main pipeline is sequential per service
25-
// and region so no synchronisation is needed.
25+
// and region so no synchronization is needed.
2626
type DropSummary struct {
2727
counts map[string]int
2828
}

‎providers/aws/recommendations/family_nu.go‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
// --target-coverage. Sizes not in this map evaluate to 0 NU. Recs
1818
// with an empty family prefix (unknown size suffix) are routed to
1919
// nonRDS by partitionRDSRecsByFamily and handled by the per-pool path.
20-
// Recs with a known family prefix but an unrecognised size suffix reach
20+
// Recs with a known family prefix but an unrecognized size suffix reach
2121
// sizeRDSFamilyRecs with 0 NU; if the whole family sums to zero
2222
// (currentNU <= 0) they are recorded in drops.NoNUSignal and dropped.
2323
var rdsInstanceNU = map[string]float64{
@@ -56,7 +56,7 @@ func RDSFamilyFromType(instanceType string) string {
5656

5757
// rdsInstanceNUFromType returns the NU value for an instance type like
5858
// "db.r7g.2xlarge", parsing out the size suffix ("2xlarge" → 16). Returns
59-
// 0 when the size isn't recognised. When a whole family's rec-NU sums to
59+
// 0 when the size isn't recognized. When a whole family's rec-NU sums to
6060
// zero inside sizeRDSFamilyRecs (currentNU <= 0), those recs are recorded
6161
// in drops.NoNUSignal and dropped rather than falling back to per-pool sizing.
6262
func rdsInstanceNUFromType(instanceType string) float64 {
@@ -144,7 +144,7 @@ type FamilyDropCounts struct {
144144
AlreadyAtTarget int
145145
// NoNUSignal is the number of recs dropped because the family's
146146
// AWS-recommended counts summed to zero NU (e.g. all recs at
147-
// unknown/unrecognised sizes), so there is no scalable NU to apply
147+
// unknown/unrecognized sizes), so there is no scalable NU to apply
148148
// the family target against. This is distinct from AlreadyAtTarget.
149149
NoNUSignal int
150150
// SizedToZero is the number of recs dropped because the family-wide
@@ -178,7 +178,7 @@ type FamilyDropCounts struct {
178178
// a family has no NU signal (family.TotalNU <= 0), that family's recs
179179
// are returned sized (as-is) in sizedRDS. When the family's
180180
// AWS-recommended counts sum to zero NU (currentNU <= 0 — all recs at
181-
// unrecognised sizes), those recs are dropped and recorded in
181+
// unrecognized sizes), those recs are dropped and recorded in
182182
// drops.NoNUSignal; they are NOT passed through to the per-pool path.
183183
func ApplyFamilyNUSizingRDS(
184184
recs []common.Recommendation,
@@ -233,9 +233,10 @@ func partitionRDSRecsByFamily(recs []common.Recommendation) (map[string][]int, [
233233
// recs are returned as-is (AWS-recommended counts unchanged).
234234
// - gap <= 0: family already at or above target; all recs are dropped
235235
// and recorded in drops.AlreadyAtTarget.
236-
// - currentNU <= 0: rec counts sum to zero NU (all at unrecognised
236+
// - currentNU <= 0: rec counts sum to zero NU (all at unrecognized
237237
// sizes); recs are dropped and recorded in drops.NoNUSignal — they
238238
// are NOT passed through to the per-pool sizing path.
239+
//
239240
// The second return value reports how many recs were dropped and why.
240241
//
241242
// First pass scales each rec's Count and cost-bearing fields by the

0 commit comments

Comments
 (0)