Skip to content

Commit

Permalink
all: drop bright package (#1207)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg committed Feb 16, 2022
1 parent fc5746a commit 6af89ba
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 21 deletions.
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

0 comments on commit 6af89ba

Please sign in to comment.