-
Notifications
You must be signed in to change notification settings - Fork 25
Implement hands on hp-reset-commits #114
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,114 @@ | ||||||||
| import os | ||||||||
|
|
||||||||
| from exercise_utils.file import append_to_file, create_or_update_file | ||||||||
| from exercise_utils.git import add, commit, init, tag | ||||||||
|
|
||||||||
| __requires_git__ = True | ||||||||
| __requires_github__ = False | ||||||||
|
|
||||||||
|
|
||||||||
| def download(verbose: bool): | ||||||||
| os.makedirs("things") | ||||||||
| os.chdir("things") | ||||||||
| init(verbose) | ||||||||
|
|
||||||||
| create_or_update_file( | ||||||||
| "fruits.txt", | ||||||||
| """ | ||||||||
| apples | ||||||||
| bananas | ||||||||
| cherries | ||||||||
| dragon fruits | ||||||||
| """ | ||||||||
| ) | ||||||||
| add(["fruits.txt"], verbose) | ||||||||
| commit("Add fruits.txt", verbose) | ||||||||
|
|
||||||||
| append_to_file( | ||||||||
| "fruits.txt", | ||||||||
| """ | ||||||||
| elderberries | ||||||||
| figs | ||||||||
| """) | ||||||||
| add(["fruits.txt"], verbose) | ||||||||
| commit("Add elderberries and figs into fruits.txt", verbose) | ||||||||
|
|
||||||||
| create_or_update_file( | ||||||||
| "colours.txt", | ||||||||
| """ | ||||||||
| a file for colours | ||||||||
| """ | ||||||||
| ) | ||||||||
| create_or_update_file( | ||||||||
| "shapes.txt", | ||||||||
| """ | ||||||||
| a file for shapes | ||||||||
| """ | ||||||||
|
Comment on lines
+44
to
+46
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this a single line |
||||||||
| ) | ||||||||
| add(["colours.txt", "shapes.txt"], verbose) | ||||||||
| commit("Add colours.txt, shapes.txt", verbose) | ||||||||
| tag("0.9", verbose) | ||||||||
|
|
||||||||
| create_or_update_file( | ||||||||
| "fruits.txt", | ||||||||
| """ | ||||||||
| apples, apricots | ||||||||
| bananas | ||||||||
| blueberries | ||||||||
| cherries | ||||||||
| dragon fruits | ||||||||
| figs | ||||||||
| """) | ||||||||
| add(["fruits.txt"], verbose) | ||||||||
| commit("Update fruits list", verbose) | ||||||||
|
|
||||||||
| append_to_file( | ||||||||
| "colours.txt", | ||||||||
| """ | ||||||||
| bad colour | ||||||||
| """ | ||||||||
|
Comment on lines
+67
to
+69
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this a single line |
||||||||
| ) | ||||||||
| add(["colours.txt"], verbose) | ||||||||
| commit("Incorrectly update colours.txt", verbose) | ||||||||
|
|
||||||||
| append_to_file( | ||||||||
| "shapes.txt", | ||||||||
| """ | ||||||||
| bad shape | ||||||||
| """ | ||||||||
|
Comment on lines
+76
to
+78
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this a single line |
||||||||
| ) | ||||||||
| add(["shapes.txt"], verbose) | ||||||||
| commit("Incorrectly update shapes.txt", verbose) | ||||||||
|
|
||||||||
| append_to_file( | ||||||||
| "fruits.txt", | ||||||||
| """ | ||||||||
| bad fruit | ||||||||
| """ | ||||||||
|
Comment on lines
+85
to
+87
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this a single line |
||||||||
| ) | ||||||||
| add(["fruits.txt"], verbose) | ||||||||
| commit("Incorrectly update fruits.txt", verbose) | ||||||||
|
|
||||||||
| create_or_update_file( | ||||||||
| "incorrect.txt", | ||||||||
| """ | ||||||||
| bad line | ||||||||
| """ | ||||||||
|
Comment on lines
+94
to
+96
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this a single line |
||||||||
| ) | ||||||||
| add(["incorrect.txt"], verbose) | ||||||||
| commit("Add incorrect.txt", verbose) | ||||||||
|
|
||||||||
| append_to_file( | ||||||||
| "colours.txt", | ||||||||
| """ | ||||||||
| another bad colour | ||||||||
| """ | ||||||||
|
Comment on lines
+103
to
+105
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this a single line! |
||||||||
| ) | ||||||||
| add(["colours.txt"], verbose) | ||||||||
|
|
||||||||
| append_to_file( | ||||||||
| "shapes.txt", | ||||||||
| """ | ||||||||
| another bad shape | ||||||||
| """ | ||||||||
|
Comment on lines
+111
to
+113
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Believe you can make this a single line and it'll still append correctly! |
||||||||
| ) | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this a single line