fix: resolve lint issues in EditFileTool implementation

- Remove unused os import from edit_file_tool.py
- Fix f-string without placeholders
- Remove unused pathlib.Path import from test file
- Remove unused pytest import from integration test file

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-07-30 07:47:29 +00:00
parent f2fa1755ae
commit 115af9b495
3 changed files with 1 additions and 4 deletions

View File

@@ -2,7 +2,6 @@ from crewai.tools import BaseTool
from crewai.llm import LLM
from typing import Type, Optional
from pydantic import BaseModel, Field
import os
from pathlib import Path
@@ -63,7 +62,7 @@ class EditFileTool(BaseTool):
new_content = self._extract_file_content(response)
if new_content is None:
return f"Error: Failed to generate valid file content. LLM response was malformed."
return "Error: Failed to generate valid file content. LLM response was malformed."
backup_path = f"{file_path}.backup"
with open(backup_path, 'w', encoding='utf-8') as f:

View File

@@ -1,7 +1,6 @@
import pytest
import tempfile
import os
from pathlib import Path
from unittest.mock import Mock, patch
from crewai.tools.agent_tools.edit_file_tool import EditFileTool, EditFileToolInput

View File

@@ -1,4 +1,3 @@
import pytest
import tempfile
import os
from unittest.mock import patch