Skip to content

Commit

Permalink
Enable strict_equality mypy option
Browse files Browse the repository at this point in the history
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)
```
  • Loading branch information
nsoranzo committed Mar 15, 2023
1 parent f45d307 commit 443ee27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/galaxy/util/path/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 443ee27

Please sign in to comment.