Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/vendor-reflexio.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ def export_reflexio(
shutil.rmtree(vendor_dest)
vendor_dest.mkdir(parents=True)
with tarfile.open(archive) as tar:
tar.extractall(vendor_dest)
if sys.version_info >= (3, 12):
tar.extractall(vendor_dest, filter="data")
else:
tar.extractall(vendor_dest)
Comment on lines +138 to +141

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify sys import exists and check minimum Python version constraints

echo "=== Checking for sys import ==="
head -50 scripts/vendor-reflexio.py | grep -n "import sys\|from sys"

echo ""
echo "=== Checking pyproject.toml for Python version constraints ==="
fd -t f 'pyproject.toml' --exec grep -l "python" {} \; | head -5 | xargs -I{} sh -c 'echo "--- {} ---"; grep -E "requires-python|python_requires|target-version" {}'

echo ""
echo "=== Checking for .python-version file ==="
cat .python-version 2>/dev/null || echo "No .python-version found"

Repository: ReflexioAI/claude-smart

Length of output: 284


Remove dead code: the else branch is unreachable since the project requires Python 3.12+.

The version guard is correct and sys is properly imported (line 15). However, since pyproject.toml specifies requires-python = ">=3.12", the else branch (lines 140-141) will never execute in production—all instances run Python 3.12+.

Remove the unnecessary else branch:

Suggested change
if sys.version_info >= (3, 12):
    tar.extractall(vendor_dest, filter="data")
else:
    tar.extractall(vendor_dest)

Should be:

tar.extractall(vendor_dest, filter="data")

This also eliminates the Ruff S202 warning, since filter="data" is now the only code path.

🧰 Tools
🪛 Ruff (0.15.17)

[error] 141-141: Uses of tarfile.extractall()

(S202)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/vendor-reflexio.py` around lines 138 - 141, The if-else block
checking sys.version_info is dead code since the project requires Python 3.12+
in pyproject.toml, making the else branch unreachable. Remove the entire version
check condition and the else branch, keeping only the tar.extractall call with
filter="data" parameter. This will eliminate the dead code and resolve the
associated Ruff warning.

Source: Linters/SAST tools



def existing_updated_at(lock_file: Path, payload: dict[str, str]) -> str | None:
Expand Down