ref: c8dd7d3b44c93a664dddc0c4619d336c6e13d2a8
parent: a75e16740e1a185d523153d86badf9b2c2bcc12e
author: Runxi Yu <runxiyu@umich.edu>
date: Mon Mar 23 01:17:52 EDT 2026
*: Lints
--- a/.golangci.yaml
+++ b/.golangci.yaml
@@ -21,6 +21,7 @@
- godox # TODO/etc comments are allowed in our codebase
- funlen # long functions are fine
- wrapcheck # rules around interface-return methods are a bit silly
+ - dogsled # definitely not an issue, ignoring returns is normal
- exhaustruct # tmp: should fix... but too annoying at the moment
- err113 # tmp: will enable when we properly use defined errors
--- a/internal/cpu/cpu.go
+++ b/internal/cpu/cpu.go
@@ -1,6 +1,8 @@
package cpu
// X86 contains x86 CPU feature flags detected at runtime.
+//
+//nolint:gochecknoglobals
var X86 struct {HasAVX2 bool
}
--- a/internal/cpu/cpu_amd64.go
+++ b/internal/cpu/cpu_amd64.go
@@ -14,7 +14,7 @@
// xgetbv with ecx = 0 is implemented in cpu_amd64.s.
func xgetbv() (eax, edx uint32)
-func init() {+func init() { //nolint:gochecknoinitsmaxID, _, _, _ := cpuid(0, 0)
if maxID < 7 {return
@@ -23,6 +23,7 @@
_, _, ecx1, _ := cpuid(1, 0)
osSupportsAVX := false
+
if ecx1&cpuidOSXSAVE != 0 {eax, _ := xgetbv()
osSupportsAVX = eax&(1<<1) != 0 && eax&(1<<2) != 0
--- a/receivepack/service/run_hook.go
+++ b/receivepack/service/run_hook.go
@@ -48,6 +48,7 @@
err error
)
+ //nolint:nestif
if quarantineName != "" {quarantineLooseRoot, err = service.opts.ObjectsRoot.OpenRoot(quarantineName)
if err != nil {--- a/refstore/files/batch_apply.go
+++ b/refstore/files/batch_apply.go
@@ -50,6 +50,7 @@
}
seenTargets[targetKey] = struct{}{}+
remainingIdx = append(remainingIdx, i)
remainingOps = append(remainingOps, op)
}
@@ -87,6 +88,7 @@
}
fatalName := batchResultName(err)
+
fatalMarked := false
for i, idx := range remainingIdx { if !fatalMarked && remainingOps[i].name == fatalName && fatalName != "" {@@ -107,6 +109,7 @@
err = executor.commitPreparedUpdates(prepared)
if err != nil {fatalName := batchResultName(err)
+
fatalMarked := false
for i, idx := range remainingIdx { if !fatalMarked && remainingOps[i].name == fatalName && fatalName != "" {--- a/refstore/files/transaction_commit.go
+++ b/refstore/files/transaction_commit.go
@@ -2,6 +2,7 @@
func (tx *Transaction) Commit() error { executor := &refUpdateExecutor{store: tx.store}+
prepared, err := executor.prepareUpdates(tx.ops)
if err != nil {return err
--- a/refstore/files/update_prepare_lock.go
+++ b/refstore/files/update_prepare_lock.go
@@ -12,6 +12,7 @@
for _, lockKey := range lockNames {lockPath := refPathFromKey(lockKey)
+
err := executor.createUpdateLock(lockPath)
if err != nil { for _, item := range prepared {--- a/refstore/files/update_prepare_resolve.go
+++ b/refstore/files/update_prepare_resolve.go
@@ -18,6 +18,7 @@
}
targets[targetKey] = struct{}{}+
prepared = append(prepared, preparedUpdate{op: op, target: target})}
--
⑨