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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.24"

- name: Run tests
run: go test ./...
Expand All @@ -26,9 +26,9 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.24"

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v7
with:
version: latest
version: v2.12.2
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.24"

- uses: goreleaser/goreleaser-action@v6
with:
Expand Down
23 changes: 23 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "2"

linters:
exclusions:
rules:
# AJ consistently ignores errors from best-effort cleanup calls
# (deferred Close on read handles, and Remove/RemoveAll during teardown).
# These are intentional and not worth wrapping at every call site.
- linters:
- errcheck
source: '^\s*(defer\s+)?\S+\.Close\(\)$'
- linters:
- errcheck
source: '^\s*os\.(Remove|RemoveAll|MkdirAll|WriteFile)\('
settings:
staticcheck:
# QF1012 (WriteString(fmt.Sprintf(...)) -> Fprintf) is a style quickfix and
# ST1000 (package-comment convention) is a doc-style check; neither is worth
# a repo-wide retroactive rewrite. All correctness (SA*) checks stay enabled.
checks:
- "all"
- "-QF1012"
- "-ST1000"
3 changes: 1 addition & 2 deletions cmd/aj/trace_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ var traceCmd = &cobra.Command{
conf := trace.ScorePatternWithDataFlow(patterns[i], dfCount)
savings := len(patterns[i].Steps) * 200 // rough estimate

var compilationValue int
compilationValue = ranked[i].CompilationValue
compilationValue := ranked[i].CompilationValue

annotated[i] = tui.AnnotatedPath{
Path: hp,
Expand Down
10 changes: 0 additions & 10 deletions internal/tui/graph_layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ func ComputeLayoutWithParams(g *trace.TraceGraph, params LayoutParams) *LayoutRe
return positionNodesWithParams(g, labels, layers, orderInLayer, params)
}

// buildLabels creates a display label for each node.
func buildLabels(g *trace.TraceGraph) map[uint64]string {
return buildLabelsWithWidth(g, nodeWidth)
}

// buildLabelsWithWidth creates a display label for each node with a given max width.
func buildLabelsWithWidth(g *trace.TraceGraph, nWidth int) map[uint64]string {
labels := make(map[uint64]string, len(g.Nodes))
Expand Down Expand Up @@ -302,11 +297,6 @@ func totalWeight(g *trace.TraceGraph, id uint64) int {
return w
}

// positionNodes converts layer/order assignments into pixel coordinates.
func positionNodes(g *trace.TraceGraph, labels map[uint64]string, layers, order map[uint64]int) *LayoutResult {
return positionNodesWithParams(g, labels, layers, order, DefaultLayoutParams())
}

// positionNodesWithParams converts layer/order assignments into coordinates using the given params.
func positionNodesWithParams(g *trace.TraceGraph, labels map[uint64]string, layers, order map[uint64]int, params LayoutParams) *LayoutResult {
result := &LayoutResult{
Expand Down
Loading