Skip to content

Commit 32b799e

Browse files
László Vaskóvlaci
authored andcommitted
chore(lint): enable flake8-raise ruff rules
- RSE102: Unnecessary parentheses on raised exception https://beta.ruff.rs/docs/rules/#flake8-raise-rse
1 parent 8b49808 commit 32b799e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ select = [
7777
"PTH", # flake8-use-pathlib
7878
"RET", # flake8-return
7979
"RUF", # ruff's own lints
80+
"RSE", # flake8-raise
8081
"S", # flake8-bandit
8182
"SIM", # flake8-simplify
8283
"SLF", # flake8-self

tests/test_finder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class TestHandlerEof(Handler):
4242

4343
def calculate_chunk(self, file, start_offset: int):
4444
del file, start_offset # unused arguments
45-
raise EOFError()
45+
raise EOFError
4646

4747

4848
class TestHandlerInvalid(Handler):
@@ -51,7 +51,7 @@ class TestHandlerInvalid(Handler):
5151

5252
def calculate_chunk(self, file, start_offset: int):
5353
del file, start_offset # unused arguments
54-
raise InvalidInputFormat()
54+
raise InvalidInputFormat
5555

5656

5757
class TestHandlerExc(Handler):

unblob/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def extract(self, inpath: Path, outdir: Path):
9696
path=inpath,
9797
chunk=self,
9898
)
99-
raise ExtractError()
99+
raise ExtractError
100100

101101
self.handler.extract(inpath, outdir)
102102

@@ -305,7 +305,7 @@ def calculate_chunk(self, file: File, start_offset: int) -> Optional[ValidChunk]
305305
def extract(self, inpath: Path, outdir: Path):
306306
if self.EXTRACTOR is None:
307307
logger.debug("Skipping file: no extractor.", path=inpath)
308-
raise ExtractError()
308+
raise ExtractError
309309

310310
# We only extract every blob once, it's a mistake to extract the same blob again
311311
outdir.mkdir(parents=True, exist_ok=False)

0 commit comments

Comments
 (0)