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
added the refactoring code authored Nov 04, 2020 by Yogesh Hegde's avatar Yogesh Hegde
Hide whitespace changes
Inline Side-by-side
Showing with 15 additions and 3 deletions
+15 -3
  • code-refactoring.md code-refactoring.md +15 -3
  • No files found.
code-refactoring.md
View page @ d0436745
...@@ -78,16 +78,19 @@ The module provides 2 sample example code in 2 coding languages (CPP & Python) ...@@ -78,16 +78,19 @@ The module provides 2 sample example code in 2 coding languages (CPP & Python)
- For python - For python
<details> <details>
<summary> Click to see your steps! </summary> <summary> Click to see your steps! </summary>
- Make sure that you are in the folder codestyle/python, Check by running command `pwd` - Make sure that you are in the folder codestyle/python, Check by running command `pwd`
- Type `cd {your-chosen-example}` in VScode terminal. (for ex: `cd tennis`) - Type `cd {your-chosen-example}` in VScode terminal. (for ex: `cd tennis`)
- Run command - Run command
- 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.
</details> </details>
- For CPP - For CPP
<details> <details>
<summary> Click to see your steps! </summary> <summary> Click to see your steps! </summary>
- Make sure that you are in the folder codestyle/cpp, Check by running command `pwd` - Make sure that you are in the folder codestyle/cpp, Check by running command `pwd`
- Type `cd {your-chosen-example}` in VScode terminal. (for ex: `cd tennis`) - Type `cd {your-chosen-example}` in VScode terminal. (for ex: `cd tennis`)
- Run commands - Run commands
...@@ -98,18 +101,22 @@ The module provides 2 sample example code in 2 coding languages (CPP & Python) ...@@ -98,18 +101,22 @@ 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.
</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>
- Run command `pytest` - Run command `pytest`
- You will see your refactored code get tested. If anything fails the test will report the failure. - You will see your refactored code get tested. If anything fails the test will report the failure.
</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 - For Tennis example, run commands
```sh ```sh
make make
...@@ -121,18 +128,22 @@ The module provides 2 sample example code in 2 coding languages (CPP & Python) ...@@ -121,18 +128,22 @@ The module provides 2 sample example code in 2 coding languages (CPP & Python)
./yahtzee_tests ./yahtzee_tests
``` ```
- You will see your refactored code get tested. If anything fails the test will report the failure. - You will see your refactored code get tested. If anything fails the test will report the failure.
</details> </details>
8. Test if your refactored code passes all the tests. 8. Test if your refactored code passes all the tests.
- For Python - For Python
<details> <details>
<summary> Click to see your steps! </summary> <summary> Click to see your steps! </summary>
- Run command `pytest` - Run command `pytest`
- You will see your refactored code get tested. If anything fails the test will report the failure. - You will see your refactored code get tested. If anything fails the test will report the failure.
</details> </details>
- For CPP - For CPP
<details> <details>
<summary> Click to see your steps! </summary> <summary> Click to see your steps! </summary>
- For Tennis example, run commands - For Tennis example, run commands
```sh ```sh
make make
...@@ -144,6 +155,7 @@ The module provides 2 sample example code in 2 coding languages (CPP & Python) ...@@ -144,6 +155,7 @@ The module provides 2 sample example code in 2 coding languages (CPP & Python)
./yahtzee_tests ./yahtzee_tests
``` ```
- You will see your refactored code get tested. If anything fails the test will report the failure. - You will see your refactored code get tested. If anything fails the test will report the failure.
</details> </details>
9. Repeat the steps 6, 7, 8 till all the code style errors are solved. 9. Repeat the steps 6, 7, 8 till all the code style errors are solved.
...@@ -166,13 +178,13 @@ The module provides 2 sample example code in 2 coding languages (CPP & Python) ...@@ -166,13 +178,13 @@ The module provides 2 sample example code in 2 coding languages (CPP & Python)
11. See your code Build, Test and Deploy via CI/CD. 11. See your code Build, Test and Deploy via CI/CD.
- Go to your repository (the one that you have forked), CI/CD --> Pipelines. - Go to your repository (the one that you have forked), CI/CD --> Pipelines.
![pipleines](upload/Screenshot%20from%202020-11-03%2015-34-57.png) ![pipleines](upload/pipeline1.png)
- You can see Build, Test and Deploy devOps stages passing. - You can see Build, Test and Deploy devOps stages passing.
![stages](upload/Selection_028.png) ![stages](upload/Selection_028.png)
- Click on the `passed` to see all the individual stage summary. - Click on the `passed` to see all the individual stage summary.
![stages-1](upload/Selection_029.png) ![stages-1](upload/Selection_029.png)
12. Thats is it done, you have successfully Refactored your code and see it Built, Tested and Deployed via CI/CD. 12. Thats is it done, you have successfully Refactored your code and see it Built, Tested and Deployed via CI/CD.
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