-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gai and sc docus #738
gai and sc docus #738
Conversation
export function isGlobMatch( | ||
filename: string, | ||
patterns: ElementOrArray<string> | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing type annotation for function parameters. It's a good practice to always specify types for function parameters for better readability and maintainability. 📚
generated by pr-review-commit
missing_type_annotation
endsWith.length && | ||
!endsWith.some((ext) => filename.endsWith(ext)) | ||
) | ||
return undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition in the if statement is complex and hard to understand. Consider simplifying it or breaking it down into smaller, more understandable conditions. This will improve code readability and maintainability. 🧐
generated by pr-review-commit
complex_condition
|
||
/** | ||
* Filename filter using glob syntax. | ||
*/ | ||
glob?: string | ||
glob?: ElementOrArray<string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type of 'endsWith' and 'glob' has been changed from 'string' to 'ElementOrArray'. Make sure that this change is reflected everywhere these properties are used to avoid runtime errors. Also, ensure that the consuming code is updated to handle the new type. 🔄
generated by pr-review-commit
type_change
@@ -9,10 +9,10 @@ import { Code } from "@astrojs/starlight/components" | |||
import source from "../../../../../packages/vscode/genaisrc/cmt.genai.mts?raw" | |||
|
|||
This sample automates adding comments to source code using an LLM | |||
and validate the changes haven't introduce any code modifications. | |||
and validates the changes haven't introduced any code modifications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect verb form used; should be "validates" instead of "validate".
generated by pr-docs-review-commit
grammar
|
||
To do so, we could use a combination of tools to validate the transformer: source formatters, | ||
compilers, linters or LLM-as-judge. | ||
compilers, linters, or LLM-as-judge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing comma before "or" in a list of items.
generated by pr-docs-review-commit
grammar
@@ -45,8 +45,7 @@ if (files.length === 0) | |||
|
|||
### Processing Each File | |||
|
|||
We process each file separately, to avoid exploding the token context and keep the AI focused. | |||
We can use [inline prompts](/genaiscript/reference/scripts/inline-prompts) to make inner queries. | |||
We process each file separately to avoid exploding the token context and keep the AI focused. We can use [inline prompts](/genaiscript/reference/scripts/inline-prompts) to make inner queries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content has been merged into a single paragraph; consider if this changes the intended emphasis or readability.
generated by pr-docs-review-commit
content_structure
@@ -73,12 +72,11 @@ const res = await runPrompt( | |||
) | |||
``` | |||
|
|||
We provide a detailed set of instructions to the AI for how to analyze and comment on the code. | |||
We provide a detailed set of instructions to the AI on how to analyze and comment on the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect preposition used; should be "on how to analyze" instead of "for how to analyze".
generated by pr-docs-review-commit
grammar
|
||
### Format, build, lint | ||
|
||
At this point, we have a modified source code by an LLM. We should try to use all the available tools to validate the changes. | ||
It is best to start with like formatters and compilers as they are deterministic and typically fast. | ||
At this point, we have a modified source code by an LLM. We should try to use all the available tools to validate the changes. It is best to start with formatters and compilers as they are deterministic and typically fast. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content has been merged into a single paragraph; consider if this changes the intended emphasis or readability.
generated by pr-docs-review-commit
content_structure
@@ -115,7 +113,7 @@ genaiscript run cmt | |||
|
|||
## Format and build | |||
|
|||
One important aspect is to normalize and valid the AI generated code. The user can provide a `format` command to run a formatter | |||
One important aspect is to normalize and validate the AI-generated code. The user can provide a `format` command to run a formatter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect verb form used; should be "validate" instead of "valid". Also, "AI-generated" should be hyphenated.
generated by pr-docs-review-commit
grammar
…and update dependencies
@@ -45,8 +45,7 @@ if (files.length === 0) | |||
|
|||
### Processing Each File | |||
|
|||
We process each file separately, to avoid exploding the token context and keep the AI focused. | |||
We can use [inline prompts](/genaiscript/reference/scripts/inline-prompts) to make inner queries. | |||
We process each file separately to avoid exploding the token context and keep the AI focused. We can use [inline prompts](/genaiscript/reference/scripts/inline-prompts) to make inner queries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content in lines 47-48 is redundant and can be combined into a single sentence.
generated by pr-docs-review-commit
content_redundancy
|
||
### Format, build, lint | ||
|
||
At this point, we have a modified source code by an LLM. We should try to use all the available tools to validate the changes. | ||
It is best to start with like formatters and compilers as they are deterministic and typically fast. | ||
At this point, we have a modified source code by an LLM. We should try to use all the available tools to validate the changes. It is best to start with formatters and compilers as they are deterministic and typically fast. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content in lines 78-79 is redundant and can be combined into a single sentence.
generated by pr-docs-review-commit
content_redundancy
packages/cli/src/run.ts
Outdated
|
||
const res = Array.from(resolvedFiles) | ||
return res | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function resolveFiles
does not handle errors that may occur during the execution of asynchronous operations. This could lead to unhandled promise rejections.
generated by pr-review-commit
missing_error_handling
endsWith.length && | ||
!endsWith.some((ext) => filename.endsWith(ext)) | ||
) | ||
return undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for checking if a filename ends with any of the provided extensions could lead to incorrect results. The endsWith
array is checked for length, but not if it actually contains any valid extensions.
generated by pr-review-commit
logic_error
@@ -45,8 +45,7 @@ if (files.length === 0) | |||
|
|||
### Processing Each File | |||
|
|||
We process each file separately, to avoid exploding the token context and keep the AI focused. | |||
We can use [inline prompts](/genaiscript/reference/scripts/inline-prompts) to make inner queries. | |||
We process each file separately to avoid exploding the token context and keep the AI focused. We can use [inline prompts](/genaiscript/reference/scripts/inline-prompts) to make inner queries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged sentences should be separated for clarity.
generated by pr-docs-review-commit
style
|
||
### Format, build, lint | ||
|
||
At this point, we have a modified source code by an LLM. We should try to use all the available tools to validate the changes. | ||
It is best to start with like formatters and compilers as they are deterministic and typically fast. | ||
At this point, we have a modified source code by an LLM. We should try to use all the available tools to validate the changes. It is best to start with formatters and compilers as they are deterministic and typically fast. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged sentences should be separated for clarity.
generated by pr-docs-review-commit
style
@@ -39,7 +39,7 @@ import { | |||
ResponseStatus, | |||
} from "../../core/src/host" | |||
import { AbortSignalOptions, TraceOptions } from "../../core/src/trace" | |||
import { logVerbose, unique } from "../../core/src/util" | |||
import { logVerbose } from "../../core/src/util" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import of 'unique' from "../../core/src/util" has been removed, but it's replaced with 'uniq' from "es-toolkit". Make sure that 'uniq' function from "es-toolkit" behaves exactly the same as 'unique' function from "../../core/src/util". 🧐
generated by pr-review-commit
import_change
endsWith.length && | ||
!endsWith.some((ext) => filename.endsWith(ext)) | ||
) | ||
return undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for handling 'endsWith' in 'defOptions' has been changed from a string to an array. This could potentially break existing code if it's expecting a string instead of an array. Please ensure that all usages of 'endsWith' are updated to handle an array. 😊
generated by pr-review-commit
logic_change
@@ -737,12 +737,12 @@ interface DefOptions extends FenceOptions, ContextExpansionOptions, DataFilter { | |||
/** | |||
* Filename filter based on file suffix. Case insensitive. | |||
*/ | |||
endsWith?: string | |||
endsWith?: ElementOrArray<string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type of 'endsWith' in 'DefOptions' interface has been changed from 'string' to 'ElementOrArray'. This could potentially break existing code if it's expecting a string instead of an array. Please ensure that all usages of 'endsWith' are updated to handle an array. 😊
generated by pr-review-commit
type_change
Investigator report, bd4ac32 It appears there was an issue with the TypeScript compilation process. Root Cause AnalysisThe failure is due to a TypeScript error in the file Error Message
Suggested FixYou will need to check Diff SuggestionEnsure the template literals in your TypeScript file are properly closed. Here's a hypothetical fix: - const poem = `This is a poem
- that needs closing
+ const poem = `This is a poem
+ that needs closing` Review and update
|
@@ -313,15 +318,17 @@ export function createChatGenerationContext( | |||
} | |||
|
|||
const defFileOutput = ( | |||
pattern: string, | |||
pattern: ElementOrArray<string | WorkspaceFile>, | |||
description: string, | |||
options?: FileOutputOptions | |||
): void => { | |||
if (pattern) | |||
appendChild( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'pattern' parameter type has been changed from 'string' to 'ElementOrArray<string | WorkspaceFile>'. Ensure that all calls to 'defFileOutput' function are updated to pass the correct type.
generated by pr-review-commit
pattern_change
@@ -313,15 +318,17 @@ export function createChatGenerationContext( | |||
} | |||
|
|||
const defFileOutput = ( | |||
pattern: string, | |||
pattern: ElementOrArray<string | WorkspaceFile>, | |||
description: string, | |||
options?: FileOutputOptions | |||
): void => { | |||
if (pattern) | |||
appendChild( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type of 'pattern' in 'defFileOutput' function has been changed from 'string' to 'ElementOrArray<string | WorkspaceFile>'. Ensure that all usages of this function have been updated to reflect this change.
generated by pr-review-commit
pattern_type_change
@@ -45,8 +45,7 @@ if (files.length === 0) | |||
|
|||
### Processing Each File | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The phrase "We process each file separately, to avoid exploding the token context and keep the AI focused." should be "We process each file separately to avoid exploding the token context and keep the AI focused."
generated by pr-docs-review-commit
grammar
import source from "../../../../../packages/sample/genaisrc/gai.genai.mts?raw" | ||
import gasource from "../../../../../.github/workflows/genai-investigator.yml?raw" | ||
|
||
This is an in-depth guide to build a script that interactively investigates GitHub Actions failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New file created: docs/src/content/docs/samples/gai.mdx.
generated by pr-docs-review-commit
new_file
import { Code } from "@astrojs/starlight/components" | ||
import source from "../../../../../packages/sample/genaisrc/sc.genai.mts?raw" | ||
|
||
Automating and improving the efficiency of proofreading documents is a common need among developers and writers. This script addresses this need by checking and correcting spelling and grammar in Markdown files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New file created: docs/src/content/docs/samples/sc.mdx.
generated by pr-docs-review-commit
new_file
This pull request fixes an artificial error that was introduced in the code.