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

Resolve #1451: fix format --check given STDIN input. #1462

Merged
merged 3 commits into from
Oct 23, 2019

Conversation

mjgpy3
Copy link
Contributor

@mjgpy3 mjgpy3 commented Oct 22, 2019

I'm not really sure if this is the "best" approach so let me know if you
know a way to simplify this.

The issue was that getExpressionAndHeader was doing a second
IO.getContents (thus reading STDIN twice).

I'm not really sure if this is the "best" approach so let me know if you
know a way to simplify this.

The issue was that `getExpressionAndHeader` was doing a second
`IO.getContents` (thus reading STDIN twice).
Copy link
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

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

Cheers! That's already much nicer than what I had been able to think of. :)

@@ -122,13 +125,21 @@ data Censor = NoCensor | Censor
-- | Path to input
data Input = StandardInput | InputFile FilePath

-- | Path to input or raw input text, necessary since we can't read STDIN twice
data InputOrTextFromStdin = PathTo Input | StdinText Text
Copy link
Collaborator

Choose a reason for hiding this comment

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

PathTo StandardInput seems like a bit of a strange combination to me. How about

Suggested change
data InputOrTextFromStdin = PathTo Input | StdinText Text
data InputOrTextFromStdin = Input_ Input | StdinText Text

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

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

Cheers! :)

@mergify mergify bot merged commit 16e6a12 into dhall-lang:master Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants