Skip to content
1 change: 0 additions & 1 deletion .github/workflows/ci-pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
- name: Run lint checks
uses: golangci/golangci-lint-action@v9
with:
version: 'v2.1.6'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the rationale for removing the specific version? will it run with some latest v2?

args: "--config=./.golangci.yml"
env:
CGO_ENABLED: ${{ env.CGO_ENABLED }}
Expand Down
91 changes: 64 additions & 27 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,70 @@
version: "2"
Copy link
Collaborator

@elevran elevran Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rishi-jat "version: 2" is required and must be explicitly set (version 1 uses a different file format - see lint action failure on the PR).
Please restore this line

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, will do ASAP.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rishi-jat the latest commit is still missing the "version: 2" line and fails passing the required lint test.
Please fix and run make lint locally on your branch and ensure passing before resubmitting for review.
/hold

# Enhanced golangci-lint configuration for llm-d-inference-scheduler
# Expanded from 22 to 30+ linters for improved code quality, security, and maintainability
# Focus on practical improvements suitable for Kubernetes controller development

run:
timeout: 5m
timeout: 10m
allow-parallel-runners: true

formatters:
enable:
- goimports
- gofmt

linters:
enable:
- copyloopvar
- dupword
- durationcheck
- fatcontext
- ginkgolinter
- gocritic
- govet
- loggercheck
- misspell
- perfsprint
- revive
- unconvert
- makezero
- errcheck
- goconst
- ineffassign
- nakedret
- prealloc
- unparam
- unused
# === ORIGINAL LINTERS (maintained) ===
- copyloopvar # Loop variable capture issues (Go 1.22+)
- dupword # Duplicate words in comments
- durationcheck # Duration multiplication issues (important for k8s timers)
- fatcontext # Nested contexts in loops
- ginkgolinter # Ginkgo test framework linting (CRITICAL - heavily used)
- gocritic # Comprehensive static code analyzer
- govet # Go's built-in static analyzer
- loggercheck # Logger usage patterns (CRITICAL for controller-runtime)
- misspell # Spelling mistakes in comments
- perfsprint # fmt.Sprintf performance issues
- revive # Go best practices and style guide
- unconvert # Unnecessary type conversions
- makezero # Slice declarations with non-zero length
- errcheck # Unchecked errors (CRITICAL for robust Go code)
- goconst # Repeated strings that should be constants
- ineffassign # Ineffectual assignments
- nakedret # Naked returns in functions longer than specified length
- prealloc # Slice pre-allocation opportunities
- unparam # Unused function parameters
- unused # Unused code (helps reduce bloat)

# === NEW HIGH-VALUE ADDITIONS ===
# Formatting and style consistency
- gofmt # Ensures code is gofmt-ed
- goimports # Import organization and unused import removal

# Security enhancements
- gosec # Security vulnerability scanner
- bodyclose # Ensures HTTP response bodies are closed

# Context and resource management (critical for k8s controllers)
- contextcheck # Proper context usage patterns
- noctx # HTTP requests without context

# Character encoding safety
- asciicheck # Non-ASCII identifiers
- bidichk # Dangerous unicode character sequences

# Enhanced error handling
- errorlint # Error wrapping scheme validation
- nilerr # Nil error handling pattern issues

# Code quality improvements
- testpackage # Test package naming conventions

# Import organization for large projects
- gci # Advanced import grouping

disable:
# Linters that are too restrictive or noisy for this project type
- varnamelen # Variable name length (Go idioms favor short names)
- exhaustruct # Exhaustive struct initialization (too restrictive)
- nlreturn # Newlines before returns (too opinionated)
- wsl # Whitespace linter (too opinionated)
- lll # Line length (handled by gofmt)
- cyclop # Cyclomatic complexity (can be overly strict)
- funlen # Function length (can be overly strict)
- nestif # Nested if statements (can be overly strict)
- gocognit # Cognitive complexity (can be overly strict)
2 changes: 2 additions & 0 deletions pkg/sidecar/proxy/proxy.go
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this change be part of this PR?
Does not seem lint related. Can you please remove it from the PR?

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import (
)

const (
requestHeaderPrefillURL = "x-prefiller-url"
requestHeaderRequestID = "x-request-id"
requestHeaderRequestID = "x-request-id"

requestFieldKVTransferParams = "kv_transfer_params"
Expand Down