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