Skip to content

Commit f8bd625

Browse files
author
Colin McNeil
committed
Remove write_files
1 parent ed68adb commit f8bd625

File tree

5 files changed

+15
-55
lines changed

5 files changed

+15
-55
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,6 @@ expressions documented [here](https://github.com/yogthos/Selmer) are supported.
129129
```sh
130130
#docker:command=build
131131

132-
docker build -t vonwig/prompts:latest -f Dockerfile .
132+
docker build -t vonwig/prompts:local -f Dockerfile .
133133
```
134134

functions/tree_sitter/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ const line_node = search_node(parsed.rootNode)
3333

3434
const parent = line_node.parent
3535

36+
if (parent) {
37+
const start_line = parent.startPosition.row
38+
const end_line = parent.endPosition.row
39+
// Return codeContent from start_line to end_line
40+
const lines = codeContent.split('\n').slice(start_line, end_line + 1)
41+
parent.content = lines.join('\n')
42+
}
43+
3644
console.log({
3745
offending_line: line_node.text,
3846
line_node: line_node,

prompts/eslint/010_system_prompt.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ Do the following to lint a JS/TS project:
1919

2020
2. Run the linter chosen, fixing violations.
2121

22-
3. Determine total number of remaining violations after autofix.
22+
3. Evaluate the report of remaining violations after autofix.
2323

24-
4. Fix the remaining violations
25-
You must fix files with the following steps:
26-
- For less than 10 violations, use `complain`.
27-
- For more than 10 violations, use `read_files` to read violating files, and use `write_files` to fix them.
24+
4. Read files affected and generate fixes for the remaining violations.
2825

prompts/eslint/README.md

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,6 @@ functions:
5555
- args
5656
container:
5757
image: vonwig/git:local
58-
- name: write_files
59-
description: Write a set of files to my project
60-
parameters:
61-
type: object
62-
properties:
63-
files:
64-
type: array
65-
items:
66-
type: object
67-
properties:
68-
path:
69-
type: string
70-
description: the relative path to the file that should be written
71-
content:
72-
type: string
73-
description: the content that should be written to a file
74-
executable:
75-
type: boolean
76-
description: whether to make the file executable
77-
container:
78-
image: vonwig/function_write_files:latest
7958
- name: read_files
8059
description: Reads a set of files back
8160
parameters:
@@ -88,33 +67,7 @@ functions:
8867
description: Relative path to a file to read.
8968
container:
9069
image: vonwig/read_files:latest
91-
- name: complain
92-
description: Complain about a file
93-
parameters:
94-
type: object
95-
properties:
96-
start_location:
97-
type: array
98-
description: "Start location in edit, formatted [row, col]"
99-
items:
100-
type: number
101-
description: The row or column
102-
end_location:
103-
type: array
104-
description: "End location in edit, formatted [row, col]"
105-
items:
106-
type: number
107-
description: The row or column
108-
edit:
109-
type: string
110-
description: Code to insert between start_location and end_location which will resolve the violation. Do not include ignore comments.
111-
required:
112-
- start_location
113-
- end_location
114-
container:
115-
image: alpine:latest
116-
entrypoint:
117-
- echo
70+
11871
---
11972

12073
# Description

prompts/project_type/100_user_prompt.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ Here is a list of files that are currently versioned in this project:
1010
* {{.}}
1111
{{/project.files}}
1212

13-
Use this list of files and the languages that we've detected in the project to figure out what kind of projects this is. It is okay if it appears to be a combination of more than one project type, but try to be as specific as possible.
13+
Use this list of files and the languages that we've detected in the project to
14+
figure out what kind of projects this is. It is okay if it appears to be a combination
15+
of more than one project type, but try to be as specific as possible.
1416

1517
When you have made your choice, output using the following `application/json` format.
1618

0 commit comments

Comments
 (0)