apicompat checks recent changes to a Go project for backwards incompatible changes
apicompat checks recent changes to a Go project for backwards incompatible changes
apicompat is a tool to check for the introduction of backwards incompatible changes.
apicompat:
abicheck during early developmentSecondary tasks could include:
Try at abicheck.bradleyf.id.au or via CLI:
go get -u github.com/bradleyfalzon/apicompat/cmd/apicompat
cd /your/project/dir/with/committed/changes
apicompatapicompat also comes with a command line tool, as well as being used as a library, the following are the proposed flags
and arguments for the command line tool.
…Another tool, called abichanges may also be included which will list all detected changes to assist in producing
release notes.
apicompat is currently under heavy development and refactoring. This initial version was a proof of concept and shortcuts were taken. The current tasks are focused on (but not limited to):
vendor/ directories (if this is the best place to do it, or leave it to go/type ast packages)This uses golden masters for the tests, currently (and only due to time constraints) testdata/ directory contains before.go
and after.go, which are before and after versions of a test package, each time go test is ran, the output is compared to
testdata/exp.txt, which should not change.
If adding new test cases, you should expect the test to fail as the code changes should create a difference with exp.txt.
Then, you'll need to update the golden master (see below), and commit those changes. If you add a new test case to before.go and
after.go, and the tests still pass, you've uncovered a bug within apicompat which will need a code change to fix, once
code has change, the tests should fail, so update the master, review all your changes and commit.
testdata/exp.txt for the testsgo testgo test -args updatego install && ( cd testgit; ./make.sh && apicompat )No open issues yet, or sync has not completed.