From 0f007b4ae58ae28b1c266f65919fe3867df33254 Mon Sep 17 00:00:00 2001 From: rubyist Date: Tue, 21 Jul 2015 07:12:45 -0400 Subject: [PATCH 1/4] Script to warn about non-vendored third party packages --- script/lint | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 script/lint diff --git a/script/lint b/script/lint new file mode 100755 index 00000000..df41ee0e --- /dev/null +++ b/script/lint @@ -0,0 +1,14 @@ +#!/bin/sh + +deps=$(go list -f '{{join .Deps "\n"}}' . | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' | grep -v "github.com/github/git-lfs") + +# exit 0 means non-vendored deps were found +if [ $? -eq 0 ]; +then + echo "Non vendored dependencies found:" + for d in $deps; do echo "\t$d"; done + exit 1 +else + echo "Looks good!" +fi + From b2bf353cca6c2cd7be195ec261f4d7c4be58b281 Mon Sep 17 00:00:00 2001 From: risk danger olson Date: Tue, 21 Jul 2015 11:14:15 -0600 Subject: [PATCH 2/4] add another helpful msg to script/lint --- script/lint | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/lint b/script/lint index df41ee0e..9e348434 100755 --- a/script/lint +++ b/script/lint @@ -7,8 +7,10 @@ if [ $? -eq 0 ]; then echo "Non vendored dependencies found:" for d in $deps; do echo "\t$d"; done + echo + echo "These dependencies should be tracked in 'Nut.toml', with an import prefix of:" + echo "\tgithub.com/github/git-lfs/vendor/_nuts" exit 1 else echo "Looks good!" fi - From 3e6b15c981ce651530c71ee3f986d5584cfea7b5 Mon Sep 17 00:00:00 2001 From: risk danger olson Date: Tue, 21 Jul 2015 11:14:26 -0600 Subject: [PATCH 3/4] run script/lint at the end of script/fmt --- script/fmt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/fmt b/script/fmt index a06f28be..6cf75e1b 100755 --- a/script/fmt +++ b/script/fmt @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh formatter=gofmt hash goimports 2>/dev/null && { @@ -12,3 +12,10 @@ for i in */ ; do $formatter -w -l "$@" "${i%?}" fi done + +msg=`script/lint` +if [ $? -ne 0 ]; +then + echo "$msg" + exit 1 +fi From 47f012979a592b7adfdbaf824306c255297e0691 Mon Sep 17 00:00:00 2001 From: risk danger olson Date: Tue, 21 Jul 2015 11:16:20 -0600 Subject: [PATCH 4/4] bash bash bash --- script/fmt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/fmt b/script/fmt index 6cf75e1b..a85b855d 100755 --- a/script/fmt +++ b/script/fmt @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash formatter=gofmt hash goimports 2>/dev/null && {