Skip to content

Commit 806140c

Browse files
author
adnan wahab
committed
cool
1 parent 7d4b60a commit 806140c

File tree

116 files changed

+54
-21035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+54
-21035
lines changed

files.json

+8-131
Large diffs are not rendered by default.

web-ui/index.html

-129
This file was deleted.

web-ui/js/helpers/Kent_Beck_robusteness.js

+46-6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ async function findUnusedFiles(directory) {
2828
// Agent 2: Comment Quality Evaluator
2929
async function moveComments(filePath) {
3030
const fileContent = fs.readFileSync(filePath, "utf-8");
31+
console.log('acorn', filePath)
32+
//install -g uglify-js
3133
// const response = await ollama.generate({
3234
// model: "codellama:13b",
3335
// prompt: `Evaluate the following code comments and suggest improvements or removal of unnecessary ones:\n\n${fileContent}`,
@@ -49,7 +51,8 @@ async function moveComments(filePath) {
4951
});
5052

5153
let newFileContent = acorn.generate(ast);
52-
fs.writeFileSync(filePath, newFileContent);
54+
console.log(newFileContent)
55+
//fs.writeFileSync(filePath, newFileContent);
5356
return { newFileContent, comments };
5457
// Process the response and return suggestions
5558
}
@@ -95,15 +98,17 @@ async function runAllAgents(directory) {
9598
//const directorySuggestions = await suggestDirectorySimplifications(directory);
9699
//saveSuggestions({ directory_suggestions: directorySuggestions }, "directory_suggestions.json");
97100
let count = {
98-
comments: {}
101+
comments: {},
102+
by_extension: {},
99103

100104
}
101105

102106
files.forEach(file => {
103-
count[path.extname(file)] =(count[path.extname(file)] || 0) + fs.readFileSync(file, 'utf-8').length
104-
count['comments'][file] = moveComments(file)
105-
count[file] = fs.readFileSync(file, 'utf-8').length
106-
107+
if (path.extname(file) === '.js' || path.extname(file) === '.ts' || path.extname(file) === '.jsx' || path.extname(file) === '.tsx') {
108+
count.by_extension[path.extname(file)] =(count.by_extension[path.extname(file)] || 0) + fs.readFileSync(file, 'utf-8').length
109+
//count['comments'][file] = moveComments(file)
110+
count[file] = fs.readFileSync(file, 'utf-8').length
111+
}
107112
});
108113

109114
//console.log(count)
@@ -113,6 +118,41 @@ async function runAllAgents(directory) {
113118

114119
//anthropci ---- 200k maximum
115120
//gemini 2 million token context window
121+
122+
123+
// Move all JSX and TSX files to a folder called 'views'
124+
const moveFilesToViews = async () => {
125+
const viewsDir = path.join(root_dir, 'views');
126+
if (!fs.existsSync(viewsDir)) {
127+
fs.mkdirSync(viewsDir);
128+
}
129+
130+
files.filter(file => file.endsWith('.jsx') || file.endsWith('.tsx')).forEach(file => {
131+
const newFilePath = path.join(viewsDir, path.basename(file));
132+
fs.renameSync(file, newFilePath);
133+
console.log(`Moved ${file} to ${newFilePath}`);
134+
});
135+
};
136+
137+
// Move all HTML files to a folder called 'views/archive'
138+
const moveHtmlFilesToArchive = async () => {
139+
const archiveDir = path.join(root_dir, 'views', 'archive');
140+
if (!fs.existsSync(archiveDir)) {
141+
fs.mkdirSync(archiveDir, { recursive: true });
142+
}
143+
144+
files.filter(file => file.endsWith('.html')).forEach(file => {
145+
const newFilePath = path.join(archiveDir, path.basename(file));
146+
fs.renameSync(file, newFilePath);
147+
console.log(`Moved ${file} to ${newFilePath}`);
148+
});
149+
};
150+
151+
await moveFilesToViews();
152+
await moveHtmlFilesToArchive();
153+
154+
155+
116156
}
117157

118158
runAllAgents()

web-ui/js/views/200k_Pull_requests.html

Whitespace-only changes.

web-ui/js/views/blag.html

-71
This file was deleted.

0 commit comments

Comments
 (0)