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
26 changes: 22 additions & 4 deletions src/compute-plane-services/nvcf-unbound/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

version: "2"
linters:
enable:
- goheader

linters-settings:
goheader:
template-path: goheader.tmpl
settings:
goheader:
template-path: goheader.tmpl
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
196 changes: 96 additions & 100 deletions src/compute-plane-services/nvsnap/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,115 +2,111 @@
# SPDX-License-Identifier: Apache-2.0

# NVSNAP golangci-lint configuration
version: "2"
run:
timeout: 5m
modules-download-mode: readonly

linters:
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- gofmt
- goimports
- bodyclose
- copyloopvar
- errorlint
- gocritic
- gosec
- misspell
- unconvert
- unparam
- nakedret
- noctx
- prealloc
- copyloopvar
- gocritic
- revive
- bodyclose
- noctx
- gosec
- errorlint

linters-settings:
goimports:
local-prefixes: github.com/NVIDIA/nvcf/src/compute-plane-services/nvsnap

govet:
enable:
- shadow

revive:
- unconvert
- unparam
settings:
errorlint:
errorf: true
asserts: true
comparison: true
gocritic:
disabled-checks:
- hugeParam # We pass large structs by value intentionally in some cases
enabled-tags:
- diagnostic
- style
- performance
gosec:
excludes:
- G104 # Audit errors not checked - we handle this case by case
- G304 # Potential file inclusion - necessary for our use case
# Permissive dir/file perms are intentional: restored pods run as a
# different uid (distroless 65532) than the capturing agent, so the
# cache/checkpoint/blob trees these rules flag MUST stay world-readable
# for cross-uid restore to work. Tightening them breaks restore.
- G301 # dir perms (MkdirAll 0755) — see above
- G302 # file perms on chmod — see above
- G306 # WriteFile perms (0644) — see above
govet:
enable:
- shadow
revive:
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
exclusions:
generated: lax
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf

gosec:
excludes:
- G104 # Audit errors not checked - we handle this case by case
- G304 # Potential file inclusion - necessary for our use case
# Permissive dir/file perms are intentional: restored pods run as a
# different uid (distroless 65532) than the capturing agent, so the
# cache/checkpoint/blob trees these rules flag MUST stay world-readable
# for cross-uid restore to work. Tightening them breaks restore.
- G301 # dir perms (MkdirAll 0755) — see above
- G302 # file perms on chmod — see above
- G306 # WriteFile perms (0644) — see above

errorlint:
errorf: true
asserts: true
comparison: true

gocritic:
enabled-tags:
- diagnostic
- style
- performance
disabled-checks:
- hugeParam # We pass large structs by value intentionally in some cases

# Test files can have longer functions
- linters:
- funlen
path: _test\.go
# Allow dot imports in tests
- linters:
- revive
path: _test\.go
text: dot-imports
# Generated files
- linters:
- all
path: zz_generated
# API types have many fields
- linters:
- revive
path: pkg/apis/
text: 'exported:'
paths:
# Third-party vendored code (npm package that happens to ship a .go file).
- ui/node_modules
- third_party$
- builtin$
- examples$
issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0

# Third-party vendored code (npm package that happens to ship a .go file).
exclude-dirs:
- ui/node_modules

exclude-rules:
# Test files can have longer functions
- path: _test\.go
linters:
- funlen

# Allow dot imports in tests
- path: _test\.go
linters:
- revive
text: "dot-imports"

# Generated files
- path: zz_generated
linters:
- all

# API types have many fields
- path: pkg/apis/
linters:
- revive
text: "exported:"
formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/NVIDIA/nvcf/src/compute-plane-services/nvsnap
exclusions:
generated: lax
paths:
- ui/node_modules
- third_party$
- builtin$
- examples$
Loading