Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ linters:
pattern: (?i)passwd|pass|password|pwd|secret|token
govet:
enable-all: true
disable:
# fieldalignment: many production structs have alignment violations that
# pre-date this PR; fixing them is a separate concern. Suppress globally
# rather than per-struct since golangci-lint v2.10.x (CI) doesn't treat
# severity:warning as a non-fatal exit, unlike v2.11+.
- fieldalignment
misspell:
locale: US
revive:
Expand Down Expand Up @@ -100,12 +94,17 @@ linters:
# unusedwrite: test fixture struct fields may be set for documentation
# completeness even when only a subset of fields is read by a given subtest.
# Scoped to test files so production unusedwrite bugs remain visible.
# Note: fieldalignment is disabled globally in govet.disable (many
# pre-existing production violations; separate cleanup PR needed).
- linters:
- govet
text: "unusedwrite"
path: _test\.go
# fieldalignment: test-table memory layout is irrelevant, and reordering
# positional table literals risks silent misassignment. Production code
# stays checked.
- linters:
- govet
text: "fieldalignment:"
path: _test\.go
- linters:
- all
path: .*_gen\.go
Expand Down
4 changes: 2 additions & 2 deletions cmd/archera_render.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ type archeraDeltaDTO struct {
BreakevenDays *string `json:"breakeven_days"`
}

type archeraOfferDTO struct {
type archeraOfferDTO struct { //nolint:govet // fieldalignment: field order is the JSON output contract (testdata/archera_json.golden)
IsCurrent bool `json:"is_current"`
OfferID string `json:"offer_id"`
CommitmentType string `json:"commitment_type"`
Expand All @@ -143,7 +143,7 @@ type archeraRowDTO struct {

// archeraComparisonDTO is the CLI's stable JSON contract. Money values are
// exact decimal strings; null means unknown, never zero.
type archeraComparisonDTO struct {
type archeraComparisonDTO struct { //nolint:govet // fieldalignment: field order is the JSON output contract (testdata/archera_json.golden)
Title string `json:"title"`
PlanID string `json:"plan_id"`
FetchedAt string `json:"fetched_at"`
Expand Down
34 changes: 17 additions & 17 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,21 @@ type Config struct {
// CallerAccountID is the account the credentials belong to (STS
// GetCallerIdentity), set at run start. Purchases are refused for
// recommendations owned by any other account.
CallerAccountID string
AuditLog string
CSVInput string
IdempotencyWindow string
ValidationProfile string
Profile string
PaymentOption string
CSVOutput string
CallerAccountID string
AuditLog string
CSVInput string
IdempotencyWindow string
ValidationProfile string
Profile string
PaymentOption string
CSVOutput string
SPAccountScope string
// RecLookbackPeriod controls the LookbackPeriodInDays passed to
// GetReservationPurchaseRecommendation. Valid values: "7d", "30d", "60d"
// (recommendations.DefaultRecLookbackPeriod is the shared default).
// A longer window smooths seasonal spikes; a shorter window weights
// recent demand more heavily.
RecLookbackPeriod string
Regions []string
Services []string
ExcludeAccounts []string
Expand All @@ -60,17 +67,16 @@ type Config struct {
ExcludeEngines []string
ExcludeSPTypes []string
IncludeSPTypes []string
SPAccountScope string
MaxBreakEvenMonths int
TargetCoverage float64
Coverage float64
MinPoolSize float64
MinSavingsPct float64
MaxBreakEvenMonths int
RebuyWindowDays int
TermYears int
CoverageLookbackDays int
MinCount int
IdempotencyWindowHours int
MinSavingsPct float64
OverrideCount int32
MaxInstances int32
IncludeExtendedSupport bool
Expand All @@ -82,12 +88,6 @@ type Config struct {
// Count when no coverage was asked for (determineCSVCoverage). A Config
// built in code leaves it false, so its Coverage is always honored.
CoverageFromDefault bool
// RecLookbackPeriod controls the LookbackPeriodInDays passed to
// GetReservationPurchaseRecommendation. Valid values: "7d", "30d", "60d"
// (recommendations.DefaultRecLookbackPeriod is the shared default).
// A longer window smooths seasonal spikes; a shorter window weights
// recent demand more heavily.
RecLookbackPeriod string
}

func main() {
Expand Down
Loading