Skip to content

Conversation

alexandear
Copy link
Collaborator

$ revive -config revive.toml ./...
revivelib/core.go:130:3: potential datarace: return value output is captured (by-reference) in goroutine
revivelib/core.go:130:11: potential datarace: return value err is captured (by-reference) in goroutine
lint/linter_test.go:34:4: unnecessary use of formatting function "t.Fatalf", you can replace it with "t.Fatal"
rule/confusing_naming.go:117:3: avoid using built-in function "println", replace it by "fmt.Fprintln(os.Stderr, "no entry for '", holder, "'")"

@alexandear alexandear force-pushed the chore/enable-new-revive-rules branch 3 times, most recently from d291bcd to d1cdabe Compare July 10, 2025 13:35
@alexandear alexandear force-pushed the chore/enable-new-revive-rules branch from d1cdabe to 517b346 Compare July 10, 2025 13:36
@alexandear alexandear changed the title chore: enable more revive rules chore: update golangci-lint; enable a few revive rules Jul 10, 2025
@alexandear alexandear requested a review from Copilot July 10, 2025 13:43
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the linting setup by bumping the golangci-lint version, enabling additional revive rules, and fixing newly reported linter violations.

  • Bump golangci-lint action to v2.2.1
  • Enable new revive rules (datarace, time-date, time-equal, unnecessary-format, use-fmt-print)
  • Address revive/lint warnings: replaced println, fixed goroutine data race, simplified test assertion

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
rule/confusing_naming.go Replaced println with fmt.Fprintln to stderr
revivelib/core.go Fixed data race by capturing goroutine outputs in local variables
revive.toml Enabled additional revive rules
.golangci.yml Enabled same rules under golangci-lint
lint/linter_test.go Replaced t.Fatalf with t.Fatal per linter suggestion
.github/workflows/lint.yaml Updated golangci-lint version to v2.2.1
Comments suppressed due to low confidence (2)

revivelib/core.go:130

  • [nitpick] The variable name out is ambiguous; consider renaming it to formattedOutput for clarity.
		out       string

revivelib/core.go:137

  • [nitpick] Consider renaming exitChan to doneChan or signalChan for more idiomatic channel naming.
		exitChan <- true

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@ccoVeille ccoVeille left a comment

Choose a reason for hiding this comment

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

Thanks

@alexandear alexandear merged commit 594e565 into mgechev:master Jul 11, 2025
8 checks passed
@alexandear alexandear deleted the chore/enable-new-revive-rules branch July 11, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants