mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #11751 from tiborvass/revert-validate-spaces
Revert "Dealing with trailing whitespaces"
This commit is contained in:
commit
a0cfe83435
21 changed files with 111 additions and 145 deletions
2
Makefile
2
Makefile
|
@ -77,7 +77,7 @@ test-docker-py: build
|
|||
$(DOCKER_RUN_DOCKER) hack/make.sh binary test-docker-py
|
||||
|
||||
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
|
||||
$(DOCKER_RUN_DOCKER) bash
|
||||
|
|
|
@ -45,7 +45,6 @@ DEFAULT_BUNDLES=(
|
|||
validate-dco
|
||||
validate-gofmt
|
||||
validate-toml
|
||||
validate-spaces
|
||||
|
||||
binary
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue