Skip to content

Commit

Permalink
Merge pull request #204 from martinhoyer/pre-commit-update
Browse files Browse the repository at this point in the history
Fix and update pre-commit ruff check
  • Loading branch information
maurizio-lombardi authored Jan 20, 2025
2 parents 9853b83 + 3bc4869 commit 2bb123f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.4
rev: v0.7.1
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-ast
Expand Down
6 changes: 3 additions & 3 deletions rtslib/tcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,9 +1005,9 @@ def __init__(self, name, storage_object_cls, mode, index=None):
with lock_file_path.open('w+') as lkfd:
fcntl.flock(lkfd, fcntl.LOCK_EX)
indexes = set(bs_cache.values())
for index in range(1048576):
if index not in indexes:
self._index = index
for i in range(1048576):
if i not in indexes:
self._index = i
bs_cache[self._lookup_key] = self._index
break
else:
Expand Down
4 changes: 1 addition & 3 deletions rtslib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,8 @@ def is_dev_in_use(path):
except OSError:
return True
else:
try:
with suppress(OSError):
os.close(file_fd)
except OSError:
pass
return False

def _get_size_for_dev(device):
Expand Down

0 comments on commit 2bb123f

Please # to comment.