-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add flag to check if files are formatted #92
Add flag to check if files are formatted #92
Conversation
Another issue I'm facing is that the pretty output doesn't have a break line at the end of the file. Do you think we should trim the original one in order to compare? |
I think the formatted output should always be exactly |
I like it, although I think the name "dry run" suggests that it will tell us exactly what changes a normal run would make. (For example, This wouldn't be a huge change; it would just require not immediately failing on the first file, and instead allowing the tool to continue. The output could be something like:
Thoughts? |
@shwestrick Would you be open to give this the In this case, I suggest changing the current |
Oh excellent, I like it. Let's use
Sounds good to me! |
@shwestrick May you check if this is good enough, please? |
Just did a little testing and found a bug. (This file should pass.) $ ./smlfmt --check src/base/MLtonPathMap.sml
ERROR: Unformatted file 'src/base/MLtonPathMap.sml' The issue appears to be on this line:
This is subtle, but If I switch to this instead, it seems to work:
( Could you make that change? Then I think we're good to merge. |
This is surprising and good to know. Do you have any place where I can read more about that?
Done. |
The official docs for Moscow ML's description here is perhaps at little better: "... returns some elements from [the stream]" My understanding is that this function has a very particular intended mode-of-use, where you call The naming is unfortunate (the name |
Thanks for putting this together, it looks great! Merging now. |
This is a follow-up PR for #91.
About the flag name, what do you think of
--dryrun
?