Fix whitespace warnings reported by luacheck (#1229)

This commit is contained in:
Daniel Hahler 2016-11-21 22:38:23 +01:00 committed by GitHub
parent 3fea2db8c5
commit aeab2a70e9
35 changed files with 72 additions and 77 deletions

View File

@ -138,11 +138,11 @@ function layout.parameters(t, screen)
local clients = client.tiled(screen)
local gap_single_client = true
if(t and t.gap_single_client ~= nil) then
gap_single_client = t.gap_single_client
end
local min_clients = gap_single_client and 1 or 2
local useless_gap = t and (#clients >= min_clients and t.gap or 0) or 0

View File

@ -8,7 +8,7 @@
-- [visitor objects](https://en.wikipedia.org/wiki/Visitor_pattern)
-- * Turn each function into an API with various common customization parameters.
-- * Re-use the same functions for the `mouse`, `client`s, `screen`s and `wibox`es
--
--
--
-- <h3>Compositing</h3>
--

View File

@ -985,7 +985,7 @@ function tag.object.get_master_count(t)
or defaults.master_count
end
---
---
-- @deprecated awful.tag.setnmaster
-- @see master_count
-- @param nmaster The number of master windows.

View File

@ -249,8 +249,8 @@ end
--- Get a client's titlebar
-- @class function
-- @tparam client c The client for which a titlebar is wanted.
-- @tparam[opt={}] table args A table with extra arguments for the titlebar.
-- @tparam[opt=font.height*1.5] number args.size The height of the titlebar.
-- @tparam[opt={}] table args A table with extra arguments for the titlebar.
-- @tparam[opt=font.height*1.5] number args.size The height of the titlebar.
-- @tparam[opt=top] string args.position" values are `top`,
-- `left`, `right` and `bottom`.
-- @tparam[opt=top] string args.bg_normal

View File

@ -21,7 +21,7 @@
-- 222 end
-- 223 end),
-- 224 s.mylayoutbox,
--
--
-- ![Example screenshot](../images/awful_widget_watch.png)
--
-- @author Benjamin Petrenko

View File

@ -324,7 +324,7 @@ end
-- @param cr A cairo context
-- @tparam number width The shape width
-- @tparam number height The shape height
-- @tparam number corner_radius
-- @tparam number corner_radius
function module.octogon(cr, width, height, corner_radius)
corner_radius = corner_radius or math.min(10, math.min(width, height)/4)
local offset = math.sqrt( (corner_radius*corner_radius) / 2 )

View File

@ -3,7 +3,7 @@ mouse.coords {x=175+60,y=60} --DOC_HIDE
-- Get the position
print(mouse.coords().x)
-- Change the position
mouse.coords {
x = 185,

View File

@ -52,7 +52,7 @@ mouse.coords {x=0,y=230} --DOC_HIDE
awful.placement.closest_corner(mouse, {include_sides=true, parent=c}) --DOC_HIDE
mouse.push_history() --DOC_HIDE
assert(mouse.coords().x == c.x and mouse.coords().y == c.y+c.height+2*bw) --DOC_HIDE
-- It is possible to emulate the mouse API to get the closest corner of
-- random area
local _, corner = awful.placement.closest_corner(

View File

@ -1,15 +1,14 @@
screen[1]._resize {x = 175, width = 128, height = 96} --DOC_NO_USAGE --DOC_HIDE
local awful = {placement = require("awful.placement")} --DOC_HIDE
local c = client.gen_fake {x = 220, y = 35, width=40, height=30} --DOC_HIDE
-- Simulate Windows 7 "edge snap" (also called aero snap) feature
local axis = "vertically"
local f = awful.placement.scale
+ awful.placement.left
+ (axis and awful.placement["maximize_"..axis] or nil)
local geo = f(client.focus, {honor_workarea=true, to_percent = 0.5})
local wa = screen[1].workarea--DOC_HIDE

View File

@ -1,10 +1,10 @@
local shape,cr,show = ... --DOC_HIDE
shape.arc(cr,70,70, 10)
show(cr) --DOC_HIDE
shape.arc(cr,70,70, 10, nil, nil, true, true)
show(cr) --DOC_HIDE
shape.arc(cr,70,70, nil, 0, 2*math.pi)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.arrow(cr, 70, 70)
show(cr) --DOC_HIDE
shape.arrow(cr,70,70, 30, 10, 60)
show(cr) --DOC_HIDE
shape.transform(shape.arrow) : rotate_at(35,35,math.pi/2)(cr,70,70)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.circle(cr, 70, 70)
show(cr) --DOC_HIDE
shape.circle(cr,20,70)
show(cr) --DOC_HIDE
shape.transform(shape.circle) : scale(0.5, 1)(cr,70,70)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.cross(cr, 70, 70)
show(cr) --DOC_HIDE
shape.cross(cr,20,70)
show(cr) --DOC_HIDE
shape.transform(shape.cross) : scale(0.5, 1)(cr,70,70)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.hexagon(cr, 70, 70)
show(cr) --DOC_HIDE
shape.transform(shape.hexagon) : translate(0,15)(cr,70,20)
show(cr) --DOC_HIDE
shape.transform(shape.hexagon) : rotate_at(35,35,math.pi/2)(cr,70,40)
show(cr) --DOC_HIDE

View File

@ -2,11 +2,11 @@ local shape,cr,show = ... --DOC_HIDE
shape.infobubble(cr, 70, 70)
show(cr) --DOC_HIDE
shape.transform(shape.infobubble) : translate(0, 20)
: rotate_at(35,35,math.pi) (cr,70,20,10, 5, 35 - 5)
show(cr) --DOC_HIDE
shape.transform(shape.infobubble)
: rotate_at(35,35,3*math.pi/2) (cr,70,70, nil, nil, 40)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.isosceles_triangle(cr, 70, 70)
show(cr) --DOC_HIDE
shape.isosceles_triangle(cr,20,70)
show(cr) --DOC_HIDE
shape.transform(shape.isosceles_triangle) : rotate_at(35, 35, math.pi/2)(cr,70,70)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.losange(cr, 70, 70)
show(cr) --DOC_HIDE
shape.losange(cr,20,70)
show(cr) --DOC_HIDE
shape.transform(shape.losange) : scale(0.5, 1)(cr,70,70)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.octogon(cr, 70, 70)
show(cr) --DOC_HIDE
shape.octogon(cr,70,70,70/2.5)
show(cr) --DOC_HIDE
shape.transform(shape.octogon) : translate(0, 25) (cr,70,20)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.parallelogram(cr, 70, 70)
show(cr) --DOC_HIDE
shape.parallelogram(cr,70,20)
show(cr) --DOC_HIDE
shape.transform(shape.parallelogram) : scale(0.5, 1)(cr,70,70)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.partially_rounded_rect(cr, 70, 70)
show(cr) --DOC_HIDE
shape.partially_rounded_rect(cr, 70, 70, true)
show(cr) --DOC_HIDE
shape.partially_rounded_rect(cr, 70, 70, true, true, false, true, 30)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.pie(cr, 70, 70)
show(cr) --DOC_HIDE
shape.pie(cr,70,70, 1.0471975511966, 4.1887902047864)
show(cr) --DOC_HIDE
shape.pie(cr,70,70, 0, 2*math.pi, 10)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.powerline(cr, 70, 70)
show(cr) --DOC_HIDE
shape.transform(shape.powerline) : translate(0, 25) (cr,70,20)
show(cr) --DOC_HIDE
shape.transform(shape.powerline) : translate(0, 25) (cr,70,20, -20)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.radial_progress(cr, 70, 20, .3)
show(cr, true) --DOC_HIDE
shape.radial_progress(cr, 70, 20, .6)
show(cr, true) --DOC_HIDE
shape.radial_progress(cr, 70, 20, .9)
show(cr, true) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.rectangle(cr, 70, 70)
show(cr) --DOC_HIDE
shape.rectangle(cr,20,70)
show(cr) --DOC_HIDE
shape.transform(shape.rectangle) : scale(0.5, 1)(cr,70,70)
show(cr) --DOC_HIDE

View File

@ -5,9 +5,9 @@ show(cr) --DOC_HIDE
-- shape.rectangular_tag(cr,20,70) --TODO broken --DOC_HIDE
-- show(cr) --DOC_HIDE
shape.transform(shape.rectangular_tag) : translate(0, 30) (cr, 70, 10, 10)
show(cr) --DOC_HIDE
shape.transform(shape.rectangular_tag) : translate(0, 30) (cr, 70, 10, -10)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.rounded_bar(cr, 70, 70)
show(cr) --DOC_HIDE
shape.rounded_bar(cr, 20, 70)
show(cr) --DOC_HIDE
shape.rounded_bar(cr, 70, 20)
show(cr) --DOC_HIDE

View File

@ -2,9 +2,9 @@ local shape,cr,show = ... --DOC_HIDE
shape.rounded_rect(cr, 70, 70, 10)
show(cr) --DOC_HIDE
shape.rounded_rect(cr,20,70, 5)
show(cr) --DOC_HIDE
shape.transform(shape.rounded_rect) : translate(0,25) (cr,70,20, 5)
show(cr) --DOC_HIDE

View File

@ -4,12 +4,12 @@ local gears = require("gears") --DOC_HIDE
-- methods and accessors. It is also possible to set them directly on the
-- object.
local class = {}
function class:get_foo()
print("In get foo", self._foo or "bar")
return self._foo or "bar"
end
function class:set_foo(value)
print("In set foo", value)
@ -32,11 +32,11 @@ local o = gears.object {
}
print(o.foo)
o.foo = 42
print(o.foo)
o:method(1, 2, 3)
-- Random properties can also be added, the signal will be emitted automatically.
@ -46,7 +46,7 @@ o:connect_signal("property::something", function(obj, value)
end)
print(o.something)
o.something = "a cow"
print(o.something)

View File

@ -1,24 +1,24 @@
local gears = require("gears") --DOC_HIDE
local o = gears.object{}
-- Function can be attached to signals
local function slot(obj, a, b, c)
print("In slot", obj, a, b, c)
end
o:connect_signal("my_signal", slot)
-- Emit can be done without argument. In that case, the object will be
-- Emitting can be done without arguments. In that case, the object will be
-- implicitly added as an argument.
o:emit_signal "my_signal"
-- It is also possible to add as many random arguments are required.
o:emit_signal("my_signal", "foo", "bar", 42)
-- Finally, to allow the object to be garbage collected (the memory freed), it
-- is necessary to disconnect the signal or use `weak_connect_signal`
o:disconnect_signal("my_signal", slot)
-- This time, the `slot` wont be called as it is no longer connected.
o:emit_signal "my_signal"

View File

@ -5,7 +5,7 @@ local text_widget = {
text = "Hello world!",
widget = wibox.widget.textbox
}
parent : setup {
{
text_widget,

View File

@ -5,7 +5,7 @@ local text_widget = {
text = "Hello world!",
widget = wibox.widget.textbox
}
parent : setup {
{
text_widget,

View File

@ -26,31 +26,27 @@ local function create_arrow(text) --DOC_HIDE
end --DOC_HIDE
local normal = create_arrow("Normal")
local north = wibox.container {
create_arrow("North"),
direction = "north",
widget = wibox.container.rotate
}
local south = wibox.container {
create_arrow("South"),
direction = "south",
widget = wibox.container.rotate
}
local east = wibox.container {
create_arrow("East"),
direction = "east",
widget = wibox.container.rotate
}
local west = wibox.container {
create_arrow("West"),
direction = "west",
widget = wibox.container.rotate
}

View File

@ -7,7 +7,7 @@ local w = wibox.widget {
generic_widget( "third" ),
layout = wibox.layout.ratio.horizontal
}
w:ajust_ratio(2, 0.44, 0.33, 0.22)
return w --DOC_HIDE

View File

@ -11,7 +11,7 @@ parent:add( --DOC_HIDE
forced_height = 20, --DOC_HIDE
check_shape = function(cr, width, height)
local rs = math.min(width, height)
cr:move_to( 0 , 0 )
cr:line_to( rs , 0 )
cr:move_to( 0 , 0 )

View File

@ -62,7 +62,7 @@ theme = theme_assets.recolor_titlebar_normal(theme, theme.fg_normal)
theme = theme_assets.recolor_titlebar_focus(theme, theme.fg_focus)
theme = theme_assets.recolor_layout(theme, theme.fg_normal)
-- Define the icon theme for application icons. If not set then the icons
-- Define the icon theme for application icons. If not set then the icons
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
theme.icon_theme = nil