Skip to content

Commit a86c913

Browse files
committed
Handle lints raised by Luacheck
1 parent d7aa0a0 commit a86c913

20 files changed

+39
-44
lines changed

data/creole.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
-- http://www.wikicreole.org/wiki/CheatSheet
33

44
-- For better performance we put these functions in local variables:
5-
local P, S, R, Cf, Cc, Ct, V, Cs, Cg, Cb, B, C, Cmt =
6-
lpeg.P, lpeg.S, lpeg.R, lpeg.Cf, lpeg.Cc, lpeg.Ct, lpeg.V,
7-
lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.B, lpeg.C, lpeg.Cmt
5+
local P, S, Cc, Ct, V, C = lpeg.P, lpeg.S, lpeg.Cc, lpeg.Ct, lpeg.V, lpeg.C
86

97
local whitespacechar = S(" \t\r\n")
108
local specialchar = S("/*~[]\\{}|")
@@ -185,6 +183,6 @@ local grammar = P{ "Doc",
185183
/ pandoc.Strong ;
186184
}
187185

188-
function Reader(input, reader_options)
186+
function Reader(input, _reader_options)
189187
return lpeg.match(grammar, tostring(input))
190188
end

man/manfilter.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ local text = require('text')
55
function Header(el)
66
if el.level == 1 then
77
return pandoc.walk_block(el, {
8-
Str = function(el)
9-
return pandoc.Str(text.upper(el.text))
8+
Str = function(str_el)
9+
return pandoc.Str(text.upper(str_el.text))
1010
end })
1111
end
1212
end
@@ -17,11 +17,11 @@ function Table(el)
1717
local rendered = pandoc.write(pandoc.Pandoc({el}), "plain")
1818
local adjusted = rendered -- tame grid table lines
1919
:gsub("%+([=:][=:]+)",
20-
function(s)
21-
return " " .. string.rep("-", #s - 1)
20+
function(str)
21+
return " " .. string.rep("-", #str - 1)
2222
end)
2323
:gsub("(%+[-:][-:]+)",
24-
function(s)
24+
function(_str)
2525
return ""
2626
end)
2727
:gsub("%+\n","\n")
@@ -39,6 +39,6 @@ function Link(el)
3939
end
4040

4141
-- remove notes
42-
function Note(el)
42+
function Note(_el)
4343
return {}
4444
end

pandoc-lua-engine/test/bytestring-reader.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function ByteStringReader (input, opts)
1+
function ByteStringReader (input, _opts)
22
local chars = pandoc.List{}
33
for i = 1, #input do
44
chars:insert(utf8.char(input:byte(i,i)))

pandoc-lua-engine/test/bytestring.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function ByteStringWriter (doc, opts)
1+
function ByteStringWriter (_doc, _opts)
22
local buffer = {}
33
for i=0, 255 do
44
table.insert(buffer, string.char(i))

pandoc-lua-engine/test/extensions.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function Writer (doc, opts)
1+
function Writer (_doc, opts)
22
local output = 'smart extension is %s;\ncitations extension is %s\n'
33
local status = function (ext)
44
return opts.extensions:includes(ext) and 'enabled' or 'disabled'

pandoc-lua-engine/test/lua/block-count.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
local num_blocks = 0
22

3-
function Block(el)
3+
function Block(_el)
44
num_blocks = num_blocks + 1
55
end
66

7-
function Pandoc(blocks, meta)
7+
function Pandoc(_blocks, _meta)
88
return pandoc.Pandoc {
99
pandoc.Para{pandoc.Str(num_blocks)}
1010
}

pandoc-lua-engine/test/lua/hello-world-doc.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
return {
22
{
3-
Pandoc = function(doc)
3+
Pandoc = function(_doc)
44
local meta = {}
55
local hello = { pandoc.Str "Hello,", pandoc.Space(), pandoc.Str "World!" }
66
local blocks = { pandoc.Para(hello) }

pandoc-lua-engine/test/lua/implicit-doc-filter.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function Pandoc (doc)
1+
function Pandoc (_doc)
22
local meta = {}
33
local hello = { pandoc.Str "Hello,", pandoc.Space(), pandoc.Str "World!" }
44
local blocks = { pandoc.Para(hello) }

pandoc-lua-engine/test/lua/inlines-filter.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function isWorldAfterSpace (fst, snd)
1+
local function isWorldAfterSpace (fst, snd)
22
return fst and fst.t == 'LineBreak'
33
and snd and snd.t == 'Str' and snd.text == 'World!'
44
end

pandoc-lua-engine/test/lua/metatable-catch-all.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
local num_inlines = 0
22

3-
function catch_all(el)
3+
local function catch_all(el)
44
if el.tag and pandoc.Inline.constructor[el.tag] then
55
num_inlines = num_inlines + 1
66
end
77
end
88

9-
function Pandoc(blocks, meta)
9+
function Pandoc(_blocks, _meta)
1010
return pandoc.Pandoc {
1111
pandoc.Para{pandoc.Str(num_inlines)}
1212
}

0 commit comments

Comments
 (0)