Fix all whitespace errors

Now nobody's commit should be flagged by Travis unless it actually
introduces whitespace errors (which we do want to check for).

This doesn't fully sort out indentation everywhere, but does fix all
whitespace that Git doesn't like. You can check the whitespace across
the entire codebase with:

    git diff-tree --check "$(git hash-object -t tree /dev/null)" HEAD
This commit is contained in:
AbigailBuccaneer 2018-02-01 12:37:37 +00:00
parent b218ccb3ab
commit 9ae1f5504f
342 changed files with 1783 additions and 1796 deletions

View File

@ -24,7 +24,7 @@ install:
- luarocks list --outdated --porcelain | awk '{ print $1, $3 }' | xargs --no-run-if-empty -n 2 luarocks install
script:
- git -c core.whitespace=-blank-at-eol,-blank-at-eof,-space-before-tab diff --check $TRAVIS_COMMIT_RANGE
- git diff --check $TRAVIS_COMMIT_RANGE
- git diff --name-only $TRAVIS_COMMIT_RANGE | grep '\.lua$' | grep -v '^lua/entities/gmod_wire_expression2/core/' | xargs --no-run-if-empty luacheck
- luacheck .luacheckrc

View File

@ -73,5 +73,3 @@ void AsyncThread()
glEnd();
}

View File

@ -120,4 +120,3 @@ vec2f _a_73,272,440
string _s_74,'Y: %f'
vec2f _a_76,272,456
string _s_77,'Z: %f'

View File

@ -500,5 +500,3 @@ vec4f GL_VROTATE;
vec4f GL_VTRANSLATE;
vec4f GL_VPERSPECTIVE;
vec4f GL_VSCALE,1,1,1,0;

View File

@ -13,7 +13,7 @@ float __GLT_VERTCNT = 0;
void gltVertex(float x, float y, float z)
{
if ((__GLT_VERTCNT / 3) >= GLT_MAX_TRIANGLES)
return;
return;
float* ptr = __GLT_VERTBUFF;
ptr += (__GLT_VERTCNT * 3);

View File

@ -154,4 +154,3 @@ db 47,47,47,-1, 66,66,66,-1, 75,75,75,-1, 54,54,54,-1, 66,66,66,-1, 66,66,66,-1;
db 64,-1,64,-1, 64,64,64,-1, -1,-1,58,58, 59,59,59,59, 59,59,59,59, 59,59,59,-1;
db 0; // End string

View File

@ -132,7 +132,7 @@ end
function ENT:OnRemove()
for k, _ in pairs( self.clutch_ballsockets ) do
for k, v in pairs( self.clutch_ballsockets ) do
self:RemoveClutch( k )

View File

@ -10,7 +10,7 @@ local cpu_max_frequency = 1400000
local wire_cpu_max_frequency = CreateConVar("wire_cpu_max_frequency", cpu_max_frequency, FCVAR_REPLICATED)
cvars.AddChangeCallback("wire_cpu_max_frequency",function()
cpu_max_frequency = math.Clamp(math.floor(wire_cpu_max_frequency:GetInt()),1,30000000)
cpu_max_frequency = math.Clamp(math.floor(wire_cpu_max_frequency:GetInt()),1,30000000)
end)
function ENT:Initialize()

View File

@ -151,9 +151,9 @@ local function Convert_hsl2rgb(h, s, l)
end
local function Convert_rgb2hsl(r, g, b)
r = r / 255
g = g / 255
b = b / 255
r = r / 255
g = g / 255
b = b / 255
local max = math.max(r, g, b)
local min = math.min(r, g, b)
local h = (max + min) / 2

View File

@ -8,8 +8,8 @@ local function validConCmd(self, command)
local ply = self.player
if not ply:IsValid() then return false end
if ply:GetInfoNum("wire_expression2_concmd", 0) == 0 then return false end
-- Validating the concmd length to ensure that it won't crash the server.
if #command > 500000 then return false end
-- Validating the concmd length to ensure that it won't crash the server.
if #command > 500000 then return false end
local whitelist = (ply:GetInfo("wire_expression2_concmd_whitelist") or ""):Trim()
if whitelist == "" then return true end

View File

@ -1,4 +1,3 @@
/******************************************************************************\
User defined support
\******************************************************************************/

View File

@ -186,5 +186,3 @@ end
registerCallback("construct", function(self)
self.data.effect_burst = wire_expression2_effect_burst_max:GetInt()
end)

View File

@ -152,7 +152,7 @@ local function GetModel(self, model, skin)
-- If this model isn't already the absolute path of a default model, and only default models are allowed
elseif not pathLookup[model] and wire_holograms_modelany:GetInt() == 0 then
return false
return false
end
if wire_holograms_modelany:GetInt() ~= 2 and not WireLib.CanModel(self.player, model, skin) then
@ -818,7 +818,7 @@ e2function vector holoBoneScale(index, boneindex)
if table.Count(Holo.bone_scale) <= 0 then return {0,0,0} end
for bidx,b_scale in pairs(Holo.bone_scale) do
if bidx == boneindex then return b_scale end
if bidx == boneindex then return b_scale end
end
return {0,0,0}

View File

@ -109,8 +109,8 @@ __e2setcost(20) -- temporary
e2function number string:toNumber()
local ret = tonumber(this)
if ret == nil then return 0 end
return ret
if ret == nil then return 0 end
return ret
end
e2function number string:toNumber(number base)

View File

@ -833,7 +833,7 @@ function VM:ReadString(address)
currentChar = self:ReadCell(address + charCount)
-- Reading failed
if not currentChar then
return
return
elseif currentChar > 0 and currentChar < 255 then
charString = charString .. string.char(currentChar)
elseif currentChar ~= 0 then

View File

@ -43,8 +43,8 @@ function ENT:Setup(xyz_mode, outdist, outbrng, gpscord, direction_vector, direct
table.insert(onames, "Z")
end
if (outbrng) then
table.insert(onames, "Bearing")
table.insert(onames, "Elevation")
table.insert(onames, "Bearing")
table.insert(onames, "Elevation")
end
if (gpscord) then
table.insert(onames, "World_X")

View File

@ -43,13 +43,13 @@ end
function ENT:Setup( model, filter, owneronly, sizex, sizey, sizez, offsetx, offsety, offsetz )
filter = math.Clamp( filter, 0, 2 )
sizex = math.Clamp( sizex, -1000, 1000 )
sizey = math.Clamp( sizey, -1000, 1000 )
sizez = math.Clamp( sizez, -1000, 1000 )
offsetx = math.Clamp( offsetx, -1000, 1000 )
offsety = math.Clamp( offsety, -1000, 1000 )
offsetz = math.Clamp( offsetz, -1000, 1000 )
filter = math.Clamp( filter, 0, 2 )
sizex = math.Clamp( sizex, -1000, 1000 )
sizey = math.Clamp( sizey, -1000, 1000 )
sizez = math.Clamp( sizez, -1000, 1000 )
offsetx = math.Clamp( offsetx, -1000, 1000 )
offsety = math.Clamp( offsety, -1000, 1000 )
offsetz = math.Clamp( offsetz, -1000, 1000 )
self.model = model
self.filter = filter
self.owneronly = owneronly

View File

@ -434,22 +434,22 @@ if CLIENT then
function CPULib.ShowDocumentation(platform)
local w = ScrW() * 2/3
local h = ScrH() * 2/3
local h = ScrH() * 2/3
local browserWindow = vgui.Create("DFrame")
browserWindow:SetTitle("Documentation")
browserWindow:SetPos((ScrW() - w)/2, (ScrH() - h)/2)
browserWindow:SetSize(w,h)
browserWindow.OnClose = function()
browser = nil
browserWindow = nil
end
browserWindow:SetPos((ScrW() - w)/2, (ScrH() - h)/2)
browserWindow:SetSize(w,h)
browserWindow.OnClose = function()
browser = nil
browserWindow = nil
end
browserWindow:MakePopup()
local browser = vgui.Create("DHTML",browserWindow)
browser:SetPos(10, 25)
browser:SetSize(w - 20, h - 35)
local browser = vgui.Create("DHTML",browserWindow)
browser:SetPos(10, 25)
browser:SetSize(w - 20, h - 35)
browser:OpenURL("http://wiki.wiremod.com/wiki/Category:ZCPU_Handbook")
browser:OpenURL("http://wiki.wiremod.com/wiki/Category:ZCPU_Handbook")
end
end

View File

@ -310,49 +310,49 @@ GateActions["string_to_memory"] = {
reset = function(gate)
gate.stringQueued = false
gate.stringChanged = false
gate.currentString = ""
gate.currentString = ""
end,
output = function(gate, A)
if (A ~= gate.currentString) then
if (not gate.stringChanged) then
gate.stringChanged = true
gate.currentString = A
gate.stringQueued = false
else
gate.stringQueued = true
end
if (not gate.stringChanged) then
gate.stringChanged = true
gate.currentString = A
gate.stringQueued = false
else
gate.stringQueued = true
end
end
return gate.Outputs["Memory"].Value --This will prevent Wire_TriggerOutput from changing anything
return gate.Outputs["Memory"].Value --This will prevent Wire_TriggerOutput from changing anything
end,
ReadCell = function(self, gate, Address)
if (Address == 0) then --Clk
if (gate.stringChanged) then return 1 else return 0 end
elseif (Address == 1) then --String length
return #(gate.currentString)
else --Return string bytes
local index = Address - 1
if (index > #(gate.currentString)) then -- Check whether requested address is outside the string
return 0
else
return string.byte(gate.currentString, index)
end
end
if (Address == 0) then --Clk
if (gate.stringChanged) then return 1 else return 0 end
elseif (Address == 1) then --String length
return #(gate.currentString)
else --Return string bytes
local index = Address - 1
if (index > #(gate.currentString)) then -- Check whether requested address is outside the string
return 0
else
return string.byte(gate.currentString, index)
end
end
end,
WriteCell = function(self, gate, Address, value)
if (Address == 0) and (value == 0) then --String got accepted
gate.stringChanged = false
if (Address == 0) and (value == 0) then --String got accepted
gate.stringChanged = false
if gate.stringQueued then --Get queued string
gate.stringQueued = false
gate.currentString = gate.Inputs["A"].Value
gate.stringChanged = true
end
return true
else
return false
end
else
return false
end
end
}
@ -370,21 +370,21 @@ GateActions["string_from_memory"] = {
end,
output = function(gate)
return gate.currentString, gate.Outputs["Memory"].Value
return gate.currentString, gate.Outputs["Memory"].Value
end,
ReadCell = function(self, gate, address)
if (address == 0) then
return 0
elseif (address == 1) then
return gate.stringLength
else
return gate.memory[address-1] or 0 -- "or 0" to prevent it from returning nil if index is outside the array
end
if (address == 0) then
return 0
elseif (address == 1) then
return gate.stringLength
else
return gate.memory[address-1] or 0 -- "or 0" to prevent it from returning nil if index is outside the array
end
end,
WriteCell = function(self, gate, address, value)
if (value >= 0) then
if (value >= 0) then
if (address == 0) and (value == 1) then -- Clk has been set
local maxIndex = gate.stringLength
for i=1,gate.stringLength,1 do

View File

@ -8,7 +8,7 @@ function ModelPlug_Register(category)
local packs = file.Find("WireModelPacks/*.txt", "DATA")
for _,filename in pairs(packs) do
--resource.AddFile("data/WireModelPacks/" .. filename)
--resource.AddFile("data/WireModelPacks/" .. filename)
local packtbl = util.KeyValuesToTable(file.Read("WireModelPacks/" .. filename) or {})

View File

@ -18,5 +18,3 @@ end
function TOOL.BuildCPanel(panel)
ModelPlug_AddToCPanel(panel, "gate", "wire_datarate", nil, 4)
end

View File

@ -14,4 +14,3 @@ TOOL.ClientConVar[ "model" ] = "models/jaanus/wiretool/wiretool_gate.mdl"
function TOOL.BuildCPanel(panel)
WireDermaExts.ModelSelect(panel, "wire_extbus_model", list.Get("Wire_gate_Models"), 5)
end

View File

@ -92,4 +92,3 @@ function TOOL.BuildCPanel(panel)
panel:CheckBox("#WireWaypointTool_alink","wire_waypoint_alink")
panel:CheckBox("#Create Flat to Surface", "wire_waypoint_createflat")
end

View File

@ -2,8 +2,8 @@
"Refract"
{
"$refractamount" "0.0"
"$bluramount" "1"
"$refractamount" "0.0"
"$bluramount" "1"
"$REFRACTTINT" "{110 110 120}"
"$scale" "[1 1]"

View File

@ -1,6 +1,6 @@
"UnlitGeneric"
{
"$basetexture" "sprites/physbeam"
"$basetexture" "sprites/physbeam"
"$additive" 1
"$vertexcolor" 1
"$vertexalpha" 1

View File

@ -1,7 +1,7 @@
"Refract"
{
"$refractamount" "0.03"
"$bluramount" "0"
"$refractamount" "0.03"
"$bluramount" "0"
"$scale" "[1 1]"

View File

@ -1,7 +1,7 @@
"Refract"
{
"$refractamount" "0.0"
"$bluramount" "0"
"$refractamount" "0.0"
"$bluramount" "0"
"$scale" "[1 1]"

View File

@ -1,7 +1,7 @@
"Refract"
{
"$refractamount" "1"
"$bluramount" "0"
"$refractamount" "1"
"$bluramount" "0"
"$REFRACTTINT" "{255 255 255}"
"$scale" "[1 1]"

View File

@ -1,6 +1,6 @@
"UnlitGeneric"
{
"$basetexture" "laser"
"$basetexture" "laser"
"$additive" 1
"$vertexcolor" 1
"$vertexalpha" 1

View File

@ -4,8 +4,8 @@
"$surfaceprop" "plastic"
"$phong" "1"
"$halflambert" 1
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$model" 1
}

View File

@ -4,8 +4,8 @@
"$surfaceprop" "plastic"
"$phong" "1"
"$halflambert" 1
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$model" 1
}

View File

@ -4,8 +4,8 @@
"$surfaceprop" "plastic"
"$phong" "1"
"$halflambert" 1
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$model" 1
}

View File

@ -4,8 +4,8 @@
"$surfaceprop" "plastic"
"$phong" "1"
"$halflambert" 1
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$model" 1
}

View File

@ -4,8 +4,8 @@
"$surfaceprop" "plastic"
"$phong" "1"
"$halflambert" 1
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$model" 1
}

View File

@ -4,8 +4,8 @@
"$surfaceprop" "plastic"
"$phong" "1"
"$halflambert" 1
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$model" 1
}

View File

@ -4,8 +4,8 @@
"$surfaceprop" "plastic"
"$phong" "1"
"$halflambert" 1
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$model" 1
}

View File

@ -4,8 +4,8 @@
"$surfaceprop" "plastic"
"$phong" "1"
"$halflambert" 1
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$model" 1
}

View File

@ -4,8 +4,8 @@
"$surfaceprop" "plastic"
"$phong" "1"
"$halflambert" 1
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$model" 1
}

View File

@ -4,9 +4,9 @@
"$surfaceprop" "plastic"
"$phong" "1"
"$halflambert" 1
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$phongexponent" "60"
"$phongboost" "2"
"$phongfresnelranges" "[.5 .8 1]"
"$model" 1