Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Ignore /vendor/ by default when linting #325

Closed
wants to merge 5 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions golint/golint.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
var (
minConfidence = flag.Float64("min_confidence", 0.8, "minimum confidence of a problem to print it")
setExitStatus = flag.Bool("set_exit_status", false, "set exit status to 1 if any issues are found")
checkVendor = flag.Bool("vendor", false, "include packages in vendor dirs when expanding ...")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree with this. cmd/go doesn't have a flag, and there is no reason why golint would need one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. As discussed in #303 we should mimic go fmt behavior (no flag).

suggestions int
)

Expand Down Expand Up @@ -51,6 +52,9 @@ func main() {
if strings.HasSuffix(arg, "/...") && isDir(arg[:len(arg)-len("/...")]) {
dirsRun = 1
for _, dirname := range allPackagesInFS(arg) {
if !*checkVendor && strings.Contains("/" + dirname, "/vendor/") {
continue
}
args = append(args, dirname)
}
} else if isDir(arg) {
Expand Down