Skip to content

Commit

Permalink
Enable the f-string ruff rule and fix warnings (#2965)
Browse files Browse the repository at this point in the history
  • Loading branch information
correctmost authored Nov 30, 2024
1 parent d4c04a8 commit 604526c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion archinstall/lib/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def preview(item: MenuItem) -> str | None:
if result.item() == MenuItem.no():
return

debug("Saving configuration files to {}".format(dest_path.absolute()))
debug(f"Saving configuration files to {dest_path.absolute()}")

match save_option:
case "user_config":
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/global_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ def _prev_disk_encryption(self, item: MenuItem) -> str | None:
output += str(_('Password')) + f': {secret(enc_config.encryption_password)}\n'

if enc_config.partitions:
output += 'Partitions: {} selected'.format(len(enc_config.partitions)) + '\n'
output += f'Partitions: {len(enc_config.partitions)} selected\n'
elif enc_config.lvm_volumes:
output += 'LVM volumes: {} selected'.format(len(enc_config.lvm_volumes)) + '\n'
output += f'LVM volumes: {len(enc_config.lvm_volumes)} selected\n'

if enc_config.hsm_device:
output += f'HSM: {enc_config.hsm_device.manufacturer}'
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ def enable_sudo(self, entity: str, group: bool = False):

# We count how many files are there already so we know which number to prefix the file with
num_of_rules_already = len(os.listdir(sudoers_dir))
file_num_str = "{:02d}".format(num_of_rules_already) # We want 00_user1, 01_user2, etc
file_num_str = f"{num_of_rules_already:02d}" # We want 00_user1, 01_user2, etc

# Guarantees that entity str does not contain invalid characters for a linux file name:
# \ / : * ? " < > |
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ ignore = [
"RUF039", # unraw-re-pattern
"UP028", # yield-in-for-loop
"UP031", # printf-string-formatting
"UP032", # f-string
"UP037", # quoted-annotation
"W191", # tab-indentation
]
Expand Down

0 comments on commit 604526c

Please sign in to comment.