Skip to content

Commit

Permalink
[FAB-12440] disable goimports in linting
Browse files Browse the repository at this point in the history
The upstream x/tools repo merged changes to goimports as "improvements"
that are incompatible with existing code in fabric. Since we pull and
build the tools from master on every build, we get what we get.

Disable goimports.

Change-Id: I4b5bcaf5befe4e3f4f40f393d8d4e363890ed2b4
Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
  • Loading branch information
sykesm committed Oct 12, 2018
1 parent 82d9058 commit b6218b1
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions scripts/golinter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ if [ -n "$OUTPUT" ]; then
exit 1
fi

echo "Checking with goimports"
OUTPUT="$(goimports -l ${source_dirs} | grep -Ev '(^|/)testdata/' || true)"
if [ -n "$OUTPUT" ]; then
echo "The following files contain goimports errors"
echo $OUTPUT
echo "The goimports command 'goimports -l -w' must be run for these files"
exit 1
fi
# https://github.com/golang/tools/commit/12a7c317e894c0a622b5ed27f0a102fcdd56d1ad
# breaks import grouping.
#
# echo "Checking with goimports"
# OUTPUT="$(goimports -l ${source_dirs} | grep -Ev '(^|/)testdata/' || true)"
# if [ -n "$OUTPUT" ]; then
# echo "The following files contain goimports errors"
# echo $OUTPUT
# echo "The goimports command 'goimports -l -w' must be run for these files"
# exit 1
# fi

# Now that context is part of the standard library, we should use it
# consistently. The only place where the legacy golang.org version should be
Expand All @@ -51,4 +54,4 @@ if [ -n "$OUTPUT" ]; then
echo "The following files contain go vet errors"
echo $OUTPUT
exit 1
fi
fi

0 comments on commit b6218b1

Please sign in to comment.