Enable truthy-bool checks in mypy and fix related warnings#3528
Enable truthy-bool checks in mypy and fix related warnings#3528svartkanin merged 1 commit intoarchlinux:masterfrom
Conversation
| # TODO: We need to detect if the encrypted device is a whole disk encryption, | ||
| # or simply a partition encryption. Right now we assume it's a partition (and we always have) | ||
|
|
||
| if self._disk_encryption and self._disk_encryption.hsm_device: |
There was a problem hiding this comment.
Line 1011 already assumes self._disk_encryption is not None
| if result := plugin.on_user_created(self, user): | ||
| handled_by_plugin = result | ||
|
|
||
| if user.password: |
There was a problem hiding this comment.
user.password is a Password object
| ) as installation: | ||
| # Mount all the drives to the desired mountpoint | ||
| # This *can* be done outside of the installation, but the installer can deal with it. | ||
| if disk_config: |
There was a problem hiding this comment.
There is an earlier check on line 34
| return ViewportEntry(tr('Press Ctrl+h for help'), 0, 0, STYLE.NORMAL) | ||
|
|
||
| def _show_help(self) -> None: | ||
| if not self._help_window: |
There was a problem hiding this comment.
self._help_window is always initialized:
archinstall/archinstall/tui/curses_menu.py
Lines 34 to 36 in 3df568d
|
|
||
| def _mirror_configuration(self, preset: MirrorConfiguration | None = None) -> MirrorConfiguration | None: | ||
| def _mirror_configuration(self, preset: MirrorConfiguration | None = None) -> MirrorConfiguration: | ||
| mirror_configuration = MirrorMenu(preset=preset).run() |
There was a problem hiding this comment.
MirrorMenu.run() always returns a MirrorConfiguration:
archinstall/archinstall/lib/mirrors.py
Lines 299 to 301 in 3df568d
| @@ -323,17 +323,17 @@ def handle_action( | |||
| partition.invert_flag(PartitionFlag.XBOOTLDR) | |||
| case 'set_filesystem': | |||
| fs_type = self._prompt_partition_fs_type() | |||
There was a problem hiding this comment.
_prompt_partition_fs_type does not allow skipping or resetting:
archinstall/archinstall/lib/disk/partitioning_menu.py
Lines 415 to 432 in 3df568d
PR Description:
Docs: https://mypy.readthedocs.io/en/stable/error_code_list2.html#check-that-expression-is-not-implicitly-true-in-boolean-context-truthy-bool
Tests and Checks