# 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:

If `main` is an active branch you should see

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...`:

Update the project:

## 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

and

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

## 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`.

You could face

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

and

**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:

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

Choose the right homework branch

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

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).

## 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:

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