Enable `strict_equality` mypy option

Also fix the following mypy error:

```
lib/galaxy/util/path/__init__.py:247: error: Non-overlapping equality check (left operand type: "struct_passwd", right operand type: "str")  [comparison-overlap]
            or (file_owner == username and owner_permissions >= 4)
```
This commit is contained in:
Nicola Soranzo
2023-03-15 17:01:02 +00:00
parent f45d307db1
commit 443ee27b58
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -244,7 +244,7 @@ def __path_permission_for_user(path: GenericPath, username: str) -> bool:
other_permissions = int(oct_mode[-1])
if (
other_permissions >= 4
or (file_owner == username and owner_permissions >= 4)
or (file_owner.pw_name == username and owner_permissions >= 4)
or (username in group_members and group_permissions >= 4)
):
return True
+1
View File
@@ -6,6 +6,7 @@ exclude = lib/galaxy/tools/bundled|test/functional
pretty = True
no_implicit_reexport = True
no_implicit_optional = True
strict_equality = True
# green list - work on growing these please!
[mypy-galaxy.util.compression_utils]