mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
build: enforce luacheck in travis build
This commit is contained in:
@@ -90,3 +90,7 @@ read_globals = {
|
||||
"lfs",
|
||||
"lipc",
|
||||
}
|
||||
|
||||
exclude_files = {
|
||||
"frontend/luxl.lua",
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ install:
|
||||
# luasec doesn't automatically detect 64-bit libs
|
||||
- travis_retry luarocks --local install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu
|
||||
- travis_retry luarocks --local install luacov-coveralls --server=http://rocks.moonscript.org/dev
|
||||
- travis_retry luarocks --local install luacheck
|
||||
# add local rocks to $PATH
|
||||
- eval $(luarocks path --bin)
|
||||
|
||||
@@ -68,6 +69,8 @@ script:
|
||||
- travis_retry make fetchthirdparty
|
||||
- make all
|
||||
- travis_retry make testfront
|
||||
- luacheck --no-color -q frontend | tee ./luacheck.out
|
||||
- test $(grep Total ./luacheck.out | awk '{print $2}') -le 250
|
||||
|
||||
after_success:
|
||||
- make coverage
|
||||
|
||||
@@ -144,7 +144,7 @@ local function MD5Update(ctx, buf, len)
|
||||
t = band(rshift(t, 3), 0x3f)
|
||||
|
||||
if (t > 0) then
|
||||
p = ffi.cast("unsigned char *", ctx.input + t)
|
||||
local p = ffi.cast("unsigned char *", ctx.input + t)
|
||||
|
||||
t = 64 - t
|
||||
if (len < t) then
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
local ReaderDictionary = require("apps/reader/modules/readerdictionary")
|
||||
local EventListener = require("ui/widget/eventlistener")
|
||||
local NetworkMgr = require("ui/networkmgr")
|
||||
local Translator = require("ui/translator")
|
||||
local Wikipedia = require("ui/wikipedia")
|
||||
local UIManager = require("ui/uimanager")
|
||||
local Geom = require("ui/geometry")
|
||||
local Screen = require("device").screen
|
||||
local DEBUG = require("dbg")
|
||||
local _ = require("gettext")
|
||||
|
||||
@@ -10,16 +10,15 @@ end
|
||||
function Configurable:reset()
|
||||
for key,value in pairs(self) do
|
||||
if type(value) == "number" or type(value) == "string" then
|
||||
self[key] = nil
|
||||
self[key] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Configurable:hash(sep)
|
||||
local hash = ""
|
||||
local excluded = {multi_threads = true,}
|
||||
for key,value in pairs(self) do
|
||||
if type(value) == "number" or type(value) == "string" then
|
||||
if type(value) == "number" or type(value) == "string" then
|
||||
hash = hash..sep..value
|
||||
end
|
||||
end
|
||||
@@ -31,13 +30,13 @@ function Configurable:loadDefaults(config_options)
|
||||
self:reset()
|
||||
for i=1,#config_options do
|
||||
local options = config_options[i].options
|
||||
for j=1,#config_options[i].options do
|
||||
local key = config_options[i].options[j].name
|
||||
for j=1,#options do
|
||||
local key = options[j].name
|
||||
local settings_key = config_options.prefix.."_"..key
|
||||
local default = G_reader_settings:readSetting(settings_key)
|
||||
self[key] = default or config_options[i].options[j].default_value
|
||||
self[key] = default or options[j].default_value
|
||||
if not self[key] then
|
||||
self[key] = config_options[i].options[j].default_arg
|
||||
self[key] = options[j].default_arg
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -49,7 +48,7 @@ function Configurable:loadSettings(settings, prefix)
|
||||
or type(value) == "table" then
|
||||
local saved_value = settings:readSetting(prefix..key)
|
||||
self[key] = (saved_value == nil) and self[key] or saved_value
|
||||
--Debug("Configurable:loadSettings", "key", key, "saved value",
|
||||
--Debug("Configurable:loadSettings", "key", key, "saved value",
|
||||
--saved_value,"Configurable.key", self[key])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -27,9 +27,10 @@ local function probeDevice()
|
||||
end
|
||||
|
||||
-- add new ports here:
|
||||
if --[[ implement a proper test instead --]] false then
|
||||
return require("device/newport/device")
|
||||
end
|
||||
--
|
||||
-- if --[[ implement a proper test instead --]] false then
|
||||
-- return require("device/newport/device")
|
||||
-- end
|
||||
|
||||
error("did not find a hardware abstraction for this platform")
|
||||
end
|
||||
|
||||
@@ -30,8 +30,8 @@ function DocSettings:getNameFromHistory(hist_name)
|
||||
end
|
||||
|
||||
function DocSettings:open(docfile)
|
||||
local history_path = nil
|
||||
local sidecar_path = nil
|
||||
local history_path
|
||||
local sidecar_path
|
||||
if docfile == ".reader" then
|
||||
-- we handle reader setting as special case
|
||||
history_path = DataStorage:getDataDir() .. "/settings.reader.lua"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
local UIManager = require("ui/uimanager")
|
||||
local DEBUG = require("dbg")
|
||||
|
||||
local HTTPClient = {
|
||||
input_timeouts = 0,
|
||||
|
||||
Reference in New Issue
Block a user