From f37d7e29d59a2da4c01b70e909caaf7f7cb2d536 Mon Sep 17 00:00:00 2001 From: Joey Vagedes Date: Wed, 5 Oct 2022 13:54:44 -0700 Subject: [PATCH 1/5] Initial update --- .github/{workflows => }/dependabot.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => }/dependabot.yml (100%) diff --git a/.github/workflows/dependabot.yml b/.github/dependabot.yml similarity index 100% rename from .github/workflows/dependabot.yml rename to .github/dependabot.yml From afca49cf88d389dd0d5d15ec34d074a38dab6a80 Mon Sep 17 00:00:00 2001 From: Azure Devops Date: Tue, 8 Nov 2022 12:08:09 -0800 Subject: [PATCH 2/5] Changes to pydocstyle Updates pipeline to only run on the edk2toolext folder. Updates developing documentation to specify to the user that they should only run pydocstyle on the edk2toolext folder. Adds documentation, rather then noqa to empty package init files. --- BasicDevTests.py | 8 ++++---- azure-pipelines/templates/pydocstyle-test-steps.yml | 2 +- docs/developing.md | 2 +- edk2toolext/__init__.py | 4 +++- edk2toolext/bin/__init__.py | 4 +++- edk2toolext/environment/__init__.py | 4 +++- edk2toolext/environment/extdeptypes/__init__.py | 3 +-- edk2toolext/environment/plugintypes/__init__.py | 3 +-- edk2toolext/invocables/__init__.py | 3 +-- edk2toolext/tests/__init__.py | 4 +++- 10 files changed, 21 insertions(+), 16 deletions(-) diff --git a/BasicDevTests.py b/BasicDevTests.py index 0a268221..517cc59a 100644 --- a/BasicDevTests.py +++ b/BasicDevTests.py @@ -18,7 +18,7 @@ import re -def TestEncodingOk(apath, encodingValue): # noqa +def TestEncodingOk(apath, encodingValue): try: with open(apath, "rb") as f_obj: f_obj.read().decode(encodingValue) @@ -29,7 +29,7 @@ def TestEncodingOk(apath, encodingValue): # noqa return True -def TestFilenameLowercase(apath): # noqa +def TestFilenameLowercase(apath): if apath != apath.lower(): logging.critical(f"Lowercase failure: file {apath} not lower case path") logging.error(f"\n\tLOWERCASE: {apath.lower()}\n\tINPUTPATH: {apath}") @@ -47,14 +47,14 @@ def PackageAndModuleValidCharacters(apath): return True -def TestNoSpaces(apath): # noqa +def TestNoSpaces(apath): if " " in apath: logging.critical(f"NoSpaces failure: file {apath} has spaces in path") return False return True -def TestRequiredLicense(apath): # noqa +def TestRequiredLicense(apath): licenses = ["SPDX-License-Identifier: BSD-2-Clause-Patent", ] try: with open(apath, "rb") as f_obj: diff --git a/azure-pipelines/templates/pydocstyle-test-steps.yml b/azure-pipelines/templates/pydocstyle-test-steps.yml index cb30f1bc..1b71f7f2 100644 --- a/azure-pipelines/templates/pydocstyle-test-steps.yml +++ b/azure-pipelines/templates/pydocstyle-test-steps.yml @@ -10,7 +10,7 @@ parameters: none: '' steps: -- script: pydocstyle . +- script: pydocstyle edk2toolext displayName: 'Run pydocstyle' condition: succeededOrFailed() diff --git a/docs/developing.md b/docs/developing.md index 0b3161ee..fc0e1c81 100644 --- a/docs/developing.md +++ b/docs/developing.md @@ -97,7 +97,7 @@ out all the different parts. 2. Run a Basic Python docstring Check (using pydocstring) and resolve any issues ``` cmd - pydocstyle . + pydocstyle edk2toolext ``` 3. Run the `BasicDevTests.py` script to check file encoding, file naming, etc diff --git a/edk2toolext/__init__.py b/edk2toolext/__init__.py index 9f73dc66..50405789 100644 --- a/edk2toolext/__init__.py +++ b/edk2toolext/__init__.py @@ -3,5 +3,7 @@ # # SPDX-License-Identifier: BSD-2-Clause-Patent ## +"""This file exists to satisfy pythons packaging requirements. -# noqa \ No newline at end of file +Read more: https://docs.python.org/3/reference/import.html#regular-packages +""" diff --git a/edk2toolext/bin/__init__.py b/edk2toolext/bin/__init__.py index 9f73dc66..50405789 100644 --- a/edk2toolext/bin/__init__.py +++ b/edk2toolext/bin/__init__.py @@ -3,5 +3,7 @@ # # SPDX-License-Identifier: BSD-2-Clause-Patent ## +"""This file exists to satisfy pythons packaging requirements. -# noqa \ No newline at end of file +Read more: https://docs.python.org/3/reference/import.html#regular-packages +""" diff --git a/edk2toolext/environment/__init__.py b/edk2toolext/environment/__init__.py index 9f73dc66..50405789 100644 --- a/edk2toolext/environment/__init__.py +++ b/edk2toolext/environment/__init__.py @@ -3,5 +3,7 @@ # # SPDX-License-Identifier: BSD-2-Clause-Patent ## +"""This file exists to satisfy pythons packaging requirements. -# noqa \ No newline at end of file +Read more: https://docs.python.org/3/reference/import.html#regular-packages +""" diff --git a/edk2toolext/environment/extdeptypes/__init__.py b/edk2toolext/environment/extdeptypes/__init__.py index 9f73dc66..48e3ed73 100644 --- a/edk2toolext/environment/extdeptypes/__init__.py +++ b/edk2toolext/environment/extdeptypes/__init__.py @@ -3,5 +3,4 @@ # # SPDX-License-Identifier: BSD-2-Clause-Patent ## - -# noqa \ No newline at end of file +"""This package contains the different ext_dep types available in the environment.""" diff --git a/edk2toolext/environment/plugintypes/__init__.py b/edk2toolext/environment/plugintypes/__init__.py index 9f73dc66..2f894c4e 100644 --- a/edk2toolext/environment/plugintypes/__init__.py +++ b/edk2toolext/environment/plugintypes/__init__.py @@ -3,5 +3,4 @@ # # SPDX-License-Identifier: BSD-2-Clause-Patent ## - -# noqa \ No newline at end of file +"""This package contains the different plugin types available in the environment.""" diff --git a/edk2toolext/invocables/__init__.py b/edk2toolext/invocables/__init__.py index a7e3a2a8..a1e88c2e 100644 --- a/edk2toolext/invocables/__init__.py +++ b/edk2toolext/invocables/__init__.py @@ -3,5 +3,4 @@ # # SPDX-License-Identifier: BSD-2-Clause-Patent ## - -# noqa +"""This package contains the different invocables available to the developer.""" diff --git a/edk2toolext/tests/__init__.py b/edk2toolext/tests/__init__.py index a7e3a2a8..50405789 100644 --- a/edk2toolext/tests/__init__.py +++ b/edk2toolext/tests/__init__.py @@ -3,5 +3,7 @@ # # SPDX-License-Identifier: BSD-2-Clause-Patent ## +"""This file exists to satisfy pythons packaging requirements. -# noqa +Read more: https://docs.python.org/3/reference/import.html#regular-packages +""" From b82df98f98e9966b594bf2238fc0bf171f40072f Mon Sep 17 00:00:00 2001 From: Azure Devops Date: Tue, 8 Nov 2022 12:18:02 -0800 Subject: [PATCH 3/5] Update pipeline --- azure-pipelines/templates/pydocstyle-test-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/templates/pydocstyle-test-steps.yml b/azure-pipelines/templates/pydocstyle-test-steps.yml index 1b71f7f2..0629c986 100644 --- a/azure-pipelines/templates/pydocstyle-test-steps.yml +++ b/azure-pipelines/templates/pydocstyle-test-steps.yml @@ -10,7 +10,7 @@ parameters: none: '' steps: -- script: pydocstyle edk2toolext +- script: pydocstyle $(root_package_folder) displayName: 'Run pydocstyle' condition: succeededOrFailed() From 6cd73ea8fb5a6863d21e2aa23828a22cb73508f8 Mon Sep 17 00:00:00 2001 From: Azure Devops Date: Tue, 8 Nov 2022 12:34:23 -0800 Subject: [PATCH 4/5] Update --- azure-pipelines/templates/pydocstyle-test-steps.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines/templates/pydocstyle-test-steps.yml b/azure-pipelines/templates/pydocstyle-test-steps.yml index 0629c986..523b32d1 100644 --- a/azure-pipelines/templates/pydocstyle-test-steps.yml +++ b/azure-pipelines/templates/pydocstyle-test-steps.yml @@ -10,12 +10,14 @@ parameters: none: '' steps: -- script: pydocstyle $(root_package_folder) +- script: pydocstyle . + workingDirectory: $(root_package_folder)/ displayName: 'Run pydocstyle' condition: succeededOrFailed() # Only capture and archive the lint log on failures. - script: pydocstyle . > pydocstyle.err.log + workingDirectory: $(root_package_folder)/ displayName: 'Capture pydocstyle failures' condition: Failed() From 9a0460748f4a81f7972420b6e98f6fc925cd21fc Mon Sep 17 00:00:00 2001 From: Azure Devops Date: Tue, 8 Nov 2022 12:42:49 -0800 Subject: [PATCH 5/5] Update --- azure-pipelines/templates/build-test-job.yml | 2 ++ azure-pipelines/templates/pydocstyle-test-steps.yml | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-pipelines/templates/build-test-job.yml b/azure-pipelines/templates/build-test-job.yml index 6bb1f877..004ee01f 100644 --- a/azure-pipelines/templates/build-test-job.yml +++ b/azure-pipelines/templates/build-test-job.yml @@ -34,6 +34,8 @@ jobs: - template: flake8-test-steps.yml - template: pydocstyle-test-steps.yml + parameters: + root_package_folder: ${{parameters.root_package_folder}} - template: spell-test-steps.yml diff --git a/azure-pipelines/templates/pydocstyle-test-steps.yml b/azure-pipelines/templates/pydocstyle-test-steps.yml index 523b32d1..869ebfcd 100644 --- a/azure-pipelines/templates/pydocstyle-test-steps.yml +++ b/azure-pipelines/templates/pydocstyle-test-steps.yml @@ -7,17 +7,15 @@ ## parameters: - none: '' + root_package_folder: '' steps: -- script: pydocstyle . - workingDirectory: $(root_package_folder)/ +- script: pydocstyle ${{parameters.root_package_folder}} displayName: 'Run pydocstyle' condition: succeededOrFailed() # Only capture and archive the lint log on failures. -- script: pydocstyle . > pydocstyle.err.log - workingDirectory: $(root_package_folder)/ +- script: pydocstyle ${{parameters.root_package_folder}} > pydocstyle.err.log displayName: 'Capture pydocstyle failures' condition: Failed()