Skip to content

Refactor FilesystemType - #4417

Merged
svartkanin merged 3 commits into
archlinux:masterfrom
codefiles:ref-filesystemtype
Apr 13, 2026
Merged

Refactor FilesystemType#4417
svartkanin merged 3 commits into
archlinux:masterfrom
codefiles:ref-filesystemtype

Conversation

@codefiles

Copy link
Copy Markdown
Contributor

Part of #4405

@codefiles
codefiles requested a review from Torxed as a code owner April 12, 2026 15:25
Comment on lines +134 to +141
if fs_type := partition.get('fs_type'):
fs_type = FilesystemType(fs_type)
else:
fs_type = None

device_partition = PartitionModification(
status=ModificationStatus(partition['status']),
fs_type=FilesystemType(partition['fs_type']) if partition.get('fs_type') else None,
fs_type=fs_type,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change mypy produces this error:

archinstall/lib/models/device.py:136: error: Argument 1 to "FilesystemType" has incompatible type "str | None"; expected "str"  [arg-type]

MenuItem('ext4', value=FilesystemType.Ext4),
MenuItem('xfs', value=FilesystemType.Xfs),
MenuItem('f2fs', value=FilesystemType.F2fs),
MenuItem(FilesystemType.BTRFS.value, value=FilesystemType.BTRFS),

@svartkanin svartkanin Apr 13, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI there's a helper function


it was introduced after this was implemented so one day we can move it :)

@svartkanin
svartkanin merged commit 335a7b7 into archlinux:master Apr 13, 2026
10 checks passed
@codefiles
codefiles deleted the ref-filesystemtype branch April 13, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants