Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: devzl/go-ipfs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: devzl/go-ipfs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix/unused-imports
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Jun 4, 2018

  1. remove unused gx imports

    License: MIT
    Signed-off-by: Steven Allen <steven@stebalien.com>
    Stebalien committed Jun 4, 2018
    Copy the full SHA
    978ed65 View commit details
  2. add CI step to check for unused imports

    License: MIT
    Signed-off-by: Steven Allen <steven@stebalien.com>
    Stebalien committed Jun 4, 2018
    Copy the full SHA
    3ed69a4 View commit details
Showing with 35 additions and 48 deletions.
  1. +28 −0 bin/check_gx_imports
  2. +7 −0 ci/Jenkinsfile
  3. +0 −48 package.json
28 changes: 28 additions & 0 deletions bin/check_gx_imports
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

BINS='["hang-fds", "iptb", "semver"]'

{
cat package.json
go list -json "./..."
} | jq -e --argjson bins "$BINS" --slurp -r '{
"package": .[0],
"golist": [.[1:][]]
} | {
"imported": [.package.gxDependencies[].hash],
"used": ([
.package.gxDependencies[]
| select(.name as $name | $bins | any(. == $name))
| .hash
] + [
.golist[]
| (.Imports//[]) + (.TestImports//[]) + (.XTestImports//[])
| .[]
| capture("^gx/ipfs/(?<hash>[^/]+)/")
| .hash
]) | unique
} | {
"bins": $bins,
"missing": (.used - .imported),
"orphan": (.imported - .used)
} | (., (.missing + .orphan | length) == 0)'
7 changes: 7 additions & 0 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -92,6 +92,13 @@ ansiColor('xterm') { withEnv(['TERM=xterm-color']) {
timeout(time: check_timeout, unit: 'MINUTES') {
gobuild_step(fast_build_platforms)
}
},
'gx imports': {
setupStep('linux') { run ->
timeout(time: check_timeout, units: 'MINUTES') {
run './bin/check_gx_imports'
}
}
}
)
}
48 changes: 0 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
@@ -56,18 +56,6 @@
"name": "go-multihash",
"version": "1.0.7"
},
{
"author": "satori",
"hash": "QmcBWojPoNh4qm7zvv4qiepvCnnc7ALS9qcp7TNwwxT1gT",
"name": "go.uuid",
"version": "1.1.0"
},
{
"author": "steakknife",
"hash": "QmeWQMDa5dSdP4n8WDeoY5z8L2EKVqF4ZvK4VEHsLqXsGu",
"name": "hamming",
"version": "0.0.10"
},
{
"author": "cenk",
"hash": "QmPJUtEJsm5YLUWhF6imvyCH8KZXRJa9Wup7FDMwTy5Ufz",
@@ -86,18 +74,6 @@
"name": "pb",
"version": "1.0.23"
},
{
"author": "jbenet",
"hash": "QmTKsRYeY4simJyf37K93juSq75Lo8MVCDJ7owjmf46u8W",
"name": "go-context",
"version": "1.0.0"
},
{
"author": "rs",
"hash": "QmPG2kW5t27LuHgHnvhUwbHCNHAt2eUcb4gPHqofrESUdB",
"name": "cors",
"version": "0.0.0"
},
{
"author": "dustin",
"hash": "QmPSBJL4momYnE7DcUyk2DVhD6rH488ZmHBGLbxNdhU44K",
@@ -128,12 +104,6 @@
"name": "go-datastore",
"version": "2.4.1"
},
{
"author": "codahale",
"hash": "QmV3NSS3A1kX5s28r7yLczhDsXzkgo65cqRgKFXYunWZmD",
"name": "metrics",
"version": "0.0.0"
},
{
"author": "hashicorp",
"hash": "QmVYxfoJQiZijTgPNHCHgHELvQpbsJNTg6Crmc3dQkj3yy",
@@ -152,12 +122,6 @@
"name": "base32",
"version": "0.0.2"
},
{
"author": "kubuxu",
"hash": "QmXqKGu7QzfRzFC4yd5aL9sThYx22vY163VGwmxfp5qGHk",
"name": "bbloom",
"version": "0.1.1"
},
{
"author": "jbenet",
"hash": "QmZmmuAXgX73UQmX1jRKjTGmjzq24Jinqkq8vzkBtno4uX",
@@ -474,18 +438,6 @@
"name": "sys",
"version": "0.1.0"
},
{
"author": "whyrusleeping",
"hash": "Qmc64U41EEB4nPG7wxjEqFwKJajS2f8kk5q2TvUrQf78Xu",
"name": "go-libp2p-blankhost",
"version": "0.2.7"
},
{
"author": "jbenet",
"hash": "QmWBug6eBS7AxRdCDVuSY5CnSit7cS2XnPFYJWqWDumhCG",
"name": "go-msgio",
"version": "0.0.3"
},
{
"author": "mr-tron",
"hash": "QmWFAMPqsEyUX7gDUsRVmMWz59FxSpJ1b2v6bJ1yYzo7jY",