---
# System prepended metadata

title: How to pass a homework

---

# How to pass a homework

Please follow all this steps and **keep all** suggested formats for **branch naming** and **commit messages**.

## 0. Rules of assement

### Clean code 
Every piece of code pushed to GitHub *must* be **compilable** and all **tests** *must* be **green**. 
The only one exception of this rule if you explicitly declare that this code is not compilable or some tests fail and you need my help.
All other cases of not compilable code or failed tests are considered by me as a **disrespect** of my time. 

### There are no partially done homeworks
You either apply all my comments to your code or get **0 (zero) points** for the homework.


### Student: "But I spent a lot of time to do the homework"
Fatigue is not an attribute of a completed work. No points for fatigue.

I don't care about how effort you put to solve the homework. The very only way for evaluation the homework is **what is actually done**.


## 1. Switch to `main` (or `master`) branch
Make sure that the active branch is `main` (or `master`) branch. To checkout `main` branch do following:

![](https://i.imgur.com/RW4DK8D.jpg)



If `main` is an active branch you should see

![](https://i.imgur.com/5qXWbWo.png)

From the beginning you'll have only `main` branch but while working on homeworks new branch will be created and merged to `main`. That's why it is importatnt to create your custom branches exactly from `main` branch.

## 2. Update `main` branch

while working on homeworks new branch will be created and **merged** to `main`. It is importatnt to keep your local version of `main` up-to-date. Go to `Git` → `Update Project...`:

![](https://i.imgur.com/TLyJy1K.png)

Update the project:

![](https://i.imgur.com/sAY7CLC.png)


## 3. Create custom homework branch from `main` branch
It is very importatnt to follow the rule of naming of custom branches. I **do not check** pull requests with **wrongly named** branches.
Naming rule is following: **`week-N`** where `N` is a number of homework's week. 
* Yes, `week` should start from lower-case **`w`**.
* Yes, after `week` should be sign **`-`**.
* Yes, `N` should be an integer, **`1`** for the first week, and **`4`** for the fourth one.

Valid naming for the first week branch is **`week-1`**. Just copy it.

To create a new branch got to

![](https://i.imgur.com/aN9niC8.png)


and

![](https://i.imgur.com/s3rdndo.png)

## 4. Do your homework
Yes, just do it. Folowing the requirements at the top of the homework's file.

![](https://i.imgur.com/W2QKXh2.png)


## 5. Compile and test

## 6. Commit and push your changes on GitHub
When you're done (or even partially done but you'd like me to check your solution) commit your changes to your local custom homework branch.
It is very importatnt to follow the rule of naming of commits. I **do not check** pull requests with **wrongly named** commits.
Naming rule is following: **`Week-N - <Your comment>`** where `N` is a number of homework's week. 
* Yes, `Week` should start from upper-case **`W`**.
* Yes, after `Week` should be sign **`-`**.
* Yes, `N` should be an integer, **`1`** for the first week, and **`4`** for the forth one.
* Yes, after `Week-N` should be `space` then `dash` then `space`: ` - `.
* Yes, after ` - ` should be your comment started from a apper-cased letter i.e. `My greatest solution for booleans`. It 

Valid naming for commit message could looks like **`Week-1 - My greatest solution for booleans`.


![](https://i.imgur.com/g9U0StV.png)

You could face 

![](https://i.imgur.com/eNh0PNj.png)


Please check warnings, it could help to prevent dummy errors. If you're confident that warnings do not affect your solution then go ahead and commit it.

To push your changes on GitHub got to
![](https://i.imgur.com/1PGSAWb.jpg)

and
![](https://i.imgur.com/XeIUnII.png)


**Green** files is for a new files, **blue** one is for changed, **grey** one is for deleted.

Push it!

## 7. Create merge request on GitHub

Got to your GitHub repository `Pull requests` tab:

![](https://i.imgur.com/8fbGgwR.png)


While creatign pull request choose **your** repository instead of KarazinScalaUsersGroup. Otherwise you will try to merge your code to my repository:

![](https://i.imgur.com/1ubTYkp.png)


Choose the right homework branch

![](https://i.imgur.com/8qef9P1.png)


Make sure that you're able to merge your custom homework branch to your main (otherwise let me know) and create pool request:

![](https://i.imgur.com/AhBIPrU.png)


Add me (`IgorWolkov`) as a reviewer. If cannot see me in the list of possible reciewers than probably you missed [this step](https://hackmd.io/v67krdtkQBq3o2NdRVD5dw?view#Add-me-as-a-collaborator-to-your-project). 

![](https://i.imgur.com/bR86o25.png)


## 8. Passing code review
During a code review I will add my coments which you **must** apply to your code.

Go back to your IDE, apply changes to your code in the same branch, commit the changes and push them. The changes will appear in the current pull request, you don't need to create a new pull request.

Only **after** I approve a pull request you can merge your changes to `main` branch:

![](https://i.imgur.com/nTRRsbE.jpg)


## 9. Update your local `main` branch
Go to [this paragraph](https://hackmd.io/@ovqjndstQg-hBXTSeB1S7A/BkQt1FiOY#2-Update-main-branch).



