feat(ci) add luacheck

This commit is contained in:
emrah 2023-01-24 16:58:43 +03:00 committed by GitHub
parent 60dd26c13b
commit 46f1cb7b4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 38 additions and 9 deletions

26
.github/workflows/ci-lua.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Lua CI
on: [pull_request]
jobs:
luacheck:
name: Luacheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install luarocks
run: sudo apt-get --install-recommends -y install luarocks
- name: Install luacheck
run: sudo luarocks install luacheck
- name: Check lua codes
run: |
set -o pipefail
luacheck -q -gur -i 581 --no-max-line-length --no-color --formatter plain $(find -name '*.lua') | awk -F: '
{
print $0
printf "::warning file=%s,line=%s,col=%s::%s\n", $1, $2, $3, $4
}
'

View File

@ -239,7 +239,7 @@ function M.verify(token, expectedAlgo, key, acceptedIssuers, acceptedAudiences)
return nil, "'iss' claim is missing";
end
if not verify_claim(issClaim, acceptedIssuers) then
return nil, "invalid 'iss' claim";
return nil, "invalid 'iss' claim";
end
end
@ -249,7 +249,7 @@ function M.verify(token, expectedAlgo, key, acceptedIssuers, acceptedAudiences)
return nil, "'aud' claim is missing";
end
if not verify_claim(audClaim, acceptedAudiences) then
return nil, "invalid 'aud' claim";
return nil, "invalid 'aud' claim";
end
end

View File

@ -102,7 +102,7 @@ function provider.get_sasl_handler(session)
self.username = session1.username;
break;
end
end
end
else
self.username = message;
end

View File

@ -80,6 +80,8 @@ module:hook("muc-occupant-pre-join", function (event)
return;
end
-- FIX ME: luacheck warning 581
-- not (x == y)' can be replaced by 'x ~= y' (if neither side is a table or NaN)
if not (subdomain == session.jitsi_meet_context_group) then
module:log('debug', 'skip allowners for auth user and non matching room subdomain: %s, jwt subdomain: %s',
subdomain, session.jitsi_meet_context_group);

View File

@ -58,6 +58,8 @@ module:hook(
"muc-broadcast-presence",
function (event)
-- Detect if the presence is for a poltergeist or not.
-- FIX ME: luacheck warning 581
-- not (x == y)' can be replaced by 'x ~= y' (if neither side is a table or NaN)
if not (jid.bare(event.occupant.jid) == poltergeist_component) then
return
end

View File

@ -252,7 +252,7 @@ end
function RoomReservation:enqueue_or_route_event(event)
if self.meta.status == STATUS.PENDING then
table.insert(self.pending_events, event)
if not self.api_call_triggered == true then
if self.api_call_triggered ~= true then
self:call_api_create_conference();
end
else

View File

@ -161,5 +161,4 @@ function module.command(arg)
warn("Unknown command: %s", command);
return 1;
end
return 0;
end