mirror of
https://github.com/containers/skopeo.git
synced 2025-08-02 07:17:46 +00:00
Use contents of local checkout instead of last commit for validation
Validating only committed files is not useful in the natural $test_everything_passes; commit; push workflow; the failures will not be caught locally, only by Travis later (and only if PRs are used instead of direct commits to master). So, use the working directory state instead of last commit for validations; and remove misleading comments in checks which already use the working directory state.
This commit is contained in:
parent
0d94172288
commit
d08a3812d2
@ -21,9 +21,7 @@ if [ -z "$VALIDATE_UPSTREAM" ]; then
|
||||
VALIDATE_COMMIT_DIFF="$VALIDATE_UPSTREAM...$VALIDATE_HEAD"
|
||||
|
||||
validate_diff() {
|
||||
if [ "$VALIDATE_UPSTREAM" != "$VALIDATE_HEAD" ]; then
|
||||
git diff "$VALIDATE_COMMIT_DIFF" "$@"
|
||||
fi
|
||||
git diff "$VALIDATE_UPSTREAM" "$@"
|
||||
}
|
||||
validate_log() {
|
||||
if [ "$VALIDATE_UPSTREAM" != "$VALIDATE_HEAD" ]; then
|
||||
|
@ -8,8 +8,7 @@ unset IFS
|
||||
|
||||
badFiles=()
|
||||
for f in "${files[@]}"; do
|
||||
# we use "git show" here to validate that what's committed is formatted
|
||||
if [ "$(git show "$VALIDATE_HEAD:$f" | gofmt -s -l)" ]; then
|
||||
if [ "$(gofmt -s -l < $f)" ]; then
|
||||
badFiles+=( "$f" )
|
||||
fi
|
||||
done
|
||||
|
@ -11,7 +11,6 @@ unset IFS
|
||||
|
||||
errors=()
|
||||
for f in "${files[@]}"; do
|
||||
# we use "git show" here to validate that what's committed passes go lint
|
||||
failedLint=$(golint "$f")
|
||||
if [ "$failedLint" ]; then
|
||||
errors+=( "$failedLint" )
|
||||
|
@ -8,7 +8,6 @@ unset IFS
|
||||
|
||||
errors=()
|
||||
for f in "${files[@]}"; do
|
||||
# we use "git show" here to validate that what's committed passes go vet
|
||||
failedVet=$(go vet "$f")
|
||||
if [ "$failedVet" ]; then
|
||||
errors+=( "$failedVet" )
|
||||
|
Loading…
Reference in New Issue
Block a user