... | ... | @@ -85,6 +85,7 @@ The module provides 2 sample example code in 2 coding languages (CPP & Python) |
|
|
- For Tennis `pycodestyle tennis.py`
|
|
|
- For yhatzee-game `pycodestyle yahtzee.py`
|
|
|
- After running the command you will get a big list of errors in the coding style.
|
|
|
![example1](upload/Selection_036.png)
|
|
|
|
|
|
</details>
|
|
|
- For CPP
|
... | ... | @@ -101,6 +102,7 @@ The module provides 2 sample example code in 2 coding languages (CPP & Python) |
|
|
make codestyle
|
|
|
```
|
|
|
- After running the command you will get a big list of errors in the coding style.
|
|
|
![example2](upload/Selection_033.png)
|
|
|
|
|
|
</details>
|
|
|
|
... | ... | @@ -109,25 +111,28 @@ The module provides 2 sample example code in 2 coding languages (CPP & Python) |
|
|
<details>
|
|
|
<summary> Click to see your steps! </summary>
|
|
|
|
|
|
- Run command `pytest`
|
|
|
- You will see your refactored code get tested. If anything fails the test will report the failure.
|
|
|
- Lets try to solve first 4 errors thrown by the codestyle check
|
|
|
![solve1](upload/Selection_037.png)
|
|
|
|
|
|
- There seems to be errors due to spaces in the code, Lets fix these errors
|
|
|
![solve2](upload/Selection_038.png)
|
|
|
|
|
|
- After fixing the errors the codestyle does not throw the errors anymore
|
|
|
- Yay! the code has been refactored, Now test it so that it clears all the tests.
|
|
|
|
|
|
</details>
|
|
|
- For CPP Example
|
|
|
<details>
|
|
|
<summary> Click to see your steps! </summary>
|
|
|
|
|
|
- For Tennis example, run commands
|
|
|
```sh
|
|
|
make
|
|
|
./tennis1_tests
|
|
|
```
|
|
|
- For yhatzee-game, run commands
|
|
|
```sh
|
|
|
make
|
|
|
./yahtzee_tests
|
|
|
```
|
|
|
- You will see your refactored code get tested. If anything fails the test will report the failure.
|
|
|
- Lets try to solve first 4 errors thrown by the codestyle check
|
|
|
![solve1](upload/Selection_034.png)
|
|
|
|
|
|
- There seems to be errors, due brackets missing in `if` condition, Lets fix these errors
|
|
|
![solve2](upload/Selection_035.png)
|
|
|
|
|
|
- After fixing the errors the codestyle does not throw the errors anymore
|
|
|
- Yay! the code has been refactored, Now test it so that it clears all the tests.
|
|
|
|
|
|
</details>
|
|
|
|
... | ... | |