Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
notJoon committed Oct 7, 2024
1 parent 1b032e2 commit ca71c06
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ build-mac:
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(BINARY_MAC) -v $(MAIN_PACKAGE)

test:
$(GOTEST) -race -v ./...
$(GOTEST) -race -v -shuffle=on ./...

clean:
$(GOCLEAN)
Expand Down
5 changes: 0 additions & 5 deletions internal/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ func TestReadSourceCode(t *testing.T) {
}

func TestEngine_Run_WithNoLint(t *testing.T) {
t.Parallel()

tests := []struct {
name string
source string
Expand Down Expand Up @@ -193,10 +191,7 @@ func main() {
}

for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

tempDir := createTempDir(t, "nolint_test")
fileName := createTempFile(t, tempDir, "test_*.go", tt.source)

Expand Down
4 changes: 2 additions & 2 deletions internal/nolint.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ func parseNolintComment(
var scope nolintScope
text := comment.Text

if !strings.HasPrefix(text, "//nolint") {
if !strings.HasPrefix(text, nolintPrefix) {
return scope, fmt.Errorf("invalid nolint comment")
}

prefixLen := len("//nolint")
prefixLen := len(nolintPrefix)
rest := text[prefixLen:]

if len(rest) > 0 && rest[0] != ':' {
Expand Down

0 comments on commit ca71c06

Please sign in to comment.