mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-13 03:30:29 +00:00
Bump illuaminate version
For now, we just perform the minimal number of changes to get this working. We'll switch to a more strict bracket handling system in the future.
This commit is contained in:
parent
68762fe84c
commit
68e6bc464b
2
.github/workflows/main-ci.yml
vendored
2
.github/workflows/main-ci.yml
vendored
@ -42,7 +42,7 @@ jobs:
|
||||
- name: Lint Lua code
|
||||
run: |
|
||||
test -d bin || mkdir bin
|
||||
test -f bin/illuaminate || wget -q -Obin/illuaminate https://squiddev.cc/illuaminate/bin/illuaminate
|
||||
test -f bin/illuaminate || wget -q -Obin/illuaminate https://squiddev.cc/illuaminate/linux-x86-64/illuaminate
|
||||
chmod +x bin/illuaminate
|
||||
bin/illuaminate lint
|
||||
|
||||
|
@ -253,7 +253,7 @@ end
|
||||
|
||||
function print( ... )
|
||||
local nLinesPrinted = 0
|
||||
local nLimit = select("#", ... )
|
||||
local nLimit = select("#", ...)
|
||||
for n = 1, nLimit do
|
||||
local s = tostring( select( n, ... ) )
|
||||
if n < nLimit then
|
||||
@ -695,7 +695,7 @@ if http then
|
||||
end
|
||||
|
||||
local function checkOptions( options, body )
|
||||
checkKey( options, "url", "string")
|
||||
checkKey( options, "url", "string" )
|
||||
if body == false then
|
||||
checkKey( options, "body", "nil" )
|
||||
else
|
||||
@ -725,7 +725,7 @@ if http then
|
||||
return nil, err
|
||||
end
|
||||
|
||||
http.get = function( _url, _headers, _binary)
|
||||
http.get = function(_url, _headers, _binary)
|
||||
if type( _url ) == "table" then
|
||||
checkOptions( _url, false )
|
||||
return wrapRequest( _url.url, _url )
|
||||
@ -737,7 +737,7 @@ if http then
|
||||
return wrapRequest( _url, _url, nil, _headers, _binary )
|
||||
end
|
||||
|
||||
http.post = function( _url, _post, _headers, _binary)
|
||||
http.post = function(_url, _post, _headers, _binary)
|
||||
if type( _url ) == "table" then
|
||||
checkOptions( _url, true )
|
||||
return wrapRequest( _url.url, _url )
|
||||
|
@ -43,7 +43,7 @@ end
|
||||
|
||||
-- Some methods shouldn't go through redirects, so we move them to the main
|
||||
-- term API.
|
||||
for _, method in ipairs { "nativePaletteColor", "nativePaletteColour"} do
|
||||
for _, method in ipairs { "nativePaletteColor", "nativePaletteColour" } do
|
||||
term[method] = native[method]
|
||||
native[method] = nil
|
||||
end
|
||||
|
@ -346,10 +346,10 @@ function urlEncode( str )
|
||||
else
|
||||
-- Non-ASCII (encode as UTF-8)
|
||||
return
|
||||
string.format("%%%02X", 192 + bit32.band( bit32.arshift(n, 6), 31 ) ) ..
|
||||
string.format("%%%02X", 128 + bit32.band( n, 63 ) )
|
||||
string.format("%%%02X", 192 + bit32.band( bit32.arshift(n, 6), 31 )) ..
|
||||
string.format("%%%02X", 128 + bit32.band( n, 63 ))
|
||||
end
|
||||
end )
|
||||
end)
|
||||
str = string.gsub(str, " ", "+")
|
||||
end
|
||||
return str
|
||||
|
@ -393,7 +393,7 @@ end
|
||||
-- @treturn Doc The object formatted as a document.
|
||||
-- @usage Display a table on the screen
|
||||
-- local pretty = require "cc.pretty"
|
||||
-- pretty.print(pretty.pretty({ 1, 2, 3 })
|
||||
-- pretty.print(pretty.pretty({ 1, 2, 3 }))
|
||||
local function pretty(obj)
|
||||
return pretty_impl(obj, {})
|
||||
end
|
||||
|
@ -97,7 +97,7 @@ end
|
||||
-- complete.build(
|
||||
-- { complete.choice, { "get", "put" } },
|
||||
-- complete.dir,
|
||||
-- } complete.file, many = true }
|
||||
-- { complete.file, many = true }
|
||||
-- )
|
||||
local function build(...)
|
||||
local arguments = table.pack(...)
|
||||
|
@ -15,7 +15,7 @@ end
|
||||
|
||||
-- Create .lua files by default
|
||||
if not fs.exists( sPath ) and not string.find( sPath, "%." ) then
|
||||
local sExtension = settings.get("edit.default_extension", "" )
|
||||
local sExtension = settings.get("edit.default_extension", "")
|
||||
if sExtension ~= "" and type( sExtension ) == "string" then
|
||||
sPath = sPath .. "." .. sExtension
|
||||
end
|
||||
@ -85,7 +85,7 @@ end
|
||||
|
||||
local function save( _sPath )
|
||||
-- Create intervening folder
|
||||
local sDir = _sPath:sub(1, _sPath:len() - fs.getName(_sPath):len() )
|
||||
local sDir = _sPath:sub(1, _sPath:len() - fs.getName(_sPath):len())
|
||||
if not fs.exists( sDir ) then
|
||||
fs.makeDir( sDir )
|
||||
end
|
||||
|
@ -46,7 +46,7 @@ end
|
||||
|
||||
-- Create .nfp files by default
|
||||
if not fs.exists( sPath ) and not string.find( sPath, "%." ) then
|
||||
local sExtension = settings.get("paint.default_extension", "" )
|
||||
local sExtension = settings.get("paint.default_extension", "")
|
||||
if sExtension ~= "" and type( sExtension ) == "string" then
|
||||
sPath = sPath .. "." .. sExtension
|
||||
end
|
||||
|
@ -525,7 +525,7 @@ function InterFace.drawBar()
|
||||
term.setCursorPos( TermW - 8, TermH )
|
||||
term.setBackgroundColor( colors.black )
|
||||
term.setTextColour(InterFace.cSpeedD)
|
||||
write(" <<" )
|
||||
write(" <<")
|
||||
if bPaused then
|
||||
term.setTextColour(InterFace.cSpeedA)
|
||||
else
|
||||
|
@ -1001,7 +1001,7 @@ function commands.cbreak( _sItem, _sTool )
|
||||
end
|
||||
end
|
||||
else
|
||||
print( "You can't break " .. sItem .. " with " .. sTool .. ".")
|
||||
print("You can't break " .. sItem .. " with " .. sTool .. ".")
|
||||
end
|
||||
|
||||
elseif tItem.creature == true then
|
||||
|
@ -1,7 +1,7 @@
|
||||
local tArgs = { ... }
|
||||
|
||||
local function printUsage()
|
||||
print( "Usages:")
|
||||
print( "Usages:" )
|
||||
print( "dj play" )
|
||||
print( "dj play <drive>" )
|
||||
print( "dj stop" )
|
||||
|
@ -89,7 +89,7 @@ local function drawMenu()
|
||||
|
||||
term.setTextColour( headingColour )
|
||||
term.setCursorPos(w - 11, 1)
|
||||
term.write( "DIFFICULTY ")
|
||||
term.write( "DIFFICULTY " )
|
||||
|
||||
term.setTextColour( textColour )
|
||||
term.setCursorPos(w, 1)
|
||||
|
@ -158,7 +158,7 @@ local block_T = {
|
||||
bg = colorass(colors.purple, colors.white),
|
||||
}
|
||||
|
||||
local blocks = { block_line, block_square, block_s1, block_s2, block_L1, block_L2, block_T}
|
||||
local blocks = { block_line, block_square, block_s1, block_s2, block_L1, block_L2, block_T }
|
||||
|
||||
local points = {4, 10, 30, 120}
|
||||
|
||||
|
@ -387,7 +387,7 @@ elseif sCommand == "join" then
|
||||
promptWindow.setCursorPos( 1, 1 )
|
||||
promptWindow.clearLine()
|
||||
promptWindow.setTextColor( highlightColour )
|
||||
promptWindow.write( ": ")
|
||||
promptWindow.write( ": " )
|
||||
promptWindow.setTextColor( textColour )
|
||||
|
||||
local sChat = read( nil, tSendHistory )
|
||||
|
@ -43,7 +43,7 @@ end
|
||||
|
||||
local function completePastebinPut(shell, text, previous)
|
||||
if previous[2] == "put" then
|
||||
return fs.complete(text, shell.dir(), true, false )
|
||||
return fs.complete( text, shell.dir(), true, false )
|
||||
end
|
||||
end
|
||||
|
||||
@ -106,7 +106,7 @@ if turtle then
|
||||
) )
|
||||
shell.setCompletionFunction( "rom/programs/turtle/turn.lua", completion.build(
|
||||
{ completion.choice, { "left", "right" }, true, many = true }
|
||||
))
|
||||
) )
|
||||
shell.setCompletionFunction( "rom/programs/turtle/equip.lua", completion.build(
|
||||
nil,
|
||||
{ completion.choice, { "left", "right" } }
|
||||
|
@ -356,7 +356,7 @@ function expect_mt:called_with_matching(...)
|
||||
return called_with_check(matches, self, ...)
|
||||
end
|
||||
|
||||
local expect = setmetatable( {
|
||||
local expect = setmetatable({
|
||||
--- Construct an expectation on the error message calling this function
|
||||
-- produces
|
||||
--
|
||||
|
@ -1,19 +1,19 @@
|
||||
describe("The http library", function()
|
||||
describe("http.checkURL", function()
|
||||
it("accepts well formed domains", function()
|
||||
expect({ http.checkURL("https://google.com")}):same({ true })
|
||||
expect({ http.checkURL("https://google.com") }):same({ true })
|
||||
end)
|
||||
|
||||
it("rejects malformed URLs", function()
|
||||
expect({ http.checkURL("google.com")}):same({ false, "Must specify http or https" })
|
||||
expect({ http.checkURL("https:google.com")}):same({ false, "URL malformed" })
|
||||
expect({ http.checkURL("https:/google.com")}):same({ false, "URL malformed" })
|
||||
expect({ http.checkURL("wss://google.com")}):same({ false, "Invalid protocol 'wss'" })
|
||||
expect({ http.checkURL("google.com") }):same({ false, "Must specify http or https" })
|
||||
expect({ http.checkURL("https:google.com") }):same({ false, "URL malformed" })
|
||||
expect({ http.checkURL("https:/google.com") }):same({ false, "URL malformed" })
|
||||
expect({ http.checkURL("wss://google.com") }):same({ false, "Invalid protocol 'wss'" })
|
||||
end)
|
||||
|
||||
it("rejects local domains", function()
|
||||
expect({ http.checkURL("http://localhost")}):same({ false, "Domain not permitted" })
|
||||
expect({ http.checkURL("http://127.0.0.1")}):same({ false, "Domain not permitted" })
|
||||
expect({ http.checkURL("http://localhost") }):same({ false, "Domain not permitted" })
|
||||
expect({ http.checkURL("http://127.0.0.1") }):same({ false, "Domain not permitted" })
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
@ -22,7 +22,7 @@ describe("cc.shell.completion", function()
|
||||
local spec = c.build(
|
||||
function() return { "a", "b", "c" } end,
|
||||
nil,
|
||||
{ c.choice, { "d", "e", "f"} }
|
||||
{ c.choice, { "d", "e", "f" } }
|
||||
)
|
||||
|
||||
expect(spec(shell, 1, "")):same { "a", "b", "c" }
|
||||
|
@ -52,14 +52,14 @@ describe("The pastebin program", function()
|
||||
local file = fs.open( "testup", "w" )
|
||||
file.close()
|
||||
|
||||
expect(capture(stub, "pastebin", "put", "testup" ))
|
||||
expect(capture(stub, "pastebin", "put", "testup"))
|
||||
:matches { ok = true, output = "Connecting to pastebin.com... Success.\nUploaded as https://pastebin.com/abcde\nRun \"pastebin get abcde\" to download anywhere\n", error = "" }
|
||||
end)
|
||||
|
||||
it("upload a not existing program to pastebin", function()
|
||||
setup_request()
|
||||
|
||||
expect(capture(stub, "pastebin", "put", "nothing" ))
|
||||
expect(capture(stub, "pastebin", "put", "nothing"))
|
||||
:matches { ok = true, output = "No such file\n", error = "" }
|
||||
end)
|
||||
|
||||
|
@ -2,7 +2,7 @@ local capture = require "test_helpers".capture_program
|
||||
|
||||
describe("The peripherals program", function()
|
||||
it("says when there are no peripherals", function()
|
||||
expect(capture(stub, "peripherals" ))
|
||||
expect(capture(stub, "peripherals"))
|
||||
:matches { ok = true, output = "Attached Peripherals:\nNone\n", error = "" }
|
||||
end)
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user