mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
lint: Enable flake8-pie
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
This commit is contained in:
parent
4a26a0c49c
commit
981788bca2
4 changed files with 4 additions and 3 deletions
|
|
@ -94,6 +94,7 @@ select = [
|
|||
"ISC", # flake8-implicit-str-concat
|
||||
"N", # pep8-naming
|
||||
"PL", # pylint
|
||||
"PIE", # flake8-pie
|
||||
"RET", # flake8-return
|
||||
"RUF", # ruff-specific rules
|
||||
"S", # flake8-bandit
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ def rotate_keys(self, role: str) -> None:
|
|||
"""remove all keys for role, then add threshold of new keys"""
|
||||
self.root.roles[role].keyids.clear()
|
||||
self.signers[role].clear()
|
||||
for _ in range(0, self.root.roles[role].threshold):
|
||||
for _ in range(self.root.roles[role].threshold):
|
||||
signer = CryptoSigner.generate_ed25519()
|
||||
self.root.add_key(signer.public_key, role)
|
||||
self.add_signer(role, signer)
|
||||
|
|
|
|||
|
|
@ -1118,7 +1118,7 @@ def test_delegations_get_delegated_role(self) -> None:
|
|||
for name in ["prefix-", "prefix--1", f"prefix-{2**bit_len:0x}"]:
|
||||
with self.assertRaises(ValueError, msg=f"role name '{name}'"):
|
||||
targets.get_delegated_role(name)
|
||||
for i in range(0, 2**bit_len):
|
||||
for i in range(2**bit_len):
|
||||
self.assertEqual(
|
||||
targets.get_delegated_role(f"prefix-{i:0x}"), role2
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1286,7 +1286,7 @@ def get_role_for_target(self, target_filepath: str) -> str:
|
|||
|
||||
def get_roles(self) -> Iterator[str]:
|
||||
"""Yield the names of all different delegated roles one by one."""
|
||||
for i in range(0, self.number_of_bins):
|
||||
for i in range(self.number_of_bins):
|
||||
suffix = f"{i:0{self.suffix_len}x}"
|
||||
yield f"{self.name_prefix}-{suffix}"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue