forked from dlang/phobos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
24 lines (24 loc) · 1.34 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
sudo: false
os: linux
language: d
d: dmd-2.071.0
install:
- wget "https://raw.githubusercontent.com/dlang/dmd/master/src/checkwhitespace.d" -O ../checkwhitespace.d
- git clone https://github.com/Hackerpilot/Dscanner
- (cd Dscanner && git checkout tags/v0.4.0-alpha6)
- (cd Dscanner && git submodule update --init --recursive)
# debug build is faster, but disable 'missing import' messages (missing core from druntime)
- (cd Dscanner && sed 's/dparse_verbose/StdLoggerDisableWarning/' -i makefile && make githash debug)
# avoid checking it's dscanner's directory
- mv Dscanner/dsc .
- rm -rf Dscanner
script:
- (cd .. && rdmd ./checkwhitespace.d $(find phobos -name '*.d'))
# enforce whitespace between statements
- grep -nE "(for|foreach|foreach_reverse|if|while|switch|catch)\(" $(find . -name '*.d'); test $? -eq 1
# enforce whitespace between colon(:) for import statements (doesn't catch everything)
- grep -n 'import [^/,=]*:.*;' $(find . -name '*.d') | grep -vE "import ([^ ]+) :\s"; echo $?
# enforce all-man style
- grep -nE '(if|for|foreach|foreach_reverse|while|unittest|switch|else|version) .*{$' $(find . -name '*.d'); test $? -eq 1
# at the moment libdparse has problems to parse some modules (->excludes)
- ./dsc --config .dscanner.ini --styleCheck $(find etc std -type f -name '*.d' | grep -vE 'std/traits.d|std/typecons.d|std/conv.d') -I.