Created
September 22, 2018 19:14
-
-
Save JayBazuzi/e9e90dac0387cdd55e8083b162f6f569 to your computer and use it in GitHub Desktop.
One way to factor a script for a multi-step process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
return (MergeDownProcess(_WORKSPACE_DIR) | |
.get_user_intent() | |
.ensure_on_sparse_branch() | |
.ensure_no_files_opened() | |
.ensure_something_to_integrate() | |
.merge() | |
.create_changelist_for_any_changes() | |
.ensure_resolved() | |
.submit_any_changes() | |
.report_results()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good: I can read it
Bad: the interdependencies between steps are difficult to see / difficult to verify
Bad: three steps are actually a conditional branch ("if any changes")