lua-fmt icon indicating copy to clipboard operation
lua-fmt copied to clipboard

Exit with code EX_DATAERR if --list-different and formatting needed

Open dignite opened this issue 6 years ago • 1 comments

--list-different teaser

Why

In order to ensure lua-fmt has been run We want to be able to run lua-fmt --list-different that exits with exit code above 0 if formatting was needed

How

Exit code EX_DATAERR (65) selected after consulting sysexits(3) Same flag and behavior as in prettier.

Tests on Windows 10

I had a failing test locally even before starting and was not able to resolve it.

  • node --version = v8.6.0
  • npm --version = 5.3.0
  • OS = Windows 10
 FAIL  test\lua-5.3.4.test.ts
  ● Lua 5.3.4 standalone tests › strings.lua can still pass tests after being formatted

    Error
      Error: lua53: stdin:214: assertion failed!
      stack traceback:
        [C]: in function 'assert'
        stdin:214: in main chunk
        [C]: in ?

dignite avatar Oct 16 '18 18:10 dignite

Ping @trixnz

dignite avatar Oct 26 '18 20:10 dignite