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

all: drop bright package #1207

Merged
merged 2 commits into from Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 1 addition & 18 deletions framework/lintmain/internal/check/check.go
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/go-critic/go-critic/framework/linter"
"github.com/go-critic/go-critic/framework/lintmain/internal/hotload"
"github.com/go-toolsmith/pkgload"
"github.com/logrusorgru/aurora"
"golang.org/x/tools/go/packages"
)

Expand Down Expand Up @@ -93,7 +92,6 @@ type program struct {
checkTests bool
checkGenerated bool
shorterErrLocation bool
coloredOutput bool
verbose bool
}

Expand Down Expand Up @@ -169,7 +167,7 @@ func (p *program) checkFile(f *ast.File) {
if p.shorterErrLocation {
loc = p.shortenLocation(loc)
}
printWarning(p, c.Info.Name, loc, warn.Text)
log.Printf("%s: %s: %s\n", loc, c.Info.Name, warn.Text)
}
}
}
Expand Down Expand Up @@ -365,8 +363,6 @@ func (p *program) parseArgs() error {
`whether to check test files`)
flag.BoolVar(&p.shorterErrLocation, `shorterErrLocation`, true,
`whether to replace error location prefix with $GOROOT and $GOPATH`)
flag.BoolVar(&p.coloredOutput, `coloredOutput`, false,
`whether to use colored output`)
flag.BoolVar(&p.verbose, "v", false,
`whether to print output useful during linter debugging`)
flag.StringVar(&p.goVersion, "go", "",
Expand Down Expand Up @@ -502,19 +498,6 @@ func (p *program) shortenLocation(loc string) string {
return loc
}

func printWarning(p *program, rule, loc, warn string) {
switch {
case p.coloredOutput:
log.Printf("%v: %v: %v\n",
aurora.Magenta(aurora.Bold(loc)),
aurora.Red(rule),
warn)

default:
log.Printf("%s: %s: %s\n", loc, rule, warn)
}
}

func loadPackages(cfg *packages.Config, patterns []string) ([]*packages.Package, error) {
pkgs, err := packages.Load(cfg, patterns...)
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion go.mod
Expand Up @@ -12,7 +12,6 @@ require (
github.com/go-toolsmith/strparse v1.0.0
github.com/go-toolsmith/typep v1.0.2
github.com/google/go-cmp v0.5.6
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e
github.com/quasilyte/go-ruleguard v0.3.15
github.com/quasilyte/go-ruleguard/dsl v0.3.12
github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Expand Up @@ -18,8 +18,6 @@ github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e h1:9MlwzLdW7QSDrhDjFlsEYmxpFyIoXmYRon3dt0io31k=
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/quasilyte/go-ruleguard v0.3.1-0.20210203134552-1b5a410e1cc8/go.mod h1:KsAh3x0e7Fkpgs+Q9pNLS5XpFSvYCEVl5gP9Pp1xp30=
github.com/quasilyte/go-ruleguard v0.3.15 h1:iWYzp1z72IlXTioET0+XI6SjQdPfMGfuAiZiKznOt7g=
github.com/quasilyte/go-ruleguard v0.3.15/go.mod h1:NhuWhnlVEM1gT1A4VJHYfy9MuYSxxwHgxWoPsn9llB4=
Expand Down