Skip to content

Commit 2c25540

Browse files
authored
Enable Ruff collection-literal-concatenation rule (#4818)
1 parent 6bda550 commit 2c25540

8 files changed

Lines changed: 11 additions & 9 deletions

File tree

‎archinstall/default_profiles/desktops/labwc.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def packages(self) -> list[str]:
2121
return [
2222
'alacritty',
2323
'labwc',
24-
] + seat_access_packages(self.custom_settings.get(CustomSetting.SeatAccess))
24+
*seat_access_packages(self.custom_settings.get(CustomSetting.SeatAccess)),
25+
]
2526

2627
@property
2728
@override

‎archinstall/default_profiles/desktops/niri.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def packages(self) -> list[str]:
2929
'swayidle',
3030
'swaylock',
3131
'xdg-desktop-portal-gnome',
32-
] + seat_access_packages(self.custom_settings.get(CustomSetting.SeatAccess))
32+
*seat_access_packages(self.custom_settings.get(CustomSetting.SeatAccess)),
33+
]
3334

3435
@property
3536
@override

‎archinstall/default_profiles/desktops/sway.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def packages(self) -> list[str]:
3131
'pavucontrol',
3232
'foot',
3333
'xorg-xwayland',
34-
] + seat_access_packages(self.custom_settings.get(CustomSetting.SeatAccess))
34+
*seat_access_packages(self.custom_settings.get(CustomSetting.SeatAccess)),
35+
]
3536

3637
@property
3738
@override

‎archinstall/lib/disk/partitioning_menu.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def as_segments(self, device_partitions: list[PartitionModification]) -> list[Di
148148
if not partitions:
149149
free_space = FreeSpace(self._buffer, end)
150150
if free_space.length > self._buffer:
151-
return segments + [DiskSegment(free_space)]
151+
return [*segments, DiskSegment(free_space)]
152152
return segments
153153

154154
first_part_index, first_partition = next(

‎archinstall/lib/disk/utils.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def umount(mountpoint: Path | str, recursive: bool = False) -> None:
188188

189189
for path in lsblk_info.mountpoints:
190190
debug(f'Unmounting mountpoint: {path}')
191-
SysCommand(cmd + [str(path)])
191+
SysCommand([*cmd, str(path)])
192192

193193

194194
def swapon(path: Path) -> None:

‎archinstall/lib/installer.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def _mount_partition(self, part_mod: PartitionModification) -> None:
379379
options = part_mod.mount_options
380380

381381
if part_mod.is_efi():
382-
options = list(dict.fromkeys(options + ['fmask=0177', 'dmask=0077']))
382+
options = list(dict.fromkeys([*options, 'fmask=0177', 'dmask=0077']))
383383

384384
mount(part_mod.dev_path, target, options=options)
385385
elif part_mod.fs_type == FilesystemType.BTRFS:
@@ -444,7 +444,7 @@ def _mount_btrfs_subvol(
444444
subvols_with_mountpoints = [sv for sv in subvolumes if sv.mountpoint is not None]
445445
for subvol in sorted(subvols_with_mountpoints, key=lambda x: x.relative_mountpoint):
446446
mountpoint = self.target / subvol.relative_mountpoint
447-
options = mount_options + [f'subvol={subvol.name}']
447+
options = [*mount_options, f'subvol={subvol.name}']
448448
mount(dev_path, mountpoint, options=options)
449449

450450
def generate_key_files(self) -> None:

‎archinstall/lib/menu/list_manager.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async def _run(self) -> list[ValueT] | None:
9797
return self._data
9898

9999
async def _run_actions_on_entry(self, entry: ValueT) -> None:
100-
options = self.filter_options(entry, self._sub_menu_actions) + [self._cancel_action]
100+
options = [*self.filter_options(entry, self._sub_menu_actions), self._cancel_action]
101101

102102
items = [MenuItem(o, value=o) for o in options]
103103
group = MenuItemGroup(items, sort_items=False)

‎pyproject.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ ignore = [
229229
"PLC1901", # compare-to-empty-string
230230
"PLW1514", # unspecified-encoding
231231
"PLW1641", # eq-without-hash
232-
"RUF005", # collection-literal-concatenation
233232
"RUF039", # unraw-re-pattern
234233
"W191", # tab-indentation
235234
]

0 commit comments

Comments
 (0)