whyrusleeping / gx-go

gx subtool for golang
MIT License
80 stars 28 forks source link

Verify consistency of imports and package.json #17

Open ghost opened 7 years ago

ghost commented 7 years ago

ipfs/go-ipfs#3207 updated the goprocess imports, but missed package.json, it only continues to work because some other dependency pulls in the new goprocess version.

It would be useful if gx could check for each gx/ipfs/ import, whether there's a corresponding dependency declared in package.json.

Stebalien commented 7 years ago

Here's a shell script that does a decent job of it:

for hash in $(combine <(sed -n 's#.*"gx/ipfs/\([^/]*\)/.*#\1#p' **/*.go | sort -u) not <(jq -r '.gxDependencies | map(.hash) |.[]' < ./package.json)); do
    yes y | gx import "$hash"
done
whyrusleeping commented 7 years ago

@github close, but no cigar