You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2025/06/13 06:12:35 UTC

(lucene) branch main updated: No ruff violation (#14725)

This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new 686ef91e15f No ruff violation (#14725)
686ef91e15f is described below

commit 686ef91e15f6be22aa6d2d55335d0e5160636c6a
Author: Mariah Wilcher <ma...@gmail.com>
AuthorDate: Fri Jun 13 02:12:29 2025 -0400

    No ruff violation (#14725)
    
    * update PTH104 ruff rule to rename files.
    * no ruff rule violation removing ignore
---
 dev-tools/scripts/create_line_file_docs.py    | 3 ++-
 dev-tools/scripts/pyproject.toml              | 2 --
 dev-tools/scripts/reproduceJenkinsFailures.py | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/dev-tools/scripts/create_line_file_docs.py b/dev-tools/scripts/create_line_file_docs.py
index 1dd9963ecdc..e10cdcc673e 100644
--- a/dev-tools/scripts/create_line_file_docs.py
+++ b/dev-tools/scripts/create_line_file_docs.py
@@ -24,6 +24,7 @@ import tempfile
 import time
 import urllib.request
 from io import TextIOWrapper
+from pathlib import Path
 
 DEBUG = False
 
@@ -113,7 +114,7 @@ def sample_europarl():
   if not os.path.exists(file_name):
     print("Download %s to %s..." % (EUROPARL_V7_URL, file_name))
     urllib.request.urlretrieve(EUROPARL_V7_URL, file_name + ".tmp")
-    os.rename(file_name + ".tmp", file_name)
+    _ = Path(f"{file_name}.tmp").rename(file_name)
   else:
     print("%s already here; skipping download..." % file_name)
 
diff --git a/dev-tools/scripts/pyproject.toml b/dev-tools/scripts/pyproject.toml
index b2a91acb00f..459aca9b819 100644
--- a/dev-tools/scripts/pyproject.toml
+++ b/dev-tools/scripts/pyproject.toml
@@ -46,8 +46,6 @@ ignore = [
   "ANN204",  # missing return annotation for special method
   "ANN206",  # missing return annotation for classmethod
   "ANN401",  # use of Any as function parameter
-  "ARG001",  # unused function argument
-  "ARG002",  # unused method argument
   "ARG005",  # unused lambda argument
   "B006",    # do not use mutable datastructures for arg defaults
   "B904",    # within except clause, raise exceptions with .. from
diff --git a/dev-tools/scripts/reproduceJenkinsFailures.py b/dev-tools/scripts/reproduceJenkinsFailures.py
index aef89df9fca..46cf712c693 100644
--- a/dev-tools/scripts/reproduceJenkinsFailures.py
+++ b/dev-tools/scripts/reproduceJenkinsFailures.py
@@ -238,7 +238,7 @@ def printAndMoveReports(testIters: int, newSubDir: str, location: str):
           # have to play nice with 'ant clean'...
           newDirPath = os.path.join("repro-reports", newSubDir, dir)
           Path(newDirPath).mkdir(exist_ok=True, parents=True)
-          os.rename(filePath, os.path.join(newDirPath, file))
+          _ = Path(filePath).rename(target=os.path.join(newDirPath, file))
   print("[repro] Failures%s:" % location)
   for testcase in sorted(failures, key=lambda t: (failures[t], t)):  # sort by failure count, then by testcase
     print("[repro]   %d/%d failed: %s" % (failures[testcase], testIters, testcase))