Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/project-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
path: ${{ env.GOPATH }}/src/github.com/fluid-cloudnative/fluid

- name: Lint golang code
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
with:
version: latest
args: --timeout 10m --verbose
Expand Down
22 changes: 22 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "2"

linters:
settings:
staticcheck:
checks:
- all
# Disable quickfix suggestions (refactoring hints, not bugs)
- "-QF1001" # could apply De Morgan's law
- "-QF1004" # could use strings.ReplaceAll instead
- "-QF1007" # could merge conditional assignment into variable declaration
- "-QF1008" # could remove embedded field from selector
- "-QF1011" # could omit type from declaration
# Disable style checks that are auto-fixable but noisy
- "-ST1023" # should omit type from declaration; it will be inferred from the right-hand side

issues:
exclude-rules:
# Ignore unchecked errors in test files (common Go test pattern for setup/cleanup)
- path: "_test\\.go"
linters:
- errcheck
2 changes: 1 addition & 1 deletion pkg/ddc/juicefs/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (j *JuiceFSEngine) transformWorkers(runtime *datav1alpha1.JuiceFSRuntime, d
// send an event in runtime
msg := "cache-size & cache-dir in worker.options will be deprecated in the future, please use tieredStore.levels instead"
j.Log.Info(msg)
j.Recorder.Eventf(runtime, corev1.EventTypeWarning, common.RuntimeDeprecated, msg)
j.Recorder.Eventf(runtime, corev1.EventTypeWarning, common.RuntimeDeprecated, "%s", msg)
}

// transform mount cmd & stat cmd
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func LoadCurrentFuseGenerationFromMeta(namespace, name, runtimeType string) (str
if err != nil {
return "", errors.Wrapf(err, "failed to open metadata file %s", filePath)
}
defer file.Close()
defer func() { _ = file.Close() }()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
line := scanner.Text()
Expand Down
Loading