Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format line endings in multiline strings and comments #666

Merged
merged 3 commits into from
Mar 30, 2023

Conversation

JohnnyMorganz
Copy link
Owner

Fixes #665

@github-actions
Copy link
Contributor

Repo Comparison Test

diff --git ORI/zombie-strike/src/shared/ReplicatedStorage/Core/Memoize.lua ALT/zombie-strike/src/shared/ReplicatedStorage/Core/Memoize.lua
index 3d8bec7..f043dd0 100644
--- ORI/zombie-strike/src/shared/ReplicatedStorage/Core/Memoize.lua
+++ ALT/zombie-strike/src/shared/ReplicatedStorage/Core/Memoize.lua
@@ -1,31 +1,31 @@
---[[
-	memoize creates a function as a wrapper that caches the last outputs of a function.
-	This is useful if you know that the function should return the same output every
-	time it is run with the same inputs. The function should only return an output, and
-	not have any side effects. These side effects are not cached.
-
-	Without memoize's caching, even though the function ouputs the same values, the
-	memory locations of the values are different; tables made in the function, even if
-	they have the same values, won't be the same tables.
-
-	memoize only caches the last set of inputs and ouputs. This means that it is only
-	helpful when the function is likely to be called with the same inputs multiple
-	times in a row. This is the case with most Roact use cases.
-
-	Note that memoize only does a   ** shallow check on table inputs **   . This means
-	that if the same table is input but the elements of the table are different then
-	it will be assumed that the table has not changed.
-
-	In addition to all the previous warnings, memoize strips trailing nils. This means
-	that if foo is a memoized function and we call foo(), then foo(nil) will return a
-	cached value. This is opposed to how print handles input. print() only outputs a
-	new line, but print(nil) outputs "nil". This is because varargs can detect the
-	number of arguments passed in. So, be careful when using memoize with varargs.
-	Trailing nils will be stripped.
-
-	The wrapper can take any number of inputs and give any number of outputs.
-	Leading and interspersed nils are handled gracefully. Trailing nils on the input
-	are stripped.
+--[[
+	memoize creates a function as a wrapper that caches the last outputs of a function.
+	This is useful if you know that the function should return the same output every
+	time it is run with the same inputs. The function should only return an output, and
+	not have any side effects. These side effects are not cached.
+
+	Without memoize's caching, even though the function ouputs the same values, the
+	memory locations of the values are different; tables made in the function, even if
+	they have the same values, won't be the same tables.
+
+	memoize only caches the last set of inputs and ouputs. This means that it is only
+	helpful when the function is likely to be called with the same inputs multiple
+	times in a row. This is the case with most Roact use cases.
+
+	Note that memoize only does a   ** shallow check on table inputs **   . This means
+	that if the same table is input but the elements of the table are different then
+	it will be assumed that the table has not changed.
+
+	In addition to all the previous warnings, memoize strips trailing nils. This means
+	that if foo is a memoized function and we call foo(), then foo(nil) will return a
+	cached value. This is opposed to how print handles input. print() only outputs a
+	new line, but print(nil) outputs "nil". This is because varargs can detect the
+	number of arguments passed in. So, be careful when using memoize with varargs.
+	Trailing nils will be stripped.
+
+	The wrapper can take any number of inputs and give any number of outputs.
+	Leading and interspersed nils are handled gracefully. Trailing nils on the input
+	are stripped.
 ]]
 local function captureSize(...)
 	return { ... }, select("#", ...)
diff --git ORI/zombie-strike/src/shared/ReplicatedStorage/Core/Promise.lua ALT/zombie-strike/src/shared/ReplicatedStorage/Core/Promise.lua
index 99edd77..2b2907c 100644
--- ORI/zombie-strike/src/shared/ReplicatedStorage/Core/Promise.lua
+++ ALT/zombie-strike/src/shared/ReplicatedStorage/Core/Promise.lua
@@ -1,5 +1,5 @@
---[[
-	An implementation of Promises similar to Promise/A+.
+--[[
+	An implementation of Promises similar to Promise/A+.
 ]]
 
 local ERROR_YIELD_NEW =
@@ -12,10 +12,10 @@ local ERROR_NON_FUNCTION = "Please pass a handler function to %s!"
 
 local RunService = game:GetService("RunService")
 
---[[
-	Packs a number of arguments into a table and returns its length.
-
-	Used to cajole varargs without dropping sparse values.
+--[[
+	Packs a number of arguments into a table and returns its length.
+
+	Used to cajole varargs without dropping sparse values.
 ]]
 local function pack(...)
 	local len = select("#", ...)
@@ -23,8 +23,8 @@ local function pack(...)
 	return len, { ... }
 end
 
---[[
-	Returns first value (success), and packs all following values.
+--[[
+	Returns first value (success), and packs all following values.
 ]]
 local function packResult(...)
 	local result = (...)
@@ -32,10 +32,10 @@ local function packResult(...)
 	return result, pack(select(2, ...))
 end
 
---[[
-	Calls a non-yielding function in a new coroutine.
-
-	Handles errors if they happen.
+--[[
+	Calls a non-yielding function in a new coroutine.
+
+	Handles errors if they happen.
 ]]
 local function ppcall(yieldError, callback, ...)
 	-- Wrapped because C functions can't be passed to coroutine.create!
@@ -52,9 +52,9 @@ local function ppcall(yieldError, callback, ...)
 	return ok, len, result
 end
 
---[[
-	Creates a function that invokes a callback with correct error handling and
-	resolution mechanisms.
+--[[
+	Creates a function that invokes a callback with correct error handling and
+	resolution mechanisms.
 ]]
 local function createAdvancer(traceback, callback, resolve, reject)
 	return function(...)
@@ -87,17 +87,17 @@ Promise.Status = setmetatable({
 	end,
 })
 
---[[
-	Constructs a new Promise with the given initializing callback.
-
-	This is generally only called when directly wrapping a non-promise API into
-	a promise-based version.
-
-	The callback will receive 'resolve' and 'reject' methods, used to start
-	invoking the promise chain.
-
-	Second parameter, parent, is used internally for tracking the "parent" in a
-	promise chain. External code shouldn't need to worry about this.
+--[[
+	Constructs a new Promise with the given initializing callback.
+
+	This is generally only called when directly wrapping a non-promise API into
+	a promise-based version.
+
+	The callback will receive 'resolve' and 'reject' methods, used to start
+	invoking the promise chain.
+
+	Second parameter, parent, is used internally for tracking the "parent" in a
+	promise chain. External code shouldn't need to worry about this.
 ]]
 function Promise.new(callback, parent)
 	if parent ~= nil and not Promise.is(parent) then
@@ -196,8 +196,8 @@ function Promise._new(traceback, executor, ...)
 	end, ...)
 end
 
---[[
-	Promise.new, except pcall on a new thread is automatic.
+--[[
+	Promise.new, except pcall on a new thread is automatic.
 ]]
 function Promise.async(callback)
 	local traceback = debug.traceback()
@@ -218,8 +218,8 @@ function Promise.async(callback)
 	return promise
 end
 
---[[
-	Create a promise that represents the immediately resolved value.
+--[[
+	Create a promise that represents the immediately resolved value.
 ]]
 function Promise.resolve(...)
 	local length, values = pack(...)
@@ -228,8 +228,8 @@ function Promise.resolve(...)
 	end)
 end
 
---[[
-	Create a promise that represents the immediately rejected value.
+--[[
+	Create a promise that represents the immediately rejected value.
 ]]
 function Promise.reject(...)
 	local length, values = pack(...)
@@ -238,17 +238,17 @@ function Promise.reject(...)
 	end)
 end
 
---[[
-	Begins a Promise chain, turning synchronous errors into rejections.
+--[[
+	Begins a Promise chain, turning synchronous errors into rejections.
 ]]
 function Promise.try(...)
 	return Promise.resolve():andThenCall(...)
 end
 
---[[
-	Returns a new promise that:
-		* is resolved when all input promises resolve
-		* is rejected if ANY input promises reject
+--[[
+	Returns a new promise that:
+		* is resolved when all input promises resolve
+		* is rejected if ANY input promises reject
 ]]
 function Promise._all(traceback, promises, amount)
 	if type(promises) ~= "table" then
@@ -409,9 +409,9 @@ function Promise.allSettled(promises)
 	end)
 end
 
---[[
-	Races a set of Promises and returns the first one that resolves,
-	cancelling the others.
+--[[
+	Races a set of Promises and returns the first one that resolves,
+	cancelling the others.
 ]]
 function Promise.race(promises)
 	assert(type(promises) == "table", ERROR_NON_LIST:format("Promise.race"))
@@ -452,8 +452,8 @@ function Promise.race(promises)
 	end)
 end
 
---[[
-	Is the given object a Promise instance?
+--[[
+	Is the given object a Promise instance?
 ]]
 function Promise.is(object)
 	if type(object) ~= "table" then
@@ -463,8 +463,8 @@ function Promise.is(object)
 	return type(object.andThen) == "function"
 end
 
---[[
-	Converts a yielding function into a Promise-returning one.
+--[[
+	Converts a yielding function into a Promise-returning one.
 ]]
 function Promise.promisify(callback)
 	return function(...)
@@ -483,8 +483,8 @@ function Promise.promisify(callback)
 	end
 end
 
---[[
-	Creates a Promise that resolves after given number of seconds.
+--[[
+	Creates a Promise that resolves after given number of seconds.
 ]]
 do
 	local connection
@@ -544,8 +544,8 @@ do
 	end
 end
 
---[[
-	Rejects the promise after `seconds` seconds.
+--[[
+	Rejects the promise after `seconds` seconds.
 ]]
 function Promise.prototype:timeout(seconds, timeoutValue)
 	return Promise.race({
@@ -560,10 +560,10 @@ function Promise.prototype:getStatus()
 	return self._status
 end
 
---[[
-	Creates a new promise that receives the result of this promise.
-
-	The given callbacks are invoked depending on that result.
+--[[
+	Creates a new promise that receives the result of this promise.
+
+	The given callbacks are invoked depending on that result.
 ]]
 function Promise.prototype:_andThen(traceback, successHandler, failureHandler)
 	self._unhandledRejection = false
@@ -608,17 +608,17 @@ function Promise.prototype:andThen(successHandler, failureHandler)
 	return self:_andThen(debug.traceback(), successHandler, failureHandler)
 end
 
---[[
-	Used to catch any errors that may have occurred in the promise.
+--[[
+	Used to catch any errors that may have occurred in the promise.
 ]]
 function Promise.prototype:catch(failureCallback)
 	assert(failureCallback == nil or type(failureCallback) == "function", ERROR_NON_FUNCTION:format("Promise:catch"))
 	return self:_andThen(debug.traceback(), nil, failureCallback)
 end
 
---[[
-	Like andThen, but the value passed into the handler is also the
-	value returned from the handler.
+--[[
+	Like andThen, but the value passed into the handler is also the
+	value returned from the handler.
 ]]
 function Promise.prototype:tap(tapCallback)
 	assert(type(tapCallback) == "function", ERROR_NON_FUNCTION:format("Promise:tap"))
@@ -636,8 +636,8 @@ function Promise.prototype:tap(tapCallback)
 	end)
 end
 
---[[
-	Calls a callback on `andThen` with specific arguments.
+--[[
+	Calls a callback on `andThen` with specific arguments.
 ]]
 function Promise.prototype:andThenCall(callback, ...)
 	assert(type(callback) == "function", ERROR_NON_FUNCTION:format("Promise:andThenCall"))
@@ -647,8 +647,8 @@ function Promise.prototype:andThenCall(callback, ...)
 	end)
 end
 
---[[
-	Shorthand for an andThen handler that returns the given value.
+--[[
+	Shorthand for an andThen handler that returns the given value.
 ]]
 function Promise.prototype:andThenReturn(...)
 	local length, values = pack(...)
@@ -657,9 +657,9 @@ function Promise.prototype:andThenReturn(...)
 	end)
 end
 
---[[
-	Cancels the promise, disallowing it from rejecting or resolving, and calls
-	the cancellation hook if provided.
+--[[
+	Cancels the promise, disallowing it from rejecting or resolving, and calls
+	the cancellation hook if provided.
 ]]
 function Promise.prototype:cancel()
 	if self._status ~= Promise.Status.Started then
@@ -683,9 +683,9 @@ function Promise.prototype:cancel()
 	self:_finalize()
 end
 
---[[
-	Used to decrease the number of consumers by 1, and if there are no more,
-	cancel this promise.
+--[[
+	Used to decrease the number of consumers by 1, and if there are no more,
+	cancel this promise.
 ]]
 function Promise.prototype:_consumerCancelled(consumer)
 	if self._status ~= Promise.Status.Started then
@@ -699,9 +699,9 @@ function Promise.prototype:_consumerCancelled(consumer)
 	end
 end
 
---[[
-	Used to set a handler for when the promise resolves, rejects, or is
-	cancelled. Returns a new promise chained from this promise.
+--[[
+	Used to set a handler for when the promise resolves, rejects, or is
+	cancelled. Returns a new promise chained from this promise.
 ]]
 function Promise.prototype:_finally(traceback, finallyHandler, onlyOk)
 	if not onlyOk then
@@ -741,8 +741,8 @@ function Promise.prototype:finally(finallyHandler)
 	return self:_finally(debug.traceback(), finallyHandler)
 end
 
---[[
-	Calls a callback on `finally` with specific arguments.
+--[[
+	Calls a callback on `finally` with specific arguments.
 ]]
 function Promise.prototype:finallyCall(callback, ...)
 	assert(type(callback) == "function", ERROR_NON_FUNCTION:format("Promise:finallyCall"))
@@ -752,8 +752,8 @@ function Promise.prototype:finallyCall(callback, ...)
 	end)
 end
 
---[[
-	Shorthand for a finally handler that returns the given value.
+--[[
+	Shorthand for a finally handler that returns the given value.
 ]]
 function Promise.prototype:finallyReturn(...)
 	local length, values = pack(...)
@@ -762,16 +762,16 @@ function Promise.prototype:finallyReturn(...)
 	end)
 end
 
---[[
-	Similar to finally, except rejections are propagated through it.
+--[[
+	Similar to finally, except rejections are propagated through it.
 ]]
 function Promise.prototype:done(finallyHandler)
 	assert(finallyHandler == nil or type(finallyHandler) == "function", ERROR_NON_FUNCTION:format("Promise:finallyO"))
 	return self:_finally(debug.traceback(), finallyHandler, true)
 end
 
---[[
-	Calls a callback on `done` with specific arguments.
+--[[
+	Calls a callback on `done` with specific arguments.
 ]]
 function Promise.prototype:doneCall(callback, ...)
 	assert(type(callback) == "function", ERROR_NON_FUNCTION:format("Promise:doneCall"))
@@ -781,8 +781,8 @@ function Promise.prototype:doneCall(callback, ...)
 	end, true)
 end
 
---[[
-	Shorthand for a done handler that returns the given value.
+--[[
+	Shorthand for a done handler that returns the given value.
 ]]
 function Promise.prototype:doneReturn(...)
 	local length, values = pack(...)
@@ -791,10 +791,10 @@ function Promise.prototype:doneReturn(...)
 	end, true)
 end
 
---[[
-	Yield until the promise is completed.
-
-	This matches the execution model of normal Roblox functions.
+--[[
+	Yield until the promise is completed.
+
+	This matches the execution model of normal Roblox functions.
 ]]
 function Promise.prototype:awaitStatus()
 	self._unhandledRejection = false
@@ -819,8 +819,8 @@ function Promise.prototype:awaitStatus()
 	return self._status
 end
 
---[[
-	Calls awaitStatus internally, returns (isResolved, values...)
+--[[
+	Calls awaitStatus internally, returns (isResolved, values...)
 ]]
 function Promise.prototype:await(...)
 	local length, result = pack(self:awaitStatus(...))
@@ -829,9 +829,9 @@ function Promise.prototype:await(...)
 	return status == Promise.Status.Resolved, unpack(result, 1, length - 1)
 end
 
---[[
-	Calls await and only returns if the Promise resolves.
-	Throws if the Promise rejects or gets cancelled.
+--[[
+	Calls await and only returns if the Promise resolves.
+	Throws if the Promise rejects or gets cancelled.
 ]]
 function Promise.prototype:expect(...)
 	local length, result = pack(self:awaitStatus(...))
@@ -844,12 +844,12 @@ end
 
 Promise.prototype.awaitValue = Promise.prototype.expect
 
---[[
-	Intended for use in tests.
-
-	Similar to await(), but instead of yielding if the promise is unresolved,
-	_unwrap will throw. This indicates an assumption that a promise has
-	resolved.
+--[[
+	Intended for use in tests.
+
+	Similar to await(), but instead of yielding if the promise is unresolved,
+	_unwrap will throw. This indicates an assumption that a promise has
+	resolved.
 ]]
 function Promise.prototype:_unwrap()
 	if self._status == Promise.Status.Started then
@@ -957,10 +957,10 @@ function Promise.prototype:_reject(...)
 	self:_finalize()
 end
 
---[[
-	Calls any :finally handlers. We need this to be a separate method and
-	queue because we must call all of the finally callbacks upon a success,
-	failure, *and* cancellation.
+--[[
+	Calls any :finally handlers. We need this to be a separate method and
+	queue because we must call all of the finally callbacks upon a success,
+	failure, *and* cancellation.
 ]]
 function Promise.prototype:_finalize()
 	for _, callback in ipairs(self._queuedFinally) do
diff --git ORI/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/Modalifier.lua ALT/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/Modalifier.lua
index 6d80424..16e107f 100644
--- ORI/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/Modalifier.lua
+++ ALT/zombie-strike/src/shared/ReplicatedStorage/Core/UI/Components/Modalifier.lua
@@ -1,13 +1,13 @@
---[[
-	Modalifier uses Roact.Portal and an invisible TextButton called "Curtain" to create
-	modal behavior ("modal" as in modal dialog). This can be used for implementing a
-	transient piece of UI that demands user attention, such as a popup menu.
-
-	Properites:
-		Window - the entire window you want to cover with the curtain
-		Render - function, takes the absolute position as an argument and
-			returns a roact component that's meant to go in front of the Curtain
-		OnClosed - callback when the curtain gets clicked
+--[[
+	Modalifier uses Roact.Portal and an invisible TextButton called "Curtain" to create
+	modal behavior ("modal" as in modal dialog). This can be used for implementing a
+	transient piece of UI that demands user attention, such as a popup menu.
+
+	Properites:
+		Window - the entire window you want to cover with the curtain
+		Render - function, takes the absolute position as an argument and
+			returns a roact component that's meant to go in front of the Curtain
+		OnClosed - callback when the curtain gets clicked
 ]]
 local ReplicatedStorage = game:GetService("ReplicatedStorage")
 
diff --git ORI/zombie-strike/src/shared/ReplicatedStorage/Core/inspect.lua ALT/zombie-strike/src/shared/ReplicatedStorage/Core/inspect.lua
index 1c7fc77..6eb10aa 100644
--- ORI/zombie-strike/src/shared/ReplicatedStorage/Core/inspect.lua
+++ ALT/zombie-strike/src/shared/ReplicatedStorage/Core/inspect.lua
@@ -2,29 +2,29 @@ local inspect = {
 	_VERSION = "inspect.lua 3.1.0",
 	_URL = "http://github.com/kikito/inspect.lua",
 	_DESCRIPTION = "human-readable representations of tables",
-	_LICENSE = [[
-	  MIT LICENSE
-
-	  Copyright (c) 2013 Enrique García Cota
-
-	  Permission is hereby granted, free of charge, to any person obtaining a
-	  copy of this software and associated documentation files (the
-	  "Software"), to deal in the Software without restriction, including
-	  without limitation the rights to use, copy, modify, merge, publish,
-	  distribute, sublicense, and/or sell copies of the Software, and to
-	  permit persons to whom the Software is furnished to do so, subject to
-	  the following conditions:
-
-	  The above copyright notice and this permission notice shall be included
-	  in all copies or substantial portions of the Software.
-
-	  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-	  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-	  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-	  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-	  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-	  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-	  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+	_LICENSE = [[
+	  MIT LICENSE
+
+	  Copyright (c) 2013 Enrique García Cota
+
+	  Permission is hereby granted, free of charge, to any person obtaining a
+	  copy of this software and associated documentation files (the
+	  "Software"), to deal in the Software without restriction, including
+	  without limitation the rights to use, copy, modify, merge, publish,
+	  distribute, sublicense, and/or sell copies of the Software, and to
+	  permit persons to whom the Software is furnished to do so, subject to
+	  the following conditions:
+
+	  The above copyright notice and this permission notice shall be included
+	  in all copies or substantial portions of the Software.
+
+	  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+	  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+	  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+	  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+	  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+	  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+	  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 	]],
 }
 
diff --git ORI/zombie-strike/src/shared/ReplicatedStorage/RuddevModules/Effects/Shatter.lua ALT/zombie-strike/src/shared/ReplicatedStorage/RuddevModules/Effects/Shatter.lua
index b83d85f..95265a8 100644
--- ORI/zombie-strike/src/shared/ReplicatedStorage/RuddevModules/Effects/Shatter.lua
+++ ALT/zombie-strike/src/shared/ReplicatedStorage/RuddevModules/Effects/Shatter.lua
@@ -19,7 +19,7 @@ return function(character, betterEquipment)
 	local spark = script[boost].SparkEmitter:Clone()
 	spark.Parent = upperTorso
 
-	--[[local sound	 = script[boost .. "Sound"]:Clone()
+	--[[local sound	 = script[boost .. "Sound"]:Clone()
 		sound.Parent = upperTorso]]
 
 	icon:Emit(10)
diff --git ORI/nvim-lspconfig/lua/lspconfig/server_configurations/ecsact.lua ALT/nvim-lspconfig/lua/lspconfig/server_configurations/ecsact.lua
index 95f3768..26ff913 100644
--- ORI/nvim-lspconfig/lua/lspconfig/server_configurations/ecsact.lua
+++ ALT/nvim-lspconfig/lua/lspconfig/server_configurations/ecsact.lua
@@ -21,7 +21,7 @@ https://github.com/ecsact-dev/ecsact_lsp_server
 
 Language server for Ecsact.
 
-The default cmd assumes `ecsact_lsp_server` is in your PATH. Typically from the
+The default cmd assumes `ecsact_lsp_server` is in your PATH. Typically from the
 Ecsact SDK: https://ecsact.dev/start
 ]],
   },

@JohnnyMorganz JohnnyMorganz merged commit b8c65f3 into main Mar 30, 2023
@JohnnyMorganz JohnnyMorganz deleted the multiline-comment-line-endings branch March 30, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Line endings appear to not be converted when they occur in multiline comments (?)
1 participant