Skip to content

Commit 8e08009

Browse files
author
Laurie0131
committed
update after review
Minor formatting issues Cc: kondalgithub <[email protected]> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laurie0131 <[email protected]>
1 parent 21aad9a commit 8e08009

15 files changed

+196
-75
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--- @file
2-
README.md for Python Development Process and Coding Specification
2+
README.md for EDK II Python Development Process and Coding Specification
33
44
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
55
@@ -28,21 +28,22 @@
2828
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
3030
-->
31-
<img src="media/TianocoreTitlePageLogo.jpg" width="300" />
3231

32+
<img src="media/TianocoreTitlePageLogo.jpg" width="300" />
3333

34-
### EDK II Python Development Process and Coding Standards Specification {#python-development-process-and-coding-standards-specification}
35-
<!---
3634
### {{ book.title }}
37-
-->
38-
3935

4036
{% if book.draft %}
4137
** DRAFT FOR REVIEW **
38+
{% else %}
39+
** {{ book.version }} **
4240
{% endif %}
41+
4342
** {{ gitbook.time|date('MM/DD/YYYY hh:mm:ss') }} **
4443

45-
** {{ book.version }} **
44+
{% if book.udkrelease %}
45+
** {{ book.udkrelease }} **
46+
{% endif %}
4647

4748

4849
### Acknowledgements

SUMMARY.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
<!--- @file
2+
3+
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
4+
5+
Redistribution and use in source (original document form) and 'compiled'
6+
forms (converted to PDF, epub, HTML and other formats) with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1) Redistributions of source code (original document form) must retain the
10+
above copyright notice, this list of conditions and the following
11+
disclaimer as the first lines of this file unmodified.
12+
13+
2) Redistributions in compiled form (transformed to other DTDs, converted to
14+
PDF, epub, HTML and other formats) must reproduce the above copyright
15+
notice, this list of conditions and the following disclaimer in the
16+
documentation and/or other materials provided with the distribution.
17+
18+
THIS DOCUMENTATION IS PROVIDED BY TIANOCORE PROJECT "AS IS" AND ANY EXPRESS OR
19+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
21+
EVENT SHALL TIANOCORE PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF
27+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
29+
-->
30+
131
# Summary
232

333
* [EDK II Python Development Process and Coding Standards Specification](README.md)

development_steps_and_flowchart.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!--- @file
2-
development_steps_and_flowchard.md for Python Development Process and Coding Specification
2+
development_steps_and_flowchart.md for
3+
EDK II Python Development Process and Coding Specification
34
45
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
56
@@ -29,7 +30,7 @@
2930
3031
-->
3132

32-
# **3 Development steps and flowchart:** {#development-steps-and-flowchart}
33+
# 3 Development steps and flowchart
3334

3435
* Write code which follows PEP8, PEP257 and PEP484 recommendations
3536
* Run `flake8` on source code.

environment_setup_and_example.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!--- @file
2-
environement_setup_and_example.md for Python Development Process and Coding Specification
2+
environement_setup_and_example.md for
3+
EDK II Python Development Process and Coding Specification
34
45
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
56
@@ -30,7 +31,7 @@
3031
-->
3132

3233

33-
**4.1 Install and setup environment:**{#1-install-and-setup-environment}
34+
## 4.1 Install and setup environment
3435

3536
* **Install flake8:**
3637

environment_setup_and_example/1_install_and_setup_environment.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!--- @file
2-
1 Install and setup environment.md for Python Development Process and Coding Specification
2+
1 Install and setup environment.md for
3+
EDK II Python Development Process and Coding Specification
34
45
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
56
@@ -29,7 +30,7 @@
2930
3031
-->
3132

32-
**4.1 Install and setup environment:**{#1-install-and-setup-environment]
33+
## 4.1 Install and setup environment
3334

3435
* **Install flake8:**
3536

environment_setup_and_example/2_create_project_configuration_file_for_flake8.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!--- @file
2-
2 create_a projtect configuration file for flake8.md for Python Development Process and Coding Specification
2+
2 create_a projtect configuration file for flake8.md for
3+
EDK IIPython Development Process and Coding Specification
34
45
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
56
@@ -28,15 +29,13 @@
2829
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2930
3031
-->
31-
## 4.2 Create a project configuration file for flake8: {#2-create-project-configuration-file-for-flake8}
32-
33-
Create a file at root level of the project directory and name it as "**.flake8**".
34-
35-
Flake8 configuration options needs to be in the flake8 section. The following options used for EDK II flake8 configuration.
36-
37-
32+
## 4.2 Create a project configuration file for flake8
3833

34+
Create a file at root level of the project directory and
35+
name it as "**.flake8**".
3936

37+
Flake8 configuration options needs to be in the flake8 section.
38+
The following options used for EDK II flake8 configuration.
4039

4140
```
4241
[flake8]

environment_setup_and_example/3_write_python_code.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!--- @file
2-
3 write python code.md for Python Development Process and Coding Specification
2+
3 write python code.md for
3+
EDK II Python Development Process and Coding Specification
34
45
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
56
@@ -29,17 +30,16 @@
2930
3031
-->
3132

32-
## 4.3 Write python code : {#3-write-python-code}
33+
## 4.3 Write python code
3334

3435

3536
Create new file and name it as `sample.py` and start writing python code.
36-
Please note `sample.py` and `falke8` configuration file stored on same directory level.
37-
37+
Please note `sample.py` and `falke8` configuration files
38+
stored on same directory level.
3839

3940
### Source code `sample.py`:
4041

4142

42-
4343
```python
4444
# Source code sample.py:
4545

environment_setup_and_example/4_run_flake8.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,10 @@
3030
3131
-->
3232

33-
34-
35-
## 4.4 Run flake8: {#4-run-flake8}
36-
37-
33+
## 4.4 Run flake8
3834

3935
Run `flake8`. The output of `flake8` on `sample.py` shown below
4036

41-
42-
4337
```shell
4438
C:\kpurma\PythonDevelopmentProcess>python -m flake8 sample.py
4539
sample.py:1:1: D100 Missing docstring in public module
@@ -54,12 +48,11 @@ sample.py:41:13: E117 over-indented
5448
sample.py:43:21: E117 over-indented
5549
sample.py:44:13: E722 do not use bare 'except'
5650
sample.py:45:21: E117 over-indented
57-
sample.py:48:1: E305 expected 2 blank lines after class or function definition, found 1
58-
51+
sample.py:48:1: E305 expected 2 blank lines after class or
52+
function definition, found 1
5953

6054
```
6155

62-
6356
Fix `flake8` issues and run falke8 again to check there is no errors reported.
6457

6558
---
@@ -92,7 +85,7 @@ class AddTen:
9285

9386
---
9487

95-
Modified code with no errors looks like below and `sample_fixed.py` attached in the appendix.
88+
Run flake on fixed code.
9689

9790
```shell
9891
C:\kpurma\PythonDevelopmentProcess>python -m flake8 sample_fixed.py

environment_setup_and_example/5_run_mypy_for_type_hints.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!--- @file
2-
run mypy for type hints.md for Python Development Process and Coding Specification
2+
run mypy for type hints.md for
3+
EDK II Python Development Process and Coding Specification
34
45
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
56
@@ -29,7 +30,7 @@
2930
3031
-->
3132

32-
## 4.5 Run `mypy` for type hints: {#5-run-mypy-for-type-hints}
33+
## 4.5 Run `mypy` for type hints
3334

3435
Run `mypy` on the source file to check to find type hints.
3536

@@ -38,7 +39,8 @@ Run `mypy` on the source file to check to find type hints.
3839
C:\kpurma\PythonDevelopmentProcess>mypy sample.py --strict
3940
sample.py:35: error: Function is missing a type annotation
4041
sample.py:40: error: Function is missing a return type annotation
41-
sample.py:43: error: "AddTen" has no attribute "newvaraible"; maybe "new_varaible"?
42+
sample.py:43: error: "AddTen" has no attribute "newvaraible";
43+
maybe "new_varaible"?
4244
sample.py:48: error: Call to untyped function "AddTen" in typed context
4345
Found 4 errors in 1 file (checked 1 source file)
4446

@@ -51,7 +53,6 @@ Found 4 errors in 1 file (checked 1 source file)
5153
C:\kpurma\PythonDevelopmentProcess>mypy sample_fixed.py --strict
5254
Success: no issues found in 1 source file
5355

54-
5556
```
5657

5758

environment_setup_and_example/6_write_unit_test_using_pytest.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
<!--- @file
3-
6 write unit test using pytest.md for Python Development Process and Coding Specification
3+
6 write unit test using pytest.md for
4+
EDK II Python Development Process and Coding Specification
45
56
Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
67
@@ -30,13 +31,13 @@
3031
3132
-->
3233

33-
## 4.6 Write a unit test using pytest **:** {#6-write-unit-test-using-pytest}
34+
## 4.6 Write a unit test using pytest
3435

35-
Use `pytest` library to write a unit test. Unit test for sample program is shown below and `test_sample.py` is attached in the appendix.
36+
Use `pytest` library to write a unit test.
37+
Unit test for sample program is shown below for sample code.
3638

3739
---
3840

39-
4041
```python
4142

4243
from sample_fixed import AddTen
@@ -53,7 +54,6 @@ def test_answer():
5354
Run the unit test and make sure all tests pass.
5455

5556

56-
5757
```shell
5858
C:\kpurma\PythonDevelopmentProcess>python -m pytest test_sample.py
5959
===============testsessionstarts========================

0 commit comments

Comments
 (0)