Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revive: add exclude option #4365

Merged
merged 2 commits into from
Feb 15, 2024
Merged

revive: add exclude option #4365

merged 2 commits into from
Feb 15, 2024

Conversation

ldez
Copy link
Member

@ldez ldez commented Feb 9, 2024

Closes #4364

To test the configuration locally, you can use this script:

#!/bin/sh -e

## setup module
rm -rf reviveexclude
mkdir reviveexclude && cd $_
go mod init helloworld

## main.go
cat > main.go  <<EOF
package main

// Foo is foo.
func Foo(a string, b string) string {
	return a
}
EOF

## main_test.go
cat > main_test.go  <<EOF
package main

// Bar is bar.
func Bar(a string, b string) string {
	return a
}
EOF

## .golangci.yml
cat > .golangci.yml  <<EOF
linters:
  disable-all: true
  enable:
    - revive

linters-settings:
  revive:
    enable-all-rules: true
    rules:
      - name: package-comments
        disabled: true
      - name: unused-parameter
#        exclude: ["~main_test.go"]
        exclude: ["TEST"]

issues:
  exclude-use-default: false
  max-issues-per-linter: 0
  max-same-issues: 0
EOF

@ldez ldez added enhancement New feature or improvement linter: update Update the linter implementation inside golangci-lint and removed enhancement New feature or improvement labels Feb 9, 2024
.golangci.reference.yml Show resolved Hide resolved
pkg/golinters/revive.go Outdated Show resolved Hide resolved
Co-authored-by: Anton Telyshev <anton.telishev@yandex.ru>
@ldez ldez merged commit d7a461a into golangci:master Feb 15, 2024
12 checks passed
@ldez ldez deleted the feat/revive-exclude branch February 15, 2024 18:52
Antonboom pushed a commit to Antonboom/golangci-lint that referenced this pull request Mar 3, 2024
@ldez ldez added this to the next milestone Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement linter: update Update the linter implementation inside golangci-lint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

revive: forward Exclude rule config
3 participants