1
0
mirror of https://github.com/mgechev/revive.git synced 2025-10-08 22:41:54 +02:00

chore: enable formatters in golangci-lint config (#1421)

This commit is contained in:
Oleksandr Redko
2025-07-12 17:32:39 +03:00
committed by GitHub
parent 92243279ea
commit 809768cffe
12 changed files with 28 additions and 17 deletions

View File

@@ -19,19 +19,6 @@ jobs:
git diff --exit-code go.mod
git diff --exit-code go.sum
gofmt:
name: Check unformatted Go code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Run gofmt
run: |
find . -type f -name '*.go' -not -path './testdata/*' -exec gofmt -w {} +
git diff --exit-code
lint-go:
name: Lint Go
runs-on: ubuntu-latest

View File

@@ -90,6 +90,18 @@ linters:
- name: var-declaration
- name: var-naming
formatters:
enable:
- gci
- gofmt
- goimports
settings:
gci:
sections:
- standard
- default
- prefix(github.com/mgechev/revive)
issues:
# Show all issues from a linter.
max-issues-per-linter: 0

View File

@@ -18,7 +18,10 @@ build:
lint:
revive --config revive.toml ./...
golangci-lint run
fmt:
golangci-lint fmt
test:
@go test -v -race ./...

View File

@@ -10,9 +10,10 @@ import (
"strings"
"github.com/fatih/color"
"github.com/spf13/afero"
"github.com/mgechev/revive/config"
"github.com/mgechev/revive/revivelib"
"github.com/spf13/afero"
)
const (

View File

@@ -10,6 +10,7 @@ import (
"text/tabwriter"
"github.com/fatih/color"
"github.com/mgechev/revive/lint"
)

View File

@@ -6,6 +6,7 @@ import (
"strings"
"codeberg.org/chavacava/garif"
"github.com/mgechev/revive/lint"
)

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"github.com/fatih/color"
"github.com/mgechev/revive/lint"
)

View File

@@ -10,6 +10,7 @@ import (
"strings"
"github.com/mgechev/dots"
"github.com/mgechev/revive/config"
"github.com/mgechev/revive/lint"
"github.com/mgechev/revive/logging"

View File

@@ -5,6 +5,7 @@ import (
"testing"
"github.com/fatih/color"
"github.com/mgechev/revive/config"
"github.com/mgechev/revive/lint"
"github.com/mgechev/revive/revivelib"

View File

@@ -5,8 +5,9 @@ import (
"go/ast"
"go/token"
"github.com/mgechev/revive/lint"
"golang.org/x/tools/go/ast/astutil"
"github.com/mgechev/revive/lint"
)
// CognitiveComplexityRule sets restriction for maximum cognitive complexity.

View File

@@ -8,6 +8,7 @@ import (
"strings"
"github.com/fatih/structtag"
"github.com/mgechev/revive/internal/astutils"
"github.com/mgechev/revive/lint"
)

View File

@@ -1,8 +1,9 @@
package test
import (
"github.com/mgechev/revive/rule"
"testing"
"github.com/mgechev/revive/rule"
)
func TestRedundantImportAlias(t *testing.T) {