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

Fix almost all warnings #451

Merged
merged 6 commits into from
Jan 30, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Messages/Strings.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ showErrorMessage OutputAndValidate =
showErrorMessage (MustSpecifyVersionWithUpgrade elmVersion) =
"I can only upgrade code to the latest Elm version. To make sure I'm doing what you expect, you must also specify --elm-version=" ++ show elmVersion ++ " when you use --upgrade."

showErrorMessage NoInputs =
"No inputs"
Copy link
Owner

@avh4 avh4 Jan 29, 2018

Choose a reason for hiding this comment

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

🤔 Why did this not lead to crashes before? Is NoInputs actually used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

src/ElmFormat.hs:

                    case (elmVersionResult, determineWhatToDoFromConfig config resolvedInputFiles) of
                        (_, Left NoInputs) ->
                            (handleParseResult $ Flags.showHelpText defaultVersion elmFormatVersion experimental)
                                >> exitFailure

                        (_, Left message) ->
                            exitWithError message
...

exitWithError uses showErrorMessage (which is what the warning is about). So the NoInputs case is effectively impossible because it is handled in a special way.


showInputMessage :: InputFileMessage -> String

Expand Down