Skip to content

Make API for using in golangci-lint#13

Open
golangci wants to merge 31 commits intobradleyfalzon:masterfrom
golangci:master
Open

Make API for using in golangci-lint#13
golangci wants to merge 31 commits intobradleyfalzon:masterfrom
golangci:master

Conversation

@golangci
Copy link
Copy Markdown

@bradleyfalzon thank you for amazing tool revgrep, we used it in golangci-lint

return nil
}

type InputIssue interface {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

golint: exported type InputIssue should have comment or be unexported

return i.lineNumber
}

func (c *Checker) Prepare() error {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

golint: exported method Checker.Prepare should have comment or be unexported

revgrep.go Outdated
return returnErr
}

func (c Checker) IsNewIssue(i InputIssue) (hunkPos int, isNew bool) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

golint: exported method Checker.IsNewIssue should have comment or be unexported

revgrep.go Outdated
)
// found file, see if lines matched
for _, pos := range fchanges {
if pos.lineNo == int(i.Line()) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

unconvert: unnecessary conversion

@coveralls
Copy link
Copy Markdown

coveralls commented May 28, 2018

Coverage Status

Coverage increased (+13.0%) to 83.966% when pulling cd28932 on golangci:master into c04006d on bradleyfalzon:master.

golangcidev and others added 3 commits May 28, 2018 14:57
When listing the files in the current repo, don't include gitignored
files.

This way revgrep will do the expected thing on a git status that comes
up with no changed files, i.e. diff against the last commit.

see golangci/golangci-lint#183
golangci and others added 19 commits August 12, 2018 21:50
don't take gitignored files into account
Processing large git repositories with `revgrep` may result in failed
parsing due to long lines. For example:

```
$ golint ./... |& revgrep abcd1234
reading standard input: bufio.Scanner: token too long
```

From the Go documentation for Scanner:
```
Programs that need more control over error handling or large tokens, or
must run sequential scans on a reader, should use bufio.Reader instead.
```

This updates `revgrep`'s git reader to use `bufio.Reader` to avoid this
issue. For example:
```
$ golint ./... |& revgrep abcd1234
mycode.go:8:2: a blank import should be only in a main or test package,
or have a comment justifying it
```
Use bufio.Reader to handle large git histories
add flag to report changes anywhere in changed files
- use go vet instead go tool vet
- fix git init branch
- fix tests to be deterministic
@bradleyfalzon
Copy link
Copy Markdown
Owner

Should I be merging this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.