Skip to content

Commit

Permalink
chore(luacheck) use .luacheckrc + update settings
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Mar 10, 2017
1 parent 4159e67 commit 2ca3ff6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 14 deletions.
39 changes: 39 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
std = "ngx_lua"
unused = false
redefined = false
max_line_length = false


globals = {
"_KONG",
}


not_globals = {
"string.len",
"table.getn",
}


ignore = {
"6.", -- ignore whitespace warnings
}


exclude_files = {
"spec/fixtures/invalid-module.lua",
}


files["kong/plugins/ldap-auth/*.lua"] = {
read_globals = {
"bit.mod",
"string.pack",
"string.unpack",
},
}


files["spec/**/*.lua"] = {
std = "ngx_lua+busted",
}
14 changes: 1 addition & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,7 @@ dev: install
done;

lint:
@luacheck -q . \
--exclude-files 'kong/vendor/**/*.lua' \
--exclude-files 'spec/fixtures/invalid-module.lua' \
--std 'ngx_lua+busted' \
--globals '_KONG' \
--globals 'ngx' \
--globals 'assert' \
--globals 'string.pack' \
--globals 'string.unpack' \
--globals 'bit.mod' \
--no-redefined \
--no-unused-args \
--ignore 6..
@luacheck -q .

test:
@$(TEST_CMD) spec/01-unit
Expand Down
1 change: 0 additions & 1 deletion kong/core/globalpatches.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ return function(options)
--
-- This patched method will create a unique seed per worker process,
-- using a combination of both time and the worker's pid.
-- luacheck: globals math
local util = require "kong.tools.utils"
local seeds = {}
local randomseed = math.randomseed
Expand Down

0 comments on commit 2ca3ff6

Please sign in to comment.