27
27
import toml
28
28
29
29
from gpt_engineer .core .default .disk_memory import DiskMemory
30
- from gpt_engineer .core .default .file_store import FileStore
31
30
from gpt_engineer .core .default .paths import metadata_path
32
31
from gpt_engineer .core .files_dict import FilesDict
33
32
from gpt_engineer .core .git import filter_by_gitignore , is_git_repo
@@ -62,7 +61,7 @@ class FileSelector:
62
61
"cost additional tokens and potentially overflow token limit.\n \n "
63
62
)
64
63
LINTING_STRING = '[linting]\n # "linting" = "off"\n \n '
65
- isLinting = True
64
+ is_linting = True
66
65
67
66
def __init__ (self , project_path : Union [str , Path ]):
68
67
"""
@@ -77,7 +76,7 @@ def __init__(self, project_path: Union[str, Path]):
77
76
self .metadata_db = DiskMemory (metadata_path (self .project_path ))
78
77
self .toml_path = self .metadata_db .path / self .FILE_LIST_NAME
79
78
80
- def ask_for_files (self ) -> FilesDict :
79
+ def ask_for_files (self ) -> tuple [ FilesDict , bool ] :
81
80
"""
82
81
Prompts the user to select files for context improvement.
83
82
@@ -118,13 +117,7 @@ def ask_for_files(self) -> FilesDict:
118
117
except UnicodeDecodeError :
119
118
print (f"Warning: File not UTF-8 encoded { file_path } , skipping" )
120
119
121
- if self .isLinting :
122
- file_store = FileStore ()
123
- files = FilesDict (content_dict )
124
- linted_files = file_store .linting (files )
125
- return linted_files
126
-
127
- return FilesDict (content_dict )
120
+ return FilesDict (content_dict ), self .is_linting
128
121
129
122
def editor_file_selector (
130
123
self , input_path : Union [str , Path ], init : bool = True
@@ -181,7 +174,7 @@ def editor_file_selector(
181
174
"linting" in linting_status
182
175
and linting_status ["linting" ].get ("linting" , "" ).lower () == "off"
183
176
):
184
- self .isLinting = False
177
+ self .is_linting = False
185
178
self .LINTING_STRING = '[linting]\n "linting" = "off"\n \n '
186
179
print ("\n Linting is disabled" )
187
180
@@ -305,10 +298,10 @@ def get_files_from_toml(
305
298
"linting" in edited_tree
306
299
and edited_tree ["linting" ].get ("linting" , "" ).lower () == "off"
307
300
):
308
- self .isLinting = False
301
+ self .is_linting = False
309
302
print ("\n Linting is disabled" )
310
303
else :
311
- self .isLinting = True
304
+ self .is_linting = True
312
305
313
306
# Iterate through the files in the .toml and append selected files to the list
314
307
for file , _ in edited_tree ["files" ].items ():
0 commit comments