Esempio n. 1
0
class Finish:
    body = Steps(
        Box("Thank You"),
        Echo(
            Text(
                "From all of us at r2c, thank you for trying Bento! We can’t wait to hear what you think.",
                processor=Processors.wrap(),
            )),
        Newline(),
        Echo(
            Multi(
                [
                    "Help and feedback: ",
                    Text("Reach out to us at ", style={"dim": True}),
                    "*****@*****.**",
                    Text(" or file an issue on ", style={"dim": True}),
                    "GitHub",
                    Text(". We’d love to hear from you!", style={"dim": True}),
                ],
                processor=Processors.wrap_link(
                    [
                        Link("*****@*****.**", "mailto:[email protected]"),
                        Link("GitHub",
                             "https://github.com/returntocorp/bento/issues"),
                    ],
                    extra=16,
                ),
            )),
        Newline(),
        Echo(
            Multi(
                [
                    "Community: ",
                    Text("Join ", style={"dim": True}),
                    "#bento",
                    Text(
                        " on our community Slack. Get support, talk with other users, and share feedback.",
                        style={"dim": True},
                    ),
                ],
                processor=Processors.wrap_link(
                    [
                        Link(
                            "#bento",
                            "https://join.slack.com/t/r2c-community/shared_invite/enQtNjU0NDYzMjAwODY4LWE3NTg1MGNhYTAwMzk5ZGRhMjQ2MzVhNGJiZjI1ZWQ0NjQ2YWI4ZGY3OGViMGJjNzA4ODQ3MjEzOWExNjZlNTA",
                        )
                    ],
                    extra=16,
                ),
            )),
        Newline(),
        Echo("Go forth and write great code! To use Bento:"),
        Echo(
            Multi([
                _step_item("commit code", "git commit"),
                _step_item("get help for a command",
                           "bento [COMMAND] --help",
                           nl=False),
            ])),
    )
Esempio n. 2
0
class ConfirmTos:
    fresh = Steps(
        Echo(
            Multi(
                [
                    "Privacy: ",
                    Text(
                        "We take privacy seriously. Bento runs exclusively on your computer. It will never send your "
                        "code anywhere.",
                        style={"dim": True},
                    ),
                ],
                processor=Processors.wrap(extra=8),
            )
        ),
        Newline(),
        Echo(
            Text(
                "We’re constantly looking to make Bento better. To that end, we collect limited usage and results "
                "data. To learn more, see bento.dev/privacy.",
                processor=Processors.wrap_link(
                    [Link("bento.dev/privacy", "https://bento.dev/privacy")]
                ),
                style={"dim": True},
            )
        ),
        Newline(),
    )

    invalid_version = Error(
        "~/.bento/config.yml is malformed. Please remove this file and re-run Bento. "
    )

    upgrade = Steps(
        Echo(
            Text(
                "We've made changes to our terms of service. Please review the new terms. If you have any questions "
                "or concerns please reach out via [email protected].",
                processor=Processors.wrap_link(
                    [Link("*****@*****.**", "mailto:[email protected]")]
                ),
                style={"dim": True},
            )
        ),
        Newline(),
    )

    prompt = Confirm(
        "Continue and agree to Bento's terms of service and privacy policy?",
        options={"default": True},
    )
    error = Error(
        "Bento did NOT install. Bento beta users must agree to the terms of service to continue. Please reach out to "
        "us at [email protected] with questions or concerns. "
    )
Esempio n. 3
0
class Start:
    banner = Steps(
        Box("Bento Initialization"),
        Echo(
            Text(
                "Bento configures itself for personal use by default. This means that it:",
                processor=Processors.wrap(),
            )
        ),
        Newline(),
        Echo(
            Text(
                "1. Automatically checks for issues introduced by your code, as you commit it",
                processor=Processors.wrap(),
            )
        ),
        Echo(
            Text(
                "2. Only affects you; it won’t change anything for other project contributors",
                processor=Processors.wrap(),
            )
        ),
        Newline(),
        Echo(
            Text(
                "Learn more about personal and team use at bento.dev/workflows.",
                processor=Processors.wrap_link(
                    [Link("bento.dev/workflows", "https://bento.dev/workflows")]
                ),
            )
        ),
        Newline(),
    )
    confirm = Steps(Confirm("Press ENTER to add Bento to this project"), Newline())
Esempio n. 4
0
class Install:
    learn_more = Text(
        "To learn more, see the README.",
        processor=Processors.wrap_link([
            Link(
                "README",
                "https://github.com/returntocorp/bento/blob/master/README.md#running-in-cicd",
            )
        ]),
    )

    banner = Steps(
        Echo(
            Multi(
                [
                    "Configuring a GitHub Action to automatically check your team's pull requests. ",
                    learn_more,
                ],
                processor=Processors.wrap(),
            )),
        Newline(),
    )

    progress = Progress(
        content=Multi([
            "Creating GitHub Action configuration at ",
            Sub(0, style={
                "bold": True,
                "dim": True
            }),
            Text("/", style={
                "bold": True,
                "dim": True
            }),
        ]),
        extra=24,
    )
    after_progress = Newline()

    finalize_ci = Steps(
        Warn("To finalize configuration of Bento's GitHub Action, please:"),
        Echo(
            Multi([
                "  $ git add .github/\n",
                '  $ git commit -m "Add Bento GitHub Action"\n',
                "  $ git push\n",
            ])),
    )