lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 2017-06-14 04:47 PM, Coda Highland wrote:
On Wed, Jun 14, 2017 at 2:45 PM, David Goehrig <dave@nexttolast.com> wrote:
On Wed, Jun 14, 2017 at 3:31 PM, Soni L. <fakedme@gmail.com> wrote:

<tab><tab>local function uh(oops, something, tells, me, this, is, a,
giant,
<tab><tab><tab><tab><tab>fail)
<tab><tab>end

Have fun getting that aligned.

My scripts won't align that, and they would reject that code for a number of
reasons:

1.) too many layers of indentation
2.) too many parameters to  the function
3.) function is a no-op / has no lines of code
etc.

Granted you'd fail code review on my team if you submitted something that
looked like that :)

Dave
Mine would end up aligning it as:

\t\tlocal function uh(
\t\t\toops,
\t\t\tsomething,
\t\t\ttells,
\t\t\tme,
\t\t\tthis,
\t\t\tis,
\t\t\ta,
\t\t\tgiant,
\t\t\tfail
\t\t)
\t\t\t-- body
\t\tend

It still wouldn't pass code review, but at least it's consistent. ;)

/s/ Adam


\tlocal function f(u)
\t\tlocal v = u:match('^([^/]+)/') ..
\t\t\t\t\t\t\tu:match('^[^/]+/[^:]+(:.*)$')
\t\tif v:match("^nope:") then
\t\t\treturn nil, v:match("^nope:(.*)$")
\t\tend
\t\treturn v
\tend

Have fun getting line 3 to align with line 2 when you're not using tab width = 2.

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.