diff --git a/fsspec/implementations/http.py b/fsspec/implementations/http.py index c9ab177eb..7b5a38bb3 100644 --- a/fsspec/implementations/http.py +++ b/fsspec/implementations/http.py @@ -254,7 +254,7 @@ async def _get_file( if isfilelike(lpath): outfile = lpath else: - outfile = open(lpath, "wb") # noqa: ASYNC101 + outfile = open(lpath, "wb") # noqa: ASYNC101, ASYNC230 try: chunk = True @@ -282,7 +282,7 @@ async def gen_chunks(): context = nullcontext(lpath) use_seek = False # might not support seeking else: - context = open(lpath, "rb") # noqa: ASYNC101 + context = open(lpath, "rb") # noqa: ASYNC101, ASYNC230 use_seek = True with context as f: @@ -805,7 +805,7 @@ async def get_range(session, url, start, end, file=None, **kwargs): async with r: out = await r.read() if file: - with open(file, "r+b") as f: # noqa: ASYNC101 + with open(file, "r+b") as f: # noqa: ASYNC101, ASYNC230 f.seek(start) f.write(out) else: diff --git a/fsspec/tests/test_utils.py b/fsspec/tests/test_utils.py index 3a5c2ba29..b9167b5d2 100644 --- a/fsspec/tests/test_utils.py +++ b/fsspec/tests/test_utils.py @@ -44,7 +44,7 @@ def test_read_block(): def test_read_block_split_before(): - """Test start/middle/end cases of split_before.""" # noqa: I + """Test start/middle/end cases of split_before.""" d = ( "#header" + "".join(">foo{i}\nFOOBAR{i}\n".format(i=i) for i in range(100000)) ).encode() diff --git a/pyproject.toml b/pyproject.toml index 2dd60522a..963883948 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -154,18 +154,20 @@ select = [ # fix noqas in fsspec/implementations/http.py "ASYNC", "B", - "I", # isort "C4", "G", "E4", "E7", "E9", "F", + "FURB", "LOG", "PERF", "PLC", "PLE", "PLR1722", + "PLR1736", + "PLW1501", "PLW1510", "PLW3301", "PIE800", @@ -175,6 +177,7 @@ select = [ # "PT", enable in later PR "PYI", "RUF006", + "RUF024", "SLOT", "SIM101", ]