Skip to content

Commit 36b7a5e

Browse files
committed
fix: resolve all lint issues (ineffassign, misspell nolint)
1 parent 657a805 commit 36b7a5e

6 files changed

Lines changed: 7 additions & 11 deletions

File tree

engine/budget_allocator.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,6 @@ func (ba *BudgetAllocator) Rebalance() {
276276

277277
// Shrink to the midpoint between min and current, proportional to usage.
278278
// If usage is 0.0, shrink to minimum. If usage is 0.4, shrink less.
279-
targetUsage := alloc.Usage
280-
if targetUsage < 0.1 {
281-
targetUsage = 0.1
282-
}
283279
// Target size: what would make usage ~70% at the used amount.
284280
usedTokens := int(float64(alloc.CurrentTokens) * alloc.Usage)
285281
targetSize := int(float64(usedTokens) / 0.7)

engine/error_grouper_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func TestFindGroup(t *testing.T) {
151151
eg.Add("undefined variable foo", "main.go", 10, "")
152152

153153
// Find with same normalized pattern
154-
found := eg.FindGroup("undefined variable bar")
154+
_ = eg.FindGroup("undefined variable bar")
155155
// These won't match because "foo" and "bar" are short words not quoted
156156
// Let's use a case that will match
157157
eg.Add(`cannot find "x" in scope`, "a.go", 1, "")

engine/git_provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ func parseGitConfig(content string) (string, string, string) {
603603

604604
// parseRemoteURL extracts provider, owner, and repo from a git remote URL.
605605
func parseRemoteURL(url string) (string, string, string) {
606-
provider := "github"
606+
var provider string
607607

608608
// Normalize URL
609609
url = strings.TrimSuffix(url, ".git")

eval/tasks_go.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ func Register(name, email string, age int, password string) error {
10401040
return err
10411041
}
10421042

1043-
test := `package main
1043+
_ = `package main
10441044
10451045
import "testing"
10461046
@@ -1086,7 +1086,7 @@ func TestRegisterInvalidPassword(t *testing.T) {
10861086
}
10871087
`
10881088
// Need to add strings import to test
1089-
test = `package main
1089+
test := `package main
10901090
10911091
import (
10921092
"strings"

permissions/osv_checker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func NewOSVChecker() *OSVChecker {
6262
{Package: "crossenv", Ecosystem: "npm", Advisory: "MAL-2017-0001", Severity: "CRITICAL", Description: "typosquat of cross-env - credential stealer", DateAdded: time.Date(2017, 8, 1, 0, 0, 0, 0, time.UTC)},
6363
{Package: "lodahs", Ecosystem: "npm", Advisory: "MAL-2019-0001", Severity: "HIGH", Description: "typosquat of lodash - data exfiltration", DateAdded: time.Date(2019, 6, 15, 0, 0, 0, 0, time.UTC)},
6464
{Package: "lodashs", Ecosystem: "npm", Advisory: "MAL-2019-0002", Severity: "HIGH", Description: "typosquat of lodash - data exfiltration", DateAdded: time.Date(2019, 6, 15, 0, 0, 0, 0, time.UTC)},
65-
{Package: "expresss", Ecosystem: "npm", Advisory: "MAL-2020-0001", Severity: "HIGH", Description: "typosquat of express - backdoor", DateAdded: time.Date(2020, 3, 10, 0, 0, 0, 0, time.UTC)},
65+
{Package: "expresss", Ecosystem: "npm", Advisory: "MAL-2020-0001", Severity: "HIGH", Description: "typosquat of express - backdoor", DateAdded: time.Date(2020, 3, 10, 0, 0, 0, 0, time.UTC)}, //nolint:misspell
6666
{Package: "babelcli", Ecosystem: "npm", Advisory: "MAL-2017-0002", Severity: "HIGH", Description: "typosquat of babel-cli - credential stealer", DateAdded: time.Date(2017, 8, 1, 0, 0, 0, 0, time.UTC)},
6767
{Package: "mongose", Ecosystem: "npm", Advisory: "MAL-2017-0003", Severity: "HIGH", Description: "typosquat of mongoose - credential stealer", DateAdded: time.Date(2017, 8, 1, 0, 0, 0, 0, time.UTC)},
6868
{Package: "d3.js", Ecosystem: "npm", Advisory: "MAL-2017-0004", Severity: "HIGH", Description: "typosquat of d3 - credential stealer", DateAdded: time.Date(2017, 8, 1, 0, 0, 0, 0, time.UTC)},
@@ -74,7 +74,7 @@ func NewOSVChecker() *OSVChecker {
7474
{Package: "node-request", Ecosystem: "npm", Advisory: "MAL-2019-0004", Severity: "HIGH", Description: "typosquat of request - backdoor", DateAdded: time.Date(2019, 4, 5, 0, 0, 0, 0, time.UTC)},
7575
{Package: "discordi.js", Ecosystem: "npm", Advisory: "MAL-2021-0010", Severity: "HIGH", Description: "typosquat of discord.js - token stealer", DateAdded: time.Date(2021, 9, 1, 0, 0, 0, 0, time.UTC)},
7676
{Package: "discord.jss", Ecosystem: "npm", Advisory: "MAL-2021-0011", Severity: "HIGH", Description: "typosquat of discord.js - token stealer", DateAdded: time.Date(2021, 9, 1, 0, 0, 0, 0, time.UTC)},
77-
{Package: "electorn", Ecosystem: "npm", Advisory: "MAL-2022-0020", Severity: "HIGH", Description: "typosquat of electron - backdoor", DateAdded: time.Date(2022, 4, 12, 0, 0, 0, 0, time.UTC)},
77+
{Package: "electorn", Ecosystem: "npm", Advisory: "MAL-2022-0020", Severity: "HIGH", Description: "typosquat of electron - backdoor", DateAdded: time.Date(2022, 4, 12, 0, 0, 0, 0, time.UTC)}, //nolint:misspell
7878
{Package: "axios-https", Ecosystem: "npm", Advisory: "MAL-2023-0001", Severity: "HIGH", Description: "typosquat of axios - data exfiltration", DateAdded: time.Date(2023, 1, 15, 0, 0, 0, 0, time.UTC)},
7979
{Package: "react-dev-utils-cdn", Ecosystem: "npm", Advisory: "MAL-2023-0002", Severity: "HIGH", Description: "typosquat - credential stealer", DateAdded: time.Date(2023, 2, 10, 0, 0, 0, 0, time.UTC)},
8080

session/checkpoint.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func (cm *CheckpointManager) FormatCheckpoints() string {
289289
now := time.Now()
290290
for i, cp := range cm.Checkpoints {
291291
age := formatAge(now.Sub(cp.Timestamp))
292-
name := cp.Name
292+
var name string
293293
if cp.Auto {
294294
name = "auto-checkpoint"
295295
} else {

0 commit comments

Comments
 (0)