Merge branch 'travis-luac' into develop

develop
lethosor 2015-02-23 19:00:22 -05:00
commit d7036775ed
4 changed files with 44 additions and 11 deletions

@ -1,6 +1,12 @@
language: cpp
env:
matrix:
-LUA_VERSION=5.2
before_install:
- sudo apt-get install lua$LUA_VERSION
script:
- python travis/lint.py
- python travis/pr-check-base.py
- python travis/lint.py
- python travis/luac.py
notifications:
email: false

@ -178,7 +178,7 @@ function LightOverlay:placeLightFov2(pos,radius,color,f,rays)
local cy=0
for dt=0,radius,0.01 do
if math.abs(math.floor(dt*dx)-cx)>0 or math.abs(math.floor(dt*dy)-cy)> 0then
if math.abs(math.floor(dt*dx)-cx)>0 or math.abs(math.floor(dt*dy)-cy)> 0 then
local x=cx+pos.x
local y=cy+pos.y

@ -3,13 +3,14 @@ import re, os, sys
valid_extensions = ['c', 'cpp', 'h', 'hpp', 'mm', 'lua', 'rb', 'proto',
'init', 'init-example']
path_blacklist = [
'library/include/df/',
'plugins/stonesense/allegro',
'plugins/isoworld/allegro',
'plugins/isoworld/agui',
'depends/',
'.git/',
'build',
'^library/include/df/',
'^plugins/stonesense/allegro',
'^plugins/isoworld/allegro',
'^plugins/isoworld/agui',
'^depends/',
'^.git/',
'^build',
'.pb.h',
]
def valid_file(filename):
@ -93,7 +94,7 @@ def main():
sys.exit(2)
fix = (len(sys.argv) > 2 and sys.argv[2] == '--fix')
global path_blacklist
path_blacklist = map(lambda s: os.path.join(root_path, s), path_blacklist)
path_blacklist = map(lambda s: os.path.join(root_path, s.replace('^', '')) if s.startswith('^') else s, path_blacklist)
for cur, dirnames, filenames in os.walk(root_path):
for filename in filenames:

@ -0,0 +1,26 @@
import os, sys, subprocess
def main():
root_path = os.path.abspath(sys.argv[1] if len(sys.argv) > 1 else '.')
if not os.path.exists(root_path):
print('Nonexistent path: %s' % root_path)
sys.exit(2)
err = False
for cur, dirnames, filenames in os.walk(root_path):
parts = cur.replace('\\', '/').split('/')
if '.git' in parts or 'depends' in parts:
continue
if '.git' in cur:
print(parts)
for filename in filenames:
if not filename.endswith('.lua'):
continue
full_path = os.path.join(cur, filename)
try:
assert not subprocess.call(['luac' + os.environ.get('LUA_VERSION', ''), '-p', full_path])
except (subprocess.CalledProcessError, AssertionError):
err = True
sys.exit(int(err))
if __name__ == '__main__':
main()