-
Notifications
You must be signed in to change notification settings - Fork 297
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
PromptString linter: Only error when the reported violation is within one of the changed range #3810
Conversation
… one of the changed ranges
|
@@ -1255,3 +1255,6 @@ function newChatModelFromSerializedChatTranscript( | |||
function isAbortError(error: Error): boolean { | |||
return error.message === 'aborted' || error.message === 'socket hang up' | |||
} | |||
|
|||
// Only this unsafe usage should be report | |||
PromptString.unsafe_fromUserQuery('EVIL!') |
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.
As you can see only this violation was reported, not the other violations in this file
|
||
const EXTENSIONS = ['ts', 'tsx'] | ||
|
||
exec('git diff --unified=0 origin/main', (error, stdout, stderr) => { |
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.
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.
Thanks for the quick fix :)
As the title suggest, we only want to emit linter errors when new call sites were added. The previous rule would fire too often.
Test plan
vscode/src/chat/chat-view/SimpleChatPanelProvider.ts
that adds anunsafe_
API callpnpm ts-node lints/safe-prompts.ts
pnpm ts-node lints/git-diff-ts-ranges.ts`