Skip to content

Commit

Permalink
install clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
bam241 committed Jan 20, 2021
1 parent 689ab6d commit e7f8eb7
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions CI/circleci/housekeeping.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,17 @@ if [ "${REPO_SLUG}" == "svalinn/DAGMC" ] && \
fi
fi

# Run astyle check
astyle --options=astyle_google.ini \
--exclude=src/gtest \
--exclude=src/mcnp/mcnp5/Source \
--exclude=src/mcnp/mcnp6/Source \
--ignore-exclude-errors \
--suffix=none \
--recursive \
--verbose \
--formatted \
"*.cc" "*.cpp" "*.h" "*.hh" "*.hpp"
astyle_diffs=`git status --porcelain`
if [ -z "${astyle_diffs}" ]; then
apt-get install -y clang-format
# Run clang-format check
find src/ \( -name "*.hpp" -o -name "*.cpp" -o -name "*.hh" -o -name "*.cc" -o -name "*.h" \) \
\( -not -path "src/gtest*" -not -path "src/mcnp/mcnp?/Source/*" -not -path "src/pyne*" \) \
-exec clang-format -style=file -i {} \;
clang_diffs=`git status --porcelain`
if [ -z "${clang_diffs}" ]; then
echo "Style guide checker passed!"
else
echo "ERROR: Style guide checker failed. Please run astyle."
echo "astyle_diffs: ${astyle_diffs}"
echo "ERROR: Style guide checker failed. Please run clang-format."
echo "clang_diffs: ${clang_diffs}"
exit 1
fi

Expand Down

0 comments on commit e7f8eb7

Please sign in to comment.