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

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dignite
Copy link

@dignite dignite commented Oct 16, 2018

--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 ?

Copy link

@rodrigo-urbit rodrigo-urbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magnifique 👏 👏 🌝

@dignite
Copy link
Author

dignite commented Oct 26, 2018

Ping @trixnz

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.

2 participants