Skip to content

Commit 73842c9

Browse files
committed
reformat docstrings and supress small errors inline
Signed-off-by: E3E <ntanzill@purdue.edu>
1 parent 1a4d870 commit 73842c9

5 files changed

Lines changed: 15 additions & 17 deletions

File tree

pyproject.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,16 @@ line-length=80
8383
[tool.ruff.lint]
8484
select = [
8585
"D", # pydocstyle
86-
"I", # isort
86+
"E", # pycodestyle
8787
"F", # pyflakes
88+
"I", # isort
8889
"N", # pep8-naming
89-
"E" # pycodestyle
9090
]
9191
ignore = ["D400","D415","D213","D205","D202","D107","D407","D413","D212","D104","D406","D105","D411","D401","D200","D203"]
92+
9293
[tool.ruff.lint.per-file-ignores]
9394
"tests/*" = ["D", "E"]
9495
"examples/*/*" = ["D"]
95-
"tuf/repository/__init__.py" = ["F401"]
96-
"tuf/api/exceptions.py" = ["F401"]
97-
"tuf/repository/_repository.py" = ["N818"]
98-
"verify_release" = ["F401", "D103", "E501"]
9996

10097
# Pylint section
10198

tuf/api/exceptions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
#### Repository errors ####
1212

1313
# pylint: disable=unused-import
14-
# ruff: disable unused-inport
15-
from securesystemslib.exceptions import StorageError
14+
from securesystemslib.exceptions import StorageError # noqa: F401
1615

1716

1817
class RepositoryError(Exception):

tuf/repository/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@
1010
The repository module is not considered part of the stable python-tuf API yet.
1111
"""
1212

13-
# ruff: disable unused-inport
14-
from tuf.repository._repository import AbortEdit, Repository
13+
from tuf.repository._repository import AbortEdit, Repository # noqa: F401, I001

tuf/repository/_repository.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
logger = logging.getLogger(__name__)
2323

2424

25-
# ruff: ignore N818 `Exception name should have Error suffix`
26-
class AbortEdit(Exception):
25+
class AbortEdit(Exception): # noqa: N818
2726
"""Raise to exit the edit() contextmanager without saving changes"""
2827

2928

verify_release

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ from tempfile import TemporaryDirectory
1919
from typing import Optional
2020

2121
try:
22-
import build as _ # type: ignore
22+
import build as _ # type: ignore # noqa: F401
2323
import requests
2424
except ImportError:
2525
print("Error: verify_release requires modules 'requests' and 'build':")
@@ -168,19 +168,21 @@ def sign_release_artifacts(
168168

169169

170170
def finished(s: str) -> None:
171+
"""Displays a finished message."""
171172
# clear line
172173
sys.stdout.write("\033[K")
173174
print(f"* {s}")
174175

175176

176177
def progress(s: str) -> None:
178+
"""Displays a progress message."""
177179
# clear line
178180
sys.stdout.write("\033[K")
179181
# carriage return but no newline: next print will overwrite this one
180182
print(f" {s}...", end="\r", flush=True)
181183

182184

183-
def main() -> int:
185+
def main() -> int: # noqa: D103
184186
parser = argparse.ArgumentParser()
185187
parser.add_argument(
186188
"--skip-pypi",
@@ -194,8 +196,9 @@ def main() -> int:
194196
const=True,
195197
metavar="<key id>",
196198
dest="sign",
197-
help="Sign release artifacts with 'gpg'. If no <key id> is passed, the default "
198-
"signing key is used. Resulting '*.asc' files are written to CWD.",
199+
help="Sign release artifacts with 'gpg'. If no <key id> is passed,"
200+
" the default signing key is used. Resulting '*.asc' files are written"
201+
" to CWD.",
199202
)
200203
args = parser.parse_args()
201204

@@ -237,7 +240,8 @@ def main() -> int:
237240
else:
238241
finished("GitHub artifacts match the built release")
239242

240-
# NOTE: 'gpg' might prompt for password or ask if it should override files...
243+
# NOTE: 'gpg' might prompt for password or ask if it should
244+
# override files...
241245
if args.sign:
242246
progress("Signing built release with gpg")
243247
if success:

0 commit comments

Comments
 (0)