Skip to content
Snippets Groups Projects
Commit 12f25c51 authored by Alberto Miranda's avatar Alberto Miranda :hotsprings:
Browse files

Merge branch '136-clang-format-isn-t-set-to-c-17' into 'master'

Resolve "clang-format isn't set to c++17"

Closes #136

See merge request !76
parents 880a180d 380fa917
No related branches found
No related tags found
1 merge request!76Resolve "clang-format isn't set to c++17"
Pipeline #1420 passed
......@@ -68,6 +68,6 @@ SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++14
Standard: c++17
TabWidth: 4
UseTab: Never
......@@ -29,7 +29,7 @@ image: gekkofs/gekkofs:build_env-0.8.0
check format:
stage: check format
script:
- ${CI_PROJECT_DIR}/scripts/check_format.sh -s "${CI_PROJECT_DIR}/src" -i "${CI_PROJECT_DIR}/src"
- ${CI_PROJECT_DIR}/scripts/check_format.sh -s "${CI_PROJECT_DIR}/src" -i "${CI_PROJECT_DIR}/src" -v
compile dependencies:
stage: build deps
......
......@@ -4,6 +4,7 @@ PROJECT_SRC="$(pwd)/src"
PROJECT_INCLUDE="$(pwd)/include"
RUN_FORMAT=false
CLANG_FORMAT_BIN=""
VERBOSE=false
usage_short() {
echo "
......@@ -30,6 +31,7 @@ optional arguments:
(default: looks for 'clang-format' or 'clang-format-10')
-r, --run_format run clang-formatter before formatting check
DISCLAIMER: FILES ARE MODIFIED IN PLACE!
-v, --verbose shows the diff of all files
"
}
......@@ -61,6 +63,10 @@ while [[ $# -gt 0 ]]; do
RUN_FORMAT=true
shift # past argument
;;
-v | --verbose)
VERBOSE=true
shift # past argument
;;
-h | --help)
help_msg
exit
......@@ -115,6 +121,11 @@ while IFS= read -r -d '' FILE; do
else
echo -n "$FILE "
echo "$UNFORMATTED_LINES"
if [[ "$VERBOSE" == true ]]; then
diff -u <(cat "$FILE") <($CLANG_FORMAT_BIN -style=file "$FILE")
echo "_______________________________________________________"
fi
echo
FAIL=true
fi
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment