Skip to content

Commit cad2dad

Browse files
committed
fix legacy CI test
1 parent e0297c4 commit cad2dad

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

.travis.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
language: ruby
2+
sudo: false
23
rvm:
34
- 1.9.3
4-
script: rake ci
5+
56
env:
6-
- CLANG_VERSION="3.4"
7-
- CLANG_VERSION="3.5"
7+
- CLANG_VERSION="3.7"
8+
- CLANG_VERSION="3.8"
9+
810
install:
9-
- sudo sh -c "echo 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-${CLANG_VERSION} main' >> /etc/apt/sources.list"
10-
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
11-
- sudo apt-get -qq update
12-
- sudo apt-get -qq --force-yes install clang-format-${CLANG_VERSION}
1311
- bundle install
1412
- clang-format-${CLANG_VERSION} -version || true
13+
14+
script:
15+
- CLANG_FORMAT=clang-format-${CLANG_VERSION} rake ci
16+
17+
cache:
18+
- apt
19+
20+
addons:
21+
apt:
22+
packages:
23+
- clang-format-3.8
24+
- clang-format-3.7

t/clang_format_spec.vim

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
" helpers "{{{
55
" clang-format detection
66
function! s:detect_clang_format()
7-
for candidate in ['clang-format-3.4', 'clang-format', 'clang-format-HEAD', 'clang-format-3.5']
8-
if executable(candidate)
9-
return candidate
7+
if $CLANG_FORMAT !=# '' && executable($CLANG_FORMAT)
8+
return $CLANG_FORMAT
9+
endif
10+
11+
for suffix in ['-HEAD', '-3.8', '-3.7', '-3.6', '-3.5', '-3.4', '']
12+
let c = 'clang-format' . suffix
13+
if executable(c)
14+
return c
1015
endif
1116
endfor
1217
throw 'not ok because detect clang-format could not be found in $PATH'

0 commit comments

Comments
 (0)