Skip to content

Conversation

@ritvi12
Copy link

@ritvi12 ritvi12 commented Nov 6, 2025

Exercise Review

Exercise Discussion

#106

Checklist

  • If you require a new remote repository on the Git-Mastery organization, have you created a request for it?
  • Have you written unit tests using repo-smith to validate the exercise grading scheme?
  • Have you tested the download script using test-download.sh?
  • Have you verified that this exercise does not already exist or is not currently in review?
  • Did you introduce a new grading mechanism that should belong to git-autograder?
  • Did you introduce a new dependency that should belong to app?

Copy link
Member

@woojiahao woojiahao left a comment

Choose a reason for hiding this comment

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

Left some comments. Could you also remove the comments for the steps. They aren't necessary.

__requires_github__ = False

def download(verbose: bool):
"""
Copy link
Member

Choose a reason for hiding this comment

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

You can remove this comment

Comment on lines +18 to +23
target_dir = Path("things")

# Clean existing sandbox if re-downloading
if target_dir.exists():
import shutil
shutil.rmtree(target_dir)
Copy link
Member

Choose a reason for hiding this comment

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

This already happens via the app: https://git-mastery.github.io/developers/docs/architecture/download-workflow/#hands-on-download

So this check can be omitted

Comment on lines +25 to +27
# Create sandbox folder
target_dir.mkdir()
os.chdir(target_dir)
Copy link
Member

Choose a reason for hiding this comment

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

I think conventionally, os.makedirs would be more consistent with the existing code

Comment on lines +33 to +34
with open("fruits.txt", "w") as f:
f.write("apples\nbananas\ncherries\ndragon fruits\n")
Copy link
Member

Choose a reason for hiding this comment

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

Please use the given create_or_update_file utility function

Comment on lines +39 to +40
with open("fruits.txt", "a") as f:
f.write("elderberries\nfigs\n")
Copy link
Member

Choose a reason for hiding this comment

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

Please use the given append_file utility function

Comment on lines +45 to +48
with open("colours.txt", "w") as f:
f.write("a file for colours\n")
with open("shapes.txt", "w") as f:
f.write("a file for shapes\n")
Copy link
Member

Choose a reason for hiding this comment

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

Use the given create_or_update_file utility function

Comment on lines +54 to +55
with open("fruits.txt", "w") as f:
f.write("apples, apricots\nbananas\nblueberries\ncherries\ndragon fruits\nfigs\n")
Copy link
Member

Choose a reason for hiding this comment

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

Use the given create_or_update utility function

Comment on lines +60 to +61
with open("colours.txt", "a") as f:
f.write("blue\nred\nwhite\n")
Copy link
Member

Choose a reason for hiding this comment

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

Use append_file

Comment on lines +67 to +68
with open("shapes.txt", "a") as f:
f.write("circle\noval\nrectangle\nsquare\n")
Copy link
Member

Choose a reason for hiding this comment

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

Use append_file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Hands-On Discussion] T4L4/hp-checkout-commits (Checking out some commits)

2 participants