forked from yedf2/handy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request yedf2#45 from jovan-wong/clang_format_2
Format code by clang-format tool and enable in CI.
- Loading branch information
Showing
70 changed files
with
2,488 additions
and
1,763 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
BasedOnStyle: Chromium | ||
ColumnLimit: 160 | ||
IndentWidth: 4 | ||
DerivePointerAlignment: false | ||
IndentCaseLabels: false | ||
PointerAlignment: Right | ||
SpaceAfterCStyleCast: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,30 @@ | ||
sudo: required | ||
|
||
language: cpp | ||
compiler: g++ | ||
before_install: | ||
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | ||
- sudo apt-get update -qq | ||
install: | ||
- sudo apt-get install -qq g++-4.8 | ||
- export CXX="g++-4.8" | ||
script: make && sudo ./handy_test | ||
notifications: | ||
email: true | ||
|
||
matrix: | ||
include: | ||
# Job1: This is the job of building project in linux os. | ||
- os: linux | ||
dist: trusty | ||
before_install: | ||
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | ||
- sudo apt-get update -qq | ||
install: | ||
- sudo apt-get install -qq g++-4.8 | ||
- export CXX="g++-4.8" | ||
script: make && sudo ./handy_test | ||
notifications: | ||
email: true | ||
|
||
# Job2: This is the job of checking code style. | ||
- os: linux | ||
dist: trusty | ||
env: LINT=1 PYTHON=2.7 | ||
before_install: | ||
- sudo apt-get update -qq | ||
- sudo apt-get install -qq clang-format-3.8 | ||
install: [] | ||
script: | ||
- sudo bash .travis/check-git-clang-format.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
if [ "$TRAVIS_PULL_REQUEST" == "true" ] ; then | ||
base_commit="$TRAVIS_BRANCH" | ||
else | ||
base_commit="HEAD^" | ||
fi | ||
|
||
output="$(sudo python .travis/git-clang-format --binary clang-format-3.8 --commit $base_commit --diff)" | ||
|
||
if [ "$output" == "no modified files to format" ] || [ "$output" == "clang-format did not modify any files" ] ; then | ||
echo "clang-format passed." | ||
exit 0 | ||
else | ||
echo "clang-format failed." | ||
echo "$output" | ||
exit 1 | ||
fi |
Oops, something went wrong.