Add workflow and fix style (#16)

* Add workflow

* Style, remove shadow bindings

* Style, shadow bindings

* Style

* Style
This commit is contained in:
Redox 2022-09-07 03:06:34 +02:00 committed by GitHub
parent b01f62a8fc
commit f96cc1c991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 132 additions and 123 deletions

10
.github/workflows/glua_lint.yml vendored Normal file
View File

@ -0,0 +1,10 @@
name: GLuaFixer
on:
pull_request:
jobs:
Lint:
uses: CFC-Servers/github_action_workflows/.github/workflows/lint_glua.yml@feature/shareable
with:
config: "https://cfc.gg/configs/gluafixer/glualint.json"

View File

@ -7,7 +7,7 @@ function CFCHTTP.getAddress( url )
if cached then return cached end
local pattern = "(%a+)://([%a%d%.-]+):?(%d*)/?.*"
local _, _, protocol, addr, port = string.find( url, pattern )
local _, _, _, addr, _ = string.find( url, pattern )
parsedAddressCache[url] = addr
return addr
@ -45,13 +45,13 @@ function CFCHTTP.getOptionsForURI(url)
return options
end
for allowedAddr, options in pairs( CFCHTTP.config.addresses ) do
if not options.pattern then
for allowedAddr, optionsAddr in pairs( CFCHTTP.config.addresses ) do
if not optionsAddr.pattern then
allowedAddr = escapeAddr( allowedAddr )
end
if string.match( address, "^" .. allowedAddr .. "$" ) then
return options
return optionsAddr
end
end

View File

@ -35,7 +35,7 @@ local function populatePanel( form )
local textEntry, _ = form:TextEntry( "Address" )
list.OnRowSelected = function( self, index, pnl )
list.OnRowSelected = function( _, _, pnl )
textEntry:SetValue( pnl:GetColumnText( 1 ) )
end

View File

@ -157,7 +157,6 @@ local function wrapHTMLPanel( panelName )
_G[openURL]( self, url, ... )
end
end
hook.Add( "Initialize", "CFC_HttpWhitelist_WrapHTML", function()

View File

@ -16,9 +16,9 @@ end
-- LoadLuaConfigs loads the default config and then any lua files in the cfc_http_restrictions/configs directory
function CFCHTTP.loadLuaConfigs()
local files = file.Find( "cfc_http_restrictions/configs/*.lua", "LUA" )
for _, file in pairs(files) do
AddCSLuaFile("cfc_http_restrictions/configs/" .. file)
local newConfig = include("cfc_http_restrictions/configs/" .. file)
for _, fil in pairs( files ) do
AddCSLuaFile( "cfc_http_restrictions/configs/" .. fil )
local newConfig = include( "cfc_http_restrictions/configs/" .. fil )
CFCHTTP.config = CFCHTTP.mergeConfigs( CFCHTTP.config, newConfig )
end
end