bradleyfalzon / gopherci

GopherCI was a project to help you maintain high-quality Go projects, by checking each GitHub Pull Request, for backward incompatible changes, and a suite of other third party static analysis tools.
https://gopherci.io
BSD 2-Clause "Simplified" License
102 stars 13 forks source link

Check if GopherCI's use of revgrep is excluding some apicompat issues #86

Open bradleyfalzon opened 7 years ago

bradleyfalzon commented 7 years ago

I might be wrong, but I think this should not have been ignored

Apr 13 03:32:44 www1 gopherci[11284]: 2017/04/13 03:32:44 docker: created exec id: &{0b08d5e55ee8050754ea90715991dc2c5c6d7eb4b49da6652446222b23b07170} for cmd: [bash -c cd $GOPATH/src/github.com/fortytw2/hydrocarbon; apicompat -before 84229abe74493c7458abf90fa3ca416fb5f55638~1 ./...]
Apr 13 03:32:44 www1 gopherci[11284]: 2017/04/13 03:32:44 apicompat output:
Apr 13 03:32:44 www1 gopherci[11284]: 84229abe74493c7458abf90fa3ca416fb5f55638~1:feed.go:35: breaking change declaration removed
Apr 13 03:32:44 www1 gopherci[11284]: type Feed struct {
Apr 13 03:32:44 www1 gopherci[11284]: ID        string                `json:"id"`
Apr 13 03:32:44 www1 gopherci[11284]: CreatedAt        time.Time                `json:"created_at"`
Apr 13 03:32:44 www1 gopherci[11284]: UpdatedAt        time.Time                `json:"updated_at"`
Apr 13 03:32:44 www1 gopherci[11284]: LastRefreshedAt        pq.NullTime                `json:"last_refreshed_at"`
Apr 13 03:32:44 www1 gopherci[11284]: LastEnqueuedAt        pq.NullTime                `json:"last_enqueued_at"`
Apr 13 03:32:44 www1 gopherci[11284]: Plugin        string                `json:"plugin,omitempty"`
Apr 13 03:32:44 www1 gopherci[11284]: URL        string                `json:"url"`
Apr 13 03:32:44 www1 gopherci[11284]: Name        string                `json:"name"`
Apr 13 03:32:44 www1 gopherci[11284]: Description        string                `json:"description"`
Apr 13 03:32:44 www1 gopherci[11284]: HexColor        string                `json:"hex_color"`
Apr 13 03:32:44 www1 gopherci[11284]: IconURL        string                `json:"icon_url"`
Apr 13 03:32:44 www1 gopherci[11284]: UnreadCount        int                `json:"unread_count"`
Apr 13 03:32:44 www1 gopherci[11284]: }
Apr 13 03:32:44 www1 gopherci[11284]: 84229abe74493c7458abf90fa3ca416fb5f55638~1:feed.go:10: breaking change declaration removed
Apr 13 03:32:44 www1 gopherci[11284]: type FeedFolder struct{}
Apr 13 03:32:44 www1 gopherci[11284]: 84229abe74493c7458abf90fa3ca416fb5f55638~1:post.go:5: breaking change declaration removed
Apr 13 03:32:44 www1 gopherci[11284]: type Post struct {
Apr 13 03:32:44 www1 gopherci[11284]: ID string `json:"id" db:"id"`
Apr 13 03:32:44 www1 gopherci[11284]: }
Apr 13 03:32:44 www1 gopherci[11284]: 2017/04/13 03:32:44 revgrep found 0 issues
bradleyfalzon commented 7 years ago

Another case may be if an exported function is removed.

[bradleyf@srv4 github_flavored_markdown (master)]$ apicompat
HEAD~1:main.go:76: breaking change declaration removed
        func Header(heading atom.Atom, title string) *html.Node
[bradleyf@srv4 github_flavored_markdown (master)]$ apicompat | revgrep -d
DEBUG: diff --git a/main.go b/main.go
DEBUG: index 6354251..af3bd02 100644
DEBUG: --- a/main.go
DEBUG: +++ b/main.go
DEBUG: @@ -67,17 +67,6 @@ func Heading(heading atom.Atom, title string) *html.Node {
DEBUG:          return h
DEBUG:  }
DEBUG:
DEBUG: -// Header returns a heading HTML node with title text.
DEBUG: -// The heading comes with an anchor based on the title.
DEBUG: -//
DEBUG: -// heading can be one of atom.H1, atom.H2, atom.H3, atom.H4, atom.H5, atom.H6.
DEBUG: -//
DEBUG: -// Deprecated: Use Heading instead. This function was renamed to that, and will be deleted soon.
DEBUG: -func Header(heading atom.Atom, title string) *html.Node {
DEBUG: -        // TODO: Remove this deprecated func after 2017-02-24.
DEBUG: -        return Heading(heading, title)
DEBUG: -}
DEBUG: -
DEBUG:  // extensions for GitHub Flavored Markdown-like parsing.
DEBUG:  const extensions = blackfriday.EXTENSION_NO_INTRA_EMPHASIS |
DEBUG:          blackfriday.EXTENSION_TABLES |
DEBUG: lines changed: map[main.go:[]]
DEBUG: path: "HEAD~1:main.go", lineNo: 76, colNo: 0, msg: "breaking change declaration removed"
DEBUG: unchanged: HEAD~1:main.go:76: breaking change declaration removed
DEBUG: cannot parse file+line number:   func Header(heading atom.Atom, title string) *html.Node