From 879d560f5284a1ede9208baaf1355dcf800194fc Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 9 Oct 2016 14:51:24 -0400 Subject: [PATCH] run cpplint.py on travis (#1200) run cpplint.py on travis --- .travis.yml | 9 +++++++-- test/test_dht.cpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad836297d..4156e3a51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ language: cpp matrix: include: - - env: variant=test_release coverage=1 toolset=gcc-coverage + - env: variant=test_barebones toolset=gcc lint=1 - env: variant=test_debug sim=1 ssl=openssl crypto=libcrypto toolset=gcc-ubsan - - env: variant=test_barebones toolset=gcc + - env: variant=test_release coverage=1 toolset=gcc-coverage - env: autotools=1 toolset=gcc - os: osx osx_image: xcode6.4 @@ -88,6 +88,7 @@ install: - 'echo "using darwin : : ccache clang++ : -std=c++11 ;" >> ~/user-config.jam' - 'echo "using python : 2.7 ;" >> ~/user-config.jam' - if [ "$docs" == "1" ]; then rst2html.py --version; fi + - 'if [ "$lint" == "1" ]; then curl "https://raw.githubusercontent.com/google/styleguide/71ec7f1e524969c19ce33cfc72e8e023f2b98ee2/cpplint/cpplint.py" >~/cpplint.py; fi' # osx builds need to disable the deprecated warning because of the openssl # shipping with the system having marked all functions as deprecated. Since @@ -119,6 +120,10 @@ script: fi' - cd .. + - 'if [ "$lint" == "1" ]; then + python ~/cpplint.py --extensions=cpp --headers=hpp --filter=-,+runtime/explicit --linelength=90 test/*.{cpp,hpp} src/*.cpp include/libtorrent/*.hpp include/libtorrent/kademlia/*.hpp src/kademlia/*.cpp include/libtorrent/aux_/*.hpp include/libtorrent/extensions/*.hpp simulation/*.{cpp,hpp} tools/*.{cpp,hpp} examples/*.{cpp,hpp}; + fi' + # if variant is not set, we do not want to build anything # if we are building with code coverage, report it as soon as possible # libtorrent is the name of the test suite target diff --git a/test/test_dht.cpp b/test/test_dht.cpp index df16c105e..da41c8ba8 100644 --- a/test/test_dht.cpp +++ b/test/test_dht.cpp @@ -516,7 +516,7 @@ dht_settings test_settings() struct dht_test_setup { - dht_test_setup(udp::endpoint src) + explicit dht_test_setup(udp::endpoint src) : sett(test_settings()) , dht_storage(dht_default_storage_constructor(sett)) , source(src)