Пример #1
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())
Пример #2
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),
            ])),
    )
Пример #3
0
class Check:
    unnecessary = Steps(
        Echo("Bento archive is already configured on this project."),
        Newline())

    prompt = Confirm("Analyze this project for the first time?",
                     options={"default": True})

    header = Box("Bento Check")

    noninteractive = Warn(
        "Skipping project analysis due to noninteractive terminal.")
Пример #4
0
    Steps,
    Sub,
    Text,
    Warn,
)

not_registered = Steps(
    Error("This installation of Bento is not registered."),
    Echo("""
Please either:
◦ Register Bento by running it in an interactive terminal
◦ Run Bento with `--agree --email [EMAIL]`"""),
)

welcome = Steps(
    Box("Global Bento Configuration"),
    Echo(
        Text(
            "Thanks for installing Bento, a free and opinionated toolkit for gradually adopting linters and program "
            "analysis in your codebase!",
            processor=Processors.wrap(),
        )),
    Newline(),
)

finalize = Newline()


class UpdateEmail:
    leader = Steps(
        Echo(