Merge pull request #1622 from Veratil/fix-new-luacheck

Fix Luacheck 0.19.0 release Travis breaks
This commit is contained in:
Emmanuel Lepage Vallée 2017-03-04 13:32:53 -05:00 committed by GitHub
commit 971adec0d0
15 changed files with 133 additions and 97 deletions

View File

@ -13,11 +13,13 @@ files["awesomerc.lua"].allow_defined_top = true
-- This file itself -- This file itself
files[".luacheckrc"].ignore = {"111", "112", "131"} files[".luacheckrc"].ignore = {"111", "112", "131"}
-- Theme files, ignore max line length
files["themes/*"].ignore = {"631"}
-- Global objects defined by the C code -- Global objects defined by the C code
read_globals = { read_globals = {
"awesome", "awesome",
"button", "button",
"client",
"dbus", "dbus",
"drawable", "drawable",
"drawin", "drawin",
@ -28,6 +30,8 @@ read_globals = {
"selection", "selection",
"tag", "tag",
"window", "window",
"table.unpack",
"math.atan2",
} }
-- screen may not be read-only, because newer luacheck versions complain about -- screen may not be read-only, because newer luacheck versions complain about

View File

@ -106,7 +106,8 @@ function completion.shell(command, cur_pos, ncomp, shell)
-- check commands, aliases, builtins, functions and reswords -- check commands, aliases, builtins, functions and reswords
shell_cmd = "/usr/bin/env zsh -c 'local -a res; ".. shell_cmd = "/usr/bin/env zsh -c 'local -a res; "..
"res=( ".. "res=( "..
"\"${(k)commands[@]}\" \"${(k)aliases[@]}\" \"${(k)builtins[@]}\" \"${(k)functions[@]}\" \"${(k)reswords[@]}\" ".. "\"${(k)commands[@]}\" \"${(k)aliases[@]}\" \"${(k)builtins[@]}\" \"${(k)functions[@]}\" "..
"\"${(k)reswords[@]}\" "..
"${PWD}/*(:t)".. "${PWD}/*(:t)"..
"); ".. "); "..
"print -ln -- ${(M)res[@]:#" .. string.format('%q', words[cword_index]) .. "*}'" "print -ln -- ${(M)res[@]:#" .. string.format('%q', words[cword_index]) .. "*}'"

View File

@ -117,7 +117,8 @@ local function mouse_resize_handler(c, _, _, _, orientation)
local geom = c:geometry() local geom = c:geometry()
-- we have to make sure we're not on the last visible client where we have to use different settings. -- we have to make sure we're not on the last visible
-- client where we have to use different settings.
local wfact local wfact
local wfact_x, wfact_y local wfact_x, wfact_y
if (geom.y+geom.height+15) > (wa.y+wa.height) then if (geom.y+geom.height+15) > (wa.y+wa.height) then
@ -265,7 +266,8 @@ local function do_tile(param, orientation)
if not data[0] then if not data[0] then
data[0] = {} data[0] = {}
end end
coord = coord + tile_group(gs, cls, wa, orientation, data[0], {first=1, last=nmaster, coord = coord, size = size}) coord = coord + tile_group(gs, cls, wa, orientation, data[0],
{first=1, last=nmaster, coord = coord, size = size})
end end
if not place_master and nother > 0 then if not place_master and nother > 0 then
@ -285,7 +287,8 @@ local function do_tile(param, orientation)
if not data[i] then if not data[i] then
data[i] = {} data[i] = {}
end end
coord = coord + tile_group(gs, cls, wa, orientation, data[i], { first = first, last = last, coord = coord, size = size }) coord = coord + tile_group(gs, cls, wa, orientation, data[i],
{ first = first, last = last, coord = coord, size = size })
end end
end end
place_master = not place_master place_master = not place_master

View File

@ -632,8 +632,10 @@ end
--- Create a menu popup. --- Create a menu popup.
-- @param args Table containing the menu informations. -- @param args Table containing the menu informations.
-- --
-- * Key items: Table containing the displayed items. Each element is a table by default (when element 'new' is awful.menu.entry) containing: item name, triggered action, submenu table or function, item icon (optional). -- * Key items: Table containing the displayed items. Each element is a table by default (when element 'new' is
-- * Keys theme.[fg|bg]_[focus|normal], theme.border_color, theme.border_width, theme.submenu_icon, theme.height and theme.width override the default display for your menu and/or of your menu entry, each of them are optional. -- awful.menu.entry) containing: item name, triggered action, submenu table or function, item icon (optional).
-- * Keys theme.[fg|bg]_[focus|normal], theme.border_color, theme.border_width, theme.submenu_icon, theme.height
-- and theme.width override the default display for your menu and/or of your menu entry, each of them are optional.
-- * Key auto_expand controls the submenu auto expand behaviour by setting it to true (default) or false. -- * Key auto_expand controls the submenu auto expand behaviour by setting it to true (default) or false.
-- --
-- @param parent Specify the parent menu if we want to open a submenu, this value should never be set by the user. -- @param parent Specify the parent menu if we want to open a submenu, this value should never be set by the user.

View File

@ -1,3 +1,5 @@
--luacheck: no max line length
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
--- Spawning of programs. --- Spawning of programs.
-- --

View File

@ -471,7 +471,9 @@ end
--- Create a new minimize button for a client. --- Create a new minimize button for a client.
-- @param c The client for which the button is wanted. -- @param c The client for which the button is wanted.
function titlebar.widget.minimizebutton(c) function titlebar.widget.minimizebutton(c)
local widget = titlebar.widget.button(c, "minimize", function() return "" end, function(cl) cl.minimized = not cl.minimized end) local widget = titlebar.widget.button(c, "minimize",
function() return "" end,
function(cl) cl.minimized = not cl.minimized end)
c:connect_signal("property::minimized", widget.update) c:connect_signal("property::minimized", widget.update)
return widget return widget
end end
@ -485,7 +487,9 @@ end
--- Create a new ontop button for a client. --- Create a new ontop button for a client.
-- @param c The client for which the button is wanted. -- @param c The client for which the button is wanted.
function titlebar.widget.ontopbutton(c) function titlebar.widget.ontopbutton(c)
local widget = titlebar.widget.button(c, "ontop", function(cl) return cl.ontop end, function(cl, state) cl.ontop = not state end) local widget = titlebar.widget.button(c, "ontop",
function(cl) return cl.ontop end,
function(cl, state) cl.ontop = not state end)
c:connect_signal("property::ontop", widget.update) c:connect_signal("property::ontop", widget.update)
return widget return widget
end end
@ -493,7 +497,9 @@ end
--- Create a new sticky button for a client. --- Create a new sticky button for a client.
-- @param c The client for which the button is wanted. -- @param c The client for which the button is wanted.
function titlebar.widget.stickybutton(c) function titlebar.widget.stickybutton(c)
local widget = titlebar.widget.button(c, "sticky", function(cl) return cl.sticky end, function(cl, state) cl.sticky = not state end) local widget = titlebar.widget.button(c, "sticky",
function(cl) return cl.sticky end,
function(cl, state) cl.sticky = not state end)
c:connect_signal("property::sticky", widget.update) c:connect_signal("property::sticky", widget.update)
return widget return widget
end end

View File

@ -145,7 +145,8 @@ function util.escape(text)
return text and text:gsub("['&<>\"]", xml_entity_names) or nil return text and text:gsub("['&<>\"]", xml_entity_names) or nil
end end
local xml_entity_chars = { lt = "<", gt = ">", nbsp = " ", quot = "\"", apos = "'", ndash = "-", mdash = "-", amp = "&" }; local xml_entity_chars = { lt = "<", gt = ">", nbsp = " ", quot = "\"", apos = "'", ndash = "-", mdash = "-",
amp = "&" };
--- Unescape a string from entities. --- Unescape a string from entities.
-- @param text Text to unescape. -- @param text Text to unescape.
-- @return Unescaped text. -- @return Unescaped text.

View File

@ -45,7 +45,8 @@ function button.new(args)
orig_set_image(self, img_release) orig_set_image(self, img_release)
end end
w:set_image(args.image) w:set_image(args.image)
w:buttons(abutton({}, 1, function () orig_set_image(w, img_press) end, function () orig_set_image(w, img_release) end)) w:buttons(abutton({}, 1, function () orig_set_image(w, img_press) end,
function () orig_set_image(w, img_release) end))
w:connect_signal("mouse::leave", function(self) orig_set_image(self, img_release) end) w:connect_signal("mouse::leave", function(self) orig_set_image(self, img_release) end)

View File

@ -210,7 +210,8 @@ local function tasklist_label(c, args, tb)
local bg_focus = args.bg_focus or theme.tasklist_bg_focus or theme.bg_focus or bg_normal local bg_focus = args.bg_focus or theme.tasklist_bg_focus or theme.bg_focus or bg_normal
local fg_urgent = util.ensure_pango_color(args.fg_urgent or theme.tasklist_fg_urgent or theme.fg_urgent, fg_normal) local fg_urgent = util.ensure_pango_color(args.fg_urgent or theme.tasklist_fg_urgent or theme.fg_urgent, fg_normal)
local bg_urgent = args.bg_urgent or theme.tasklist_bg_urgent or theme.bg_urgent or bg_normal local bg_urgent = args.bg_urgent or theme.tasklist_bg_urgent or theme.bg_urgent or bg_normal
local fg_minimize = util.ensure_pango_color(args.fg_minimize or theme.tasklist_fg_minimize or theme.fg_minimize, fg_normal) local fg_minimize = util.ensure_pango_color(args.fg_minimize or theme.tasklist_fg_minimize or theme.fg_minimize,
fg_normal)
local bg_minimize = args.bg_minimize or theme.tasklist_bg_minimize or theme.bg_minimize or bg_normal local bg_minimize = args.bg_minimize or theme.tasklist_bg_minimize or theme.bg_minimize or bg_normal
-- FIXME v5, remove the fallback theme.bg_image_* variables, see GH#1403 -- FIXME v5, remove the fallback theme.bg_image_* variables, see GH#1403
local bg_image_normal = args.bg_image_normal or theme.tasklist_bg_image_normal or theme.bg_image_normal local bg_image_normal = args.bg_image_normal or theme.tasklist_bg_image_normal or theme.bg_image_normal

View File

@ -111,7 +111,10 @@ end
-- @return item name, item background color, background image, item icon. -- @return item name, item background color, background image, item icon.
local function label(o) local function label(o)
if o.focused then if o.focused then
return colortext(o.name, (theme.menu_fg_focus or theme.fg_focus)), (theme.menu_bg_focus or theme.bg_focus), nil, o.icon return colortext(o.name, (theme.menu_fg_focus or theme.fg_focus)),
(theme.menu_bg_focus or theme.bg_focus),
nil,
o.icon
else else
return o.name, (theme.menu_bg_normal or theme.bg_normal), nil, o.icon return o.name, (theme.menu_bg_normal or theme.bg_normal), nil, o.icon
end end

View File

@ -6,6 +6,8 @@
-- @module naughty -- @module naughty
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
--luacheck: no max line length
-- Package environment -- Package environment
local pairs = pairs local pairs = pairs
local table = table local table = table

View File

@ -105,7 +105,8 @@ local function convert_icon(w, h, rowstride, channels, data)
return cairo.ImageSurface.create_for_data(tcat(rows), format, w, h, stride) return cairo.ImageSurface.create_for_data(tcat(rows), format, w, h, stride)
end end
capi.dbus.connect_signal("org.freedesktop.Notifications", function (data, appname, replaces_id, icon, title, text, actions, hints, expire) capi.dbus.connect_signal("org.freedesktop.Notifications",
function (data, appname, replaces_id, icon, title, text, actions, hints, expire)
local args = { } local args = { }
if data.member == "Notify" then if data.member == "Notify" then
if text ~= "" then if text ~= "" then

View File

@ -127,7 +127,11 @@ local function calculate_info(self, context, width, height)
local x, y = 0, 0 local x, y = 0, 0
local function get_scroll_offset(size, visible_size) local function get_scroll_offset(size, visible_size)
return self._private.step_function(self._private.timer:elapsed(), size, visible_size, self._private.speed, self._private.extra_space) return self._private.step_function(self._private.timer:elapsed(),
size,
visible_size,
self._private.speed,
self._private.extra_space)
end end
if self._private.dir == "h" then if self._private.dir == "h" then
x = -get_scroll_offset(surface_width - extra, width) x = -get_scroll_offset(surface_width - extra, width)

View File

@ -76,7 +76,11 @@ local function widget_layout(state, arguments)
return false return false
end end
say:set("assertion.widget_layout.positive", "Expected:\n%s\nbut got:\n%s\nwhen offering (%s, %s) to widget") say:set("assertion.widget_layout.positive", "Expected:\n%s\nbut got:\n%s\nwhen offering (%s, %s) to widget")
assert:register("assertion", "widget_layout", widget_layout, "assertion.widget_layout.positive", "assertion.widget_layout.positive") assert:register("assertion",
"widget_layout",
widget_layout,
"assertion.widget_layout.positive",
"assertion.widget_layout.positive")
-- }}} -- }}}
return { return {

View File

@ -8,7 +8,8 @@ local create_wibox = require("_wibox_helper").create_wibox
local BENCHMARK_EXACT = os.getenv("BENCHMARK_EXACT") local BENCHMARK_EXACT = os.getenv("BENCHMARK_EXACT")
if not BENCHMARK_EXACT then if not BENCHMARK_EXACT then
print("Doing quick and inexact measurements. Set BENCHMARK_EXACT=1 as an environment variable when you actually want to look at the results.") print("Doing quick and inexact measurements. Set BENCHMARK_EXACT=1 as an "..
"environment variable when you actually want to look at the results.")
end end
local measure, benchmark local measure, benchmark