Merge changes from topic 'clang-format' into nextgenv2
* changes: remove tools/vpx-style.sh README: add a note about clang-format
This commit is contained in:
15
README
15
README
@@ -127,6 +127,21 @@ VP8/VP9 TEST VECTORS:
|
|||||||
$ ./configure --enable-unit-tests
|
$ ./configure --enable-unit-tests
|
||||||
$ LIBVPX_TEST_DATA_PATH=../libvpx-test-data make testdata
|
$ LIBVPX_TEST_DATA_PATH=../libvpx-test-data make testdata
|
||||||
|
|
||||||
|
CODE STYLE:
|
||||||
|
The coding style used by this project is enforced with clang-format using the
|
||||||
|
configuration contained in the .clang-format file in the root of the
|
||||||
|
repository.
|
||||||
|
|
||||||
|
Before pushing changes for review you can format your code with:
|
||||||
|
# Apply clang-format to modified .c, .h and .cc files
|
||||||
|
$ clang-format -i --style=file \
|
||||||
|
$(git diff --name-only --diff-filter=ACMR '*.[hc]' '*.cc')
|
||||||
|
|
||||||
|
Check the .clang-format file for the version used to generate it if there is
|
||||||
|
any difference between your local formatting and the review system.
|
||||||
|
|
||||||
|
See also: http://clang.llvm.org/docs/ClangFormat.html
|
||||||
|
|
||||||
SUPPORT
|
SUPPORT
|
||||||
This library is an open source project supported by its community. Please
|
This library is an open source project supported by its community. Please
|
||||||
please email webm-discuss@webmproject.org for help.
|
please email webm-discuss@webmproject.org for help.
|
||||||
|
@@ -32,7 +32,7 @@ vpx_style() {
|
|||||||
for f; do
|
for f; do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
*.h|*.c|*.cc)
|
*.h|*.c|*.cc)
|
||||||
"${dirname_self}"/vpx-astyle.sh "$f"
|
clang-format -i --style=file "$f"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -102,9 +102,8 @@ CLEAN_FILES="${CLEAN_FILES} ${ORIG_COMMIT_MSG} ${NEW_COMMIT_MSG}"
|
|||||||
# Preconditions
|
# Preconditions
|
||||||
[ $# -lt 2 ] || usage
|
[ $# -lt 2 ] || usage
|
||||||
|
|
||||||
# Check that astyle supports pad-header and align-pointer=name
|
if ! clang-format -version >/dev/null 2>&1; then
|
||||||
if ! astyle --pad-header --align-pointer=name < /dev/null; then
|
log "clang-format not found"
|
||||||
log "Install astyle v1.24 or newer"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -1,27 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
astyle --style=java --indent=spaces=2 --indent-switches\
|
|
||||||
--min-conditional-indent=0 \
|
|
||||||
--pad-oper --pad-header --unpad-paren \
|
|
||||||
--align-pointer=name \
|
|
||||||
--indent-preprocessor --convert-tabs --indent-labels \
|
|
||||||
--suffix=none --quiet --max-instatement-indent=80 "$@"
|
|
||||||
# Disabled, too greedy?
|
|
||||||
#sed -i 's;[[:space:]]\{1,\}\[;[;g' "$@"
|
|
||||||
|
|
||||||
sed_i() {
|
|
||||||
# Incompatible sed parameter parsing.
|
|
||||||
if sed -i 2>&1 | grep -q 'requires an argument'; then
|
|
||||||
sed -i '' "$@"
|
|
||||||
else
|
|
||||||
sed -i "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
sed_i -e 's/[[:space:]]\{1,\}\([,;]\)/\1/g' \
|
|
||||||
-e 's/[[:space:]]\{1,\}\([+-]\{2\};\)/\1/g' \
|
|
||||||
-e 's/,[[:space:]]*}/}/g' \
|
|
||||||
-e 's;//\([^/[:space:]].*$\);// \1;g' \
|
|
||||||
-e 's/^\(public\|private\|protected\):$/ \1:/g' \
|
|
||||||
-e 's/[[:space:]]\{1,\}$//g' \
|
|
||||||
"$@"
|
|
Reference in New Issue
Block a user