1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Revert "Dealing with trailing whitespaces"

The validation script from #10681 is too pedantic, and does not handle
well situations like:

```
cat <<EOF   # or <<-EOF
	Whether the leading whitespace is stripped out or not by bash
	it should still be considered as valid.
EOF
```

This reverts commit 4e65c1c319.

Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
Tibor Vass 2015-03-25 09:56:49 -06:00
parent f08e9f44a9
commit 0252ad0adc
21 changed files with 111 additions and 145 deletions

View file

@ -77,7 +77,7 @@ test-docker-py: build
$(DOCKER_RUN_DOCKER) hack/make.sh binary test-docker-py $(DOCKER_RUN_DOCKER) hack/make.sh binary test-docker-py
validate: build validate: build
$(DOCKER_RUN_DOCKER) hack/make.sh validate-gofmt validate-dco validate-toml validate-spaces $(DOCKER_RUN_DOCKER) hack/make.sh validate-gofmt validate-dco validate-toml
shell: build shell: build
$(DOCKER_RUN_DOCKER) bash $(DOCKER_RUN_DOCKER) bash

View file

@ -45,7 +45,6 @@ DEFAULT_BUNDLES=(
validate-dco validate-dco
validate-gofmt validate-gofmt
validate-toml validate-toml
validate-spaces
binary binary

View file

@ -1,33 +0,0 @@
#!/bin/bash
source "$(dirname "$BASH_SOURCE")/.validate"
#Ignoring files from vendor/, builder/parser/testfiles*, docs/theme/mkdocs/tipuesearch*, ending with .md and .go
ignoreFiles='^builder/parser/testfiles*|^docs/theme/mkdocs/tipuesearch*|^vendor/|\.md$|\.go$'
IFS=$'\n'
files=( $(validate_diff --diff-filter=ACMR --name-only | grep -v "$ignoreFiles" || true) )
unset IFS
badFiles=()
for f in "${files[@]}"; do
if [ "$(git show "$VALIDATE_HEAD:$f" | grep '[[:space:]]$')" ]; then
badFiles+=( "$f" )
fi
done
if [ ${#badFiles[@]} -eq 0 ]; then
echo 'Congratulations! All text files are properly formatted.'
else
{
echo "These files have trailing whitespaces:"
for f in "${badFiles[@]}"; do
echo " - $f"
done
echo
echo 'Please reformat the above files using, for example:'
echo '"ex -sc "'"%s/[[:space:]]*$//g|x"'" file" and commit the result.'
echo
} >&2
false
fi