Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
D docker-containers
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Public
  • docker-containers
  • Wiki
  • code refactoring

code refactoring · Changes

Page history
add the refactoring of code example authored Nov 04, 2020 by Yogesh Hegde's avatar Yogesh Hegde
Show whitespace changes
Inline Side-by-side
Showing with 20 additions and 15 deletions
+20 -15
  • code-refactoring.md code-refactoring.md +20 -15
  • No files found.
code-refactoring.md
View page @ d95314d8
......@@ -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>
......
Clone repository
  • Installing tools
  • Readme doc format
  • code refactoring
  • code style container
  • day0
  • devops practical
  • docusaurus
  • Home
  • install on mac
  • install tools ubuntu 16.04
  • install tools windows