Skip to content

Commit

Permalink
Update Ruff to 0.9.2 (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schamper authored Jan 17, 2025
1 parent 166f63e commit 27b44fe
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dissect/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lz4",
"lznt1",
"lzo",
"lzxpress_huffman",
"lzxpress",
"lzxpress_huffman",
"sevenbit",
]
2 changes: 1 addition & 1 deletion dissect/util/compression/lzxpress_huffman.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def _read_16_bit(fh: BinaryIO) -> int:


class Node:
__slots__ = ("symbol", "is_leaf", "children")
__slots__ = ("children", "is_leaf", "symbol")

def __init__(self, symbol: Symbol | None = None, is_leaf: bool = False):
self.symbol = symbol
Expand Down
4 changes: 2 additions & 2 deletions dissect/util/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _set_pos(self, pos: int) -> None:

def _fill_buf(self) -> None:
"""Fill the alignment buffer if we can."""
if self._buf or self.size is not None and (self.size <= self._pos or self.size <= self._pos_align):
if self._buf or (self.size is not None and (self.size <= self._pos or self.size <= self._pos_align)):
return

self._buf = self._read(self._pos_align, self.align)
Expand Down Expand Up @@ -111,7 +111,7 @@ def read(self, n: int = -1) -> bytes:
remaining = size - self._pos
n = remaining if n == -1 else min(n, remaining)

if n == 0 or size is not None and size <= self._pos:
if n == 0 or (size is not None and size <= self._pos):
return b""

# Read misaligned start from buffer
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dump-nskeyedarchiver = "dissect.util.tools.dump_nskeyedarchiver:main"

[tool.ruff]
line-length = 120
required-version = ">=0.6.0"
required-version = ">=0.9.0"

[tool.ruff.format]
docstring-code-format = true
Expand Down Expand Up @@ -86,7 +86,7 @@ select = [
"FURB",
"RUF",
]
ignore = ["E203", "B904", "UP024", "ANN002", "ANN003", "ANN101", "ANN102", "ANN204", "ANN401", "SIM105", "TRY003"]
ignore = ["E203", "B904", "UP024", "ANN002", "ANN003", "ANN204", "ANN401", "SIM105", "TRY003"]

[tool.ruff.lint.per-file-ignores]
"tests/docs/**" = ["INP001"]
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ commands =
[testenv:fix]
package = skip
deps =
ruff==0.6.9
ruff==0.9.2
commands =
ruff format dissect tests

[testenv:lint]
package = skip
deps =
ruff==0.6.9
ruff==0.9.2
vermin
commands =
ruff check dissect tests
Expand Down

0 comments on commit 27b44fe

Please sign in to comment.