Skip to content

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
Co-authored-by: Anton Telyshev <[email protected]>
@ldez ldez merged commit d7a461a into golangci:master Feb 15, 2024
@ldez ldez deleted the feat/revive-exclude branch February 15, 2024 18:52
@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