From a4739597c0e7e1c36921186b9931af705637dc0d Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 2 Jan 2020 10:40:41 -0500 Subject: [PATCH] Fix #24, Enforce style in CI --- .travis.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ff31aa1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,40 @@ +dist: bionic +sudo: required +language: + - c +compiler: + - gcc +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - cmake + +before_install: + - sudo apt-get install cppcheck + - cppcheck --version + # for clang-format 10 + - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + - sudo add-apt-repository 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main' + - sudo apt-get update + - sudo apt-get install clang-format-10 + - clang-format-10 --version + + +script: + # Get bundle (doesn't populate submodules, not needed for style enforcement) + - cd .. + - git clone https://github.com/nasa/cFS.git + - mv ci_lab cFS/app + - cd cFS/app/ci_lab + # Enforce formatting + - find . -name "*.[ch]" -exec clang-format-10 -i -style=file {} + + - git diff > style_differences.txt + - | + if [[ -s style_differences.txt ]]; then + echo "You must fix style differences before submitting a pull request" + echo "" + cat style_differences.txt + exit -1 + fi