Skip to content

Commit

Permalink
[Style] Fix golangci-lint rule: nolintlint (#2196)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortalHappiness authored Jun 15, 2024
1 parent 160fdee commit 7af68ac
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 4 additions & 0 deletions ray-operator/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ linters-settings:
local-prefixes: github.com/ray-project/kuberay/ray-operator
misspell:
locale: US
nolintlint:
require-explanation: true
require-specific: true
revive:
ignore-generated-header: true
rules:
Expand Down Expand Up @@ -68,6 +71,7 @@ linters:
- misspell
- nilerr
- noctx
- nolintlint
- predeclared
- revive
- staticcheck
Expand Down
2 changes: 1 addition & 1 deletion ray-operator/controllers/ray/rayjob_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ var _ = Context("RayJob in K8sJobMode", func() {

It("RayJobs's JobDeploymentStatus transitions from Running to Complete.", func() {
// Update fake dashboard client to return job info with "Succeeded" status.
getJobInfo := func(context.Context, string) (*utils.RayJobInfo, error) { //nolint:unparam
getJobInfo := func(context.Context, string) (*utils.RayJobInfo, error) { //nolint:unparam // This is a mock function so parameters are required
return &utils.RayJobInfo{JobStatus: rayv1.JobStatusSucceeded}, nil
}
fakeRayDashboardClient.GetJobInfoMock.Store(&getJobInfo)
Expand Down
3 changes: 1 addition & 2 deletions ray-operator/test/support/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ type labelSelector string

var _ Option[*metav1.ListOptions] = (*labelSelector)(nil)

// nolint: unused
// To be removed when the false-positivity is fixed.
//nolint:unused // To be removed when the false-positivity is fixed.
func (l labelSelector) applyTo(options *metav1.ListOptions) error {
options.LabelSelector = string(l)
return nil
Expand Down
5 changes: 2 additions & 3 deletions ray-operator/test/support/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ type Option[T any] interface {

type errorOption[T any] func(to T) error

// nolint: unused
// To be removed when the false-positivity is fixed.
//nolint:unused // To be removed when the false-positivity is fixed.
func (o errorOption[T]) applyTo(to T) error {
return o(to)
}
Expand All @@ -60,7 +59,7 @@ func With(t *testing.T) Test {
type T struct {
*gomega.WithT
t *testing.T
// nolint: containedctx
//nolint:containedctx //nolint:nolintlint // TODO: The reason for this lint is unknown
ctx context.Context
client Client
outputDir string
Expand Down

0 comments on commit 7af68ac

Please sign in to comment.