Skip to content

Commit

Permalink
Add formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Nov 17, 2019
1 parent d18bb07 commit 2432b35
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .clang-format
@@ -0,0 +1,6 @@
BasedOnStyle: LLVM
ColumnLimit: 100
IndentWidth: 4
TabWidth: 4
UseTab: ForContinuationAndIndentation
AlignTrailingComments: true
28 changes: 21 additions & 7 deletions .travis.yml
@@ -1,25 +1,33 @@
sudo: required
dist: trusty
dist: xenial

language: cpp

addons:
apt:
sources:
- llvm-toolchain-trusty
packages:
- clang-format-9

compiler:
- clang
- gcc
- clang
- gcc

env:
- CTEST_OUTPUT_ON_FAILURE=1 USE_GCC7=0
- CTEST_OUTPUT_ON_FAILURE=1 USE_GCC7=1
- BUILD=1 CTEST_OUTPUT_ON_FAILURE=1 USE_GCC7=0
- BUILD=1 CTEST_OUTPUT_ON_FAILURE=1 USE_GCC7=1

matrix:
exclude:
- compiler: clang
env: CTEST_OUTPUT_ON_FAILURE=1 USE_GCC7=1
include:
- env: FORMAT=1

before_install:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update -qq
# uncomment for ubuntu precise. not needed for >=trusty - if [ "$CXX" = "g++" ]; then sudo apt-get install -y -qq g++-4.8; export CXX="g++-4.8" CC="gcc-4.8"; else echo "yes" | sudo add-apt-repository 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main'; echo "yes" | sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main'; wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -; sudo apt-get update; sudo apt-get install -qq --allow-unauthenticated llvm-3.6 llvm-3.6-dev clang-3.6 libstdc++-4.8-dev; export CXX="clang++-3.6" CC="clang-3.6"; fi
- if [ "$USE_GCC7" = "1" ]; then sudo apt-get install -y -qq g++-7; export CXX="g++-7" CC="gcc-7"; fi
- $CXX --version
# install json-c
Expand Down Expand Up @@ -68,5 +76,11 @@ before_install:
- sudo add-apt-repository ppa:mosquitto-dev/mosquitto-ppa -y
- sudo apt-get update -qq
- sudo apt-get install -qq libmosquitto-dev

script:
- cmake . -DMETEREXEC_ROOTACCESS=OFF -DENABLE_OCR=ON -DSML_HOME=/usr/local/src/libsml/sml && make && make test
- if [ -n "$BUILD" ]; then cmake . -DMETEREXEC_ROOTACCESS=OFF -DENABLE_OCR=ON -DSML_HOME=/usr/local/src/libsml/sml && make && make test; fi
- |
if [ -n "$FORMAT" ]; then
clang-format -i include/* src/*
test -z "$(git status --porcelain)" || (git status; git diff; false)
fi

0 comments on commit 2432b35

Please sign in to comment.