sourcegraph / srclib

srclib is a polyglot code analysis library, built for hackability. It consists of language analysis toolchains (currently for Go and Java, with Python, JavaScript, and Ruby in beta) with a common output format, and a CLI tool for running the analysis.
https://srclib.org
Other
942 stars 62 forks source link

New source unit format #293

Closed beyang closed 8 years ago

beyang commented 8 years ago

This change simplifies the source unit data structure, removing the old RepoSourceUnit and SourceUnit and replacing it with a SourceUnit data structure defined in protobuf.

The motivation behind this change is to make it possible to support "global deps" (i.e., source unit resolution at the application layer) with a cleaner API.

In the process, this also deprecates / removes some configuration functionality that is unused by any existing toolchain (the Config field for the Srcfile format and the Ops field).

Most of the remaining is just changes to test files in response to the data structure change.

keegancsmith commented 8 years ago

LGTM!

So the most useful change to this is splitting out the Key part of a SourceUnit. That accomplishes the cleaner API goal stated in the PR description?

A lot of the commits here are fixup commits. Could you squash them before merging? Doing that before submitting for review would of also been cool :)

In the process, this also deprecates / removes some configuration functionality that is unused by any existing toolchain (the Config field for the Srcfile format and the Ops field).

If it is unused, can't we just remove it?

The JSON serialization of the new SourceUnit is backward compatible with the old SourceUnit.

What testing have you done for this? From reading the code it seems alright, but we have a lot of existing data you could test against.

beyang commented 8 years ago

squashed and pushed.

beyang commented 8 years ago

merge-squashed