Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pydocstyle Updates #343

Merged
merged 7 commits into from Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions BasicDevTests.py
Expand Up @@ -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)
Expand All @@ -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}")
Expand All @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions azure-pipelines/templates/build-test-job.yml
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines/templates/pydocstyle-test-steps.yml
Expand Up @@ -7,15 +7,15 @@
##

parameters:
none: ''
root_package_folder: ''

steps:
- script: pydocstyle .
- 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
- script: pydocstyle ${{parameters.root_package_folder}} > pydocstyle.err.log
displayName: 'Capture pydocstyle failures'
condition: Failed()

Expand Down
2 changes: 1 addition & 1 deletion docs/developing.md
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion edk2toolext/__init__.py
Expand Up @@ -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
"""
4 changes: 3 additions & 1 deletion edk2toolext/bin/__init__.py
Expand Up @@ -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
"""
4 changes: 3 additions & 1 deletion edk2toolext/environment/__init__.py
Expand Up @@ -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
"""
3 changes: 1 addition & 2 deletions edk2toolext/environment/extdeptypes/__init__.py
Expand Up @@ -3,5 +3,4 @@
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

# noqa
"""This package contains the different ext_dep types available in the environment."""
3 changes: 1 addition & 2 deletions edk2toolext/environment/plugintypes/__init__.py
Expand Up @@ -3,5 +3,4 @@
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

# noqa
"""This package contains the different plugin types available in the environment."""
3 changes: 1 addition & 2 deletions edk2toolext/invocables/__init__.py
Expand Up @@ -3,5 +3,4 @@
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

# noqa
"""This package contains the different invocables available to the developer."""
4 changes: 3 additions & 1 deletion edk2toolext/tests/__init__.py
Expand Up @@ -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
"""