aboutsummaryrefslogtreecommitdiff
path: root/.travis.yml
diff options
context:
space:
mode:
authorCarl Smedstad <carl.smedstad@protonmail.com>2021-03-16 03:23:38 +0100
committerGitHub <noreply@github.com>2021-03-15 23:23:38 -0300
commite55ff19c961b799774303d1c38a581693af289a2 (patch)
treeeb4d4d7533a42056a4787abd6478ae89c99baf46 /.travis.yml
parent930acb2baa1a34dbf71c1b3f79492a2e598ecf61 (diff)
downloadluarocks-e55ff19c961b799774303d1c38a581693af289a2.tar.gz
luarocks-e55ff19c961b799774303d1c38a581693af289a2.tar.bz2
luarocks-e55ff19c961b799774303d1c38a581693af289a2.zip
Run Luacheck in CI & fix reported errors (#1285)
Tried to do this as non-intrusively as possible, mostly by ignoring the issues in-line. Set the option unused_secondaries to false as suggested by @hishamhm. This makes named but ununsed return values, that serves a documenting purpose, allowed.
Diffstat (limited to '.travis.yml')
-rw-r--r--.travis.yml18
1 files changed, 14 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml
index f5b6bb37..b1872483 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,11 +17,14 @@ smoke_script: &smoke_script
17 - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) 17 - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
18 - ./makedist $BRANCH 18 - ./makedist $BRANCH
19 - ./smoke_test.sh luarocks-$BRANCH.tar.gz 19 - ./smoke_test.sh luarocks-$BRANCH.tar.gz
20 20
21lint_script: &lint_script
22 - luacheck .
23
21unit_script: &unit_script 24unit_script: &unit_script
22 - busted -o htest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis" 25 - busted -o htest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis"
23 - busted -o htest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis,env=full" 26 - busted -o htest --exclude-tags=git,integration --verbose -Xhelper "lua_dir=$PWD/lua_install,travis,env=full"
24 27
25integration_script: &integration_script 28integration_script: &integration_script
26 - lua -v 29 - lua -v
27 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then shellcheck ./configure; fi 30 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then shellcheck ./configure; fi
@@ -30,7 +33,7 @@ integration_script: &integration_script
30 - ./smoke_test.sh luarocks-dev.tar.gz 33 - ./smoke_test.sh luarocks-dev.tar.gz
31 - busted -o htest --exclude-tags=gpg,git,unit --verbose -Xhelper "lua_dir=$PWD/lua_install,travis" 34 - busted -o htest --exclude-tags=gpg,git,unit --verbose -Xhelper "lua_dir=$PWD/lua_install,travis"
32 - busted -o htest --exclude-tags=gpg,git,unit --verbose -Xhelper "lua_dir=$PWD/lua_install,travis,env=full" 35 - busted -o htest --exclude-tags=gpg,git,unit --verbose -Xhelper "lua_dir=$PWD/lua_install,travis,env=full"
33 36
34jobs: 37jobs:
35 include: 38 include:
36 # Smoke tests for release branches 39 # Smoke tests for release branches
@@ -47,6 +50,12 @@ jobs:
47 language: generic 50 language: generic
48 env: 51 env:
49 - LUA="luajit=2.1" 52 - LUA="luajit=2.1"
53 # Lint with Luacheck
54 - stage: Lint with Luacheck
55 script: *lint_script
56 os: linux
57 env:
58 - LUA="lua=5.3"
50 # Unit tests for linux 59 # Unit tests for linux
51 - stage: Unit on Linux 60 - stage: Unit on Linux
52 script: *unit_script 61 script: *unit_script
@@ -139,7 +148,7 @@ jobs:
139 env: 148 env:
140 - LUA="luajit=2.1" 149 - LUA="luajit=2.1"
141 language: generic 150 language: generic
142 151
143before_install: 152before_install:
144 - if [ ! -f lua_install/bin/luarocks ]; then pip install hererocks; fi 153 - if [ ! -f lua_install/bin/luarocks ]; then pip install hererocks; fi
145 - if [ ! -f lua_install/bin/luarocks ]; then hererocks lua_install -r^ --$LUA; fi 154 - if [ ! -f lua_install/bin/luarocks ]; then hererocks lua_install -r^ --$LUA; fi
@@ -148,6 +157,7 @@ before_install:
148install: 157install:
149 - if [ ! -f lua_install/bin/busted ]; then luarocks install busted; fi 158 - if [ ! -f lua_install/bin/busted ]; then luarocks install busted; fi
150 - if [ ! -f lua_install/bin/luacov ]; then luarocks install cluacov; fi 159 - if [ ! -f lua_install/bin/luacov ]; then luarocks install cluacov; fi
160 - if [ ! -f lua_install/bin/luacheck ]; then luarocks install luacheck; fi
151 - luarocks install busted-htest 161 - luarocks install busted-htest
152 162
153after_success: 163after_success: