Make API for using in golangci-lint#13
Open
golangci wants to merge 31 commits intobradleyfalzon:masterfrom
Open
Make API for using in golangci-lint#13golangci wants to merge 31 commits intobradleyfalzon:masterfrom
golangci wants to merge 31 commits intobradleyfalzon:masterfrom
Conversation
| return nil | ||
| } | ||
|
|
||
| type InputIssue interface { |
There was a problem hiding this comment.
golint: exported type InputIssue should have comment or be unexported
| return i.lineNumber | ||
| } | ||
|
|
||
| func (c *Checker) Prepare() error { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
unconvert: unnecessary conversion
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
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
Owner
|
Should I be merging this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@bradleyfalzon thank you for amazing tool
revgrep, we used it ingolangci-lint