This week, I got the chance to learn more about git remote, setting up a tracking branch, and implementing a new feature to work with TOML files.
New feature
For this week's task, I am required to implement a feature on a classmate's project to allow their CLI tool to read a config TOML file in the user's home directory and use the specified options as flags instead of inputting option flags in command line arguments. I had the pleasure to contribute to Mounayer's open source project, optimizeit.
The way I approached this task is I used an existing TOML parser library instead of implementing one myself from scratch. This sped up the process of implementing the feature. Since the code was properly structured, I was able to easily figure out where the feature should be implemented.
First, I created the function necessary to parse TOML files and handle catching errors through the use of a try
and catch
block.
Second, I called the function and store the retrieved options from the file in a variable. This function is called in the argsHandler()
where all the command line arguments are handled and returned. The options retrieved from the TOML file are then used as flag options unless a command line argument is provided. This way, any options provided through command line arguments are prioritized.
Git
I have worked with multiple group projects where we used Git
and GitHub
. Cloning repos, working on different branches, merging, and PR's aren't new to me. But working on open-source however, where other developers have to fork my repo is a different concern. This is where I learned about git remote
and tracking branch
so that I can review and test the code written by contributors on their forked repo.
With these new techniques I have learned, I now know how to track, review, and test other developer's work on their forked repo.