forked from docker/libcompose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add a validate-lint target (and script/validate-lint that does the job) - Add the first package that is covered by it : version. Related to docker#14
- Loading branch information
1 parent
161d9b8
commit a16868e
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
# We will eventually get to the point when packages should be the complete list | ||
# of subpackages, vendoring excluded, as given by: | ||
# | ||
# packages=( $(go list ./... 2> /dev/null | grep -vE "^github.com/docker/docker/vendor" || true ) ) | ||
|
||
packages=( | ||
version | ||
) | ||
|
||
errors=() | ||
for p in "${packages[@]}"; do | ||
# Run golint on package/*.go file explicitly to validate all go files | ||
# and not just the ones for the current platform. | ||
failedLint=$(golint "$p"/*.go) | ||
if [ "$failedLint" ]; then | ||
errors+=( "$failedLint" ) | ||
fi | ||
done | ||
|
||
if [ ${#errors[@]} -eq 0 ]; then | ||
echo 'Congratulations! All Go source files have been linted.' | ||
else | ||
{ | ||
echo "Errors from golint:" | ||
for err in "${errors[@]}"; do | ||
echo "$err" | ||
done | ||
echo | ||
echo 'Please fix the above errors. You can test via "golint" and commit the result.' | ||
echo | ||
} >&2 | ||
false | ||
fi |