mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
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:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import pytest
|
||||
import tempfile
|
||||
import os
|
||||
from unittest.mock import patch
|
||||
|
||||
Reference in New Issue
Block a user