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

cli: properly handle reading an empty json file #256

Closed emil2k closed 8 years ago

emil2k commented 8 years ago

This is related to srclib import failing with io.EOF errors while reading a JSON file. An io.EOF file is thrown by the JSON decoder if it is passed a io.Reader that immediately sends an io.EOF ( i.e. an empty file ).

@beyang

beyang commented 8 years ago

why are there empty JSON files in the first place?

emil2k commented 8 years ago

Not sure, but this will improve our logs and handle the case properly. Let's deploy this to confirm that this is the issue and then we can look into why we are getting empty JSON files.

beyang commented 8 years ago

K, LGTM deploy it, can you file the follow-up issue on yourself?

emil2k commented 8 years ago

Can you merge this? I don't have access to merge it in.