Skip to content
Snippets Groups Projects
Commit fb9af5d7 authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon
Browse files

Add initial travis build for clang-format and flake8

parent b6710eaf
No related branches found
No related tags found
1 merge request!3Add initial travis build for clang-format and flake8
Checks: -*,cppcoreguidelines-*,google-*,llvm-*,misc-*,modernize-*,performance-*
sudo: false
language: cpp
dist: trusty
addons:
apt:
sources:
- llvm-toolchain-trusty-3.8
packages:
- clang-format-3.8
- clang-tidy-3.8
before_install:
- wget http://www.cmake.org/files/v3.7/cmake-3.7.1-Linux-x86_64.tar.gz
install:
- tar -xf cmake-3.7.1-Linux-x86_64.tar.gz
- export PATH="${PWD}/cmake-3.7.1-Linux-x86_64/bin:${PATH}"
- pip install --user flake8
script:
- cd ${TRAVIS_BUILD_DIR}
- scripts/travis/run-clang-format.sh
- ~/.local/bin/flake8 --config=flake8.cfg .
[flake8]
max-line-length: 80
max-complexity: 14
format: pylint
#!/usr/bin/env bash
if [ -z "${TRAVIS_PULL_REQUEST_BRANCH}" ]
then
echo "This is only designed to run on Pull Requests"
exit 1
else
COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../ }"
fi
# Run clang-format
DIFF="$(${TRAVIS_BUILD_DIR}/scripts/developer/git/git-clang-format --diff ${COMMIT_RANGE})"
if [ "${DIFF}" != "no modified files to format" ]
then
echo "clang-format:"
echo " Code format checks failed."
echo " Please run clang-format (or git clang-format) on your changes"
echo " before committing."
echo " The following changes are suggested:"
echo "${DIFF}"
exit 1
fi
exit 0
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