You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[lint] Applies remaining ruff linter changes to hail/ folder (#14415)
This change applies each currently-ignored `ruff` rule progressively;
each commit applies one rule.
The changes were applied manually to avoid known issues with the
automatic fixes; for example, given the code
```python
return (
is_container(t)
or isinstance(t, tstruct)
or isinstance(t, tunion)
or isinstance(t, ttuple)
or isinstance(t, tndarray)
)
```
the automatic fixes produce
```python
return isinstance(t, (tndarray, tstruct, ttuple, tunion))
```
instead of
```python
return is_container(t) or isinstance(t, (tstruct, tunion, ttuple, tndarray))
```
where not only has the call to `is_container` been removed, but also the
order of the `isinstance` comparisons has been changed, which has the
potential to produce side effects (though in this case, I don’t think it
does).
Similarly, when eliminating assignments to unused variables, I left the
right-hand side of the assignment intact in case of side effects, except
where I myself wrote the code in question and know there are no side
effects produced by it.
See also #14150 and
#14159.
---------
Co-authored-by: Patrick Schultz <[email protected]>
0 commit comments