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

Get rid of all instances of List[HelpDoc]. #53

Merged
merged 2 commits into from
Nov 21, 2020

Conversation

hollinwilkins
Copy link
Contributor

@hollinwilkins hollinwilkins commented Nov 21, 2020

Overview

zio-cli used to use a List[HelpDoc] as the error type when validating input arguments to represent multiple help docs to display to the user. This is no longer required because of the HelpDoc.Sequence type, which allows joining two HelpDocs together. This change gets rid of all instances of List[HelpDoc] and replaces them with HelpDoc.

Summary of Changes

  1. Find and replace all instances of List[HelpDoc] with HelpDoc
  2. Get rid of all cons operations in validate methods

Notes

  1. The only time the master code created List[HelpDoc] was with a cons operation to Nil, which means we were never returning more than one HelpDoc in the error channel
  2. The only references to HelpDoc.Sequence in the code are in pattern matches, which means we never any instances of this value for now

@CLAassistant
Copy link

CLAassistant commented Nov 21, 2020

CLA assistant check
All committers have signed the CLA.

@jdegoes
Copy link
Member

jdegoes commented Nov 21, 2020

We have to keep HelpDoc.Enumeration, as it is intended to be rendered as a bullet-point list.

On the other hand, HelpDoc.Sequence is intended to be rendered as stacked blocks (like multiple paragraphs on a page).

Otherwise, looks good!

Copy link
Member

@jdegoes jdegoes left a comment

Choose a reason for hiding this comment

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

We need to keep HelpDoc.Enumeration because it is intended for bullet-point lists.

@hollinwilkins
Copy link
Contributor Author

Ah, understood, I will restore it :)

@hollinwilkins
Copy link
Contributor Author

Restored the HelpDoc.Enumeration and supporting code

@jdegoes
Copy link
Member

jdegoes commented Nov 21, 2020

@hollinwilkins Awesome work!

@jdegoes jdegoes merged commit 7873087 into zio:master Nov 21, 2020
@hollinwilkins hollinwilkins deleted the issue/51-helpdoc-list branch November 21, 2020 19:11
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.

None yet

3 participants