8000 Adds punctuation to error messages by pete-ts · Pull Request #1122 · unisonweb/unison · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adds punctuation to error messages #1122

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

Merged
merged 4 commits into from
Jan 8, 2020
Merged

Conversation

pete-ts
Copy link
@pete-ts pete-ts commented Jan 5, 2020

There was no fullstop added after the first sentence in these cases:

  • running ucm with no codebase initialised in $HOME
  • running ucm -codebase x with no codebase initialised in "x"
  • running ucm init a second time

< 10000 a class="avatar avatar-user" style="width:20px;height:20px;" data-test-selector="commits-avatar-stack-avatar-link" data-hovercard-type="user" data-hovercard-url="/users/galer1us/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/galer1us"> @galer1us
…or messages
@aryairani aryairani requested a review from pchiusano January 5, 2020 18:23
@pete-ts
Copy link
Author
pete-ts commented Jan 5, 2020

A first and obvious solution would be to add <> "." <> and be done with it.

However, due to how P.string dir gets combined with subsequent Pretty elements, this always results in a space appearing between the directory and the full stop. So the full stop needs to be appended to the directory from inside the Pretty.

If there is a different suggestion for how to proceed, please feel free to mention it.

Comment on lines 452 to 453
endSentence :: IsString s => String -> Pretty s
endSentence str = fromString (str ++ ".")
Copy link
Member

Choose a reason for hiding this comment

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

@pete-ts I'd do this with:

endSentence :: IsString s => Pretty s -> Pretty s
endSentence p = group (p <> ".")

The group here will not get broken up when spaces are inserted by wrap.

Copy link
Author

Choose a reason for hiding this comment

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

@pchiusano I have a fix with the signature IsString s => Pretty s -> Pretty s, but that means that the call to P.string has to happen in the do block and it might look a bit "noisier" than IsString s => String -> Pretty s, which can get applied without the need to endSentence . string $ dir.

Copy link
Member

Choose a reason for hiding this comment

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

Understood, and I think that's fine.

@pete-ts pete-ts requested a review from pchiusano 8000 January 7, 2020 18:07
@pchiusano
Copy link
Member

Looks great! Can you add yourself to CONTRIBUTORS.markdown as part of this PR?

@pchiusano
Copy link
Member

😎 merging

@pchiusano pchiusano merged commit f6145de into unisonweb:master Jan 8, 2020
@pete-ts pete-ts deleted the bug/1112 branch January 20, 2020 21:21
@aryairani aryairani mentioned this pull request Mar 12, 2020
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.

3 participants
0