trixnz / lua-fmt

lua-fmt is pretty-printer for Lua code
MIT License
189 stars 25 forks source link

Compilation and indentation fixes #19

Closed ThaisRobba closed 6 years ago

ThaisRobba commented 6 years ago

Master version was not compiling - wrong type on util.ts.

Fixes indentation issues when multiple assignments are on the right side:

-- before:
local a,
    b,
    c,
    d,
    e,
    f =
    emptyFunction(),
emptyFunction(
    function()
        return true
    end
)

-- after:
local a,
    b,
    c,
    d,
    e,
    f =
    emptyFunction(),
    emptyFunction(
        function()
            return true
        end
    )

Also fixes #18

trixnz commented 6 years ago

Wow, nice work!

Few things about the tests; lua-5.3.4-tests is reserved for a tests distributed with Lua, so there's a high chance your tests would be stomped if ever these were updated. Could you please move them to an appropriate file under tests/? Feel free to create a new test category, if required.

Additionally, when writing new tests, could you please also update the snapshots with jest --updateSnapshot.

ThaisRobba commented 6 years ago

I'll update the tests asap :)

ThaisRobba commented 6 years ago

While updating the tests I noticed that a lua53 command is spawned. Might be worth adding to the README.md that this command is expected to exist :)

ThaisRobba commented 6 years ago

@trixnz Finally updated tests (sorry for the huge delay!).