Skip to content

Commit

Permalink
refactor: rename diff_hunk to diffHunk
Browse files Browse the repository at this point in the history
  • Loading branch information
EresDev committed Aug 19, 2024
1 parent f56d997 commit 99089b2
Show file tree
Hide file tree
Showing 10 changed files with 329 additions and 329 deletions.
4 changes: 2 additions & 2 deletions src/parser/content-evaluator-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ export class ContentEvaluatorModule implements Module {
const currentComment = commentsWithScore[i];
if (!this._fixedRelevances[currentComment.type]) {
if (currentComment.type & CommentKind.PULL) {
if (currentComment?.diff_hunk) {
if (currentComment?.diffHunk) {
//Eval PR comment with diff_hunk, all other PR comments get relevance:1 by default

reviewCommentsToEvaluate.push({
id: currentComment.id,
comment: currentComment.content,
diff_hunk: currentComment.diff_hunk,
diffHunk: currentComment.diffHunk,
});
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/data-purge-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class DataPurgeModule implements Module {
content: newContent,
url: comment.html_url,
type: comment.type,
diff_hunk: reviewComment?.pull_request_review_id ? reviewComment?.diff_hunk : undefined,
diffHunk: reviewComment?.pull_request_review_id ? reviewComment?.diff_hunk : undefined,
},
];
}
Expand Down
2 changes: 1 addition & 1 deletion src/parser/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface GithubCommentScore {
content: string;
url: string;
type: CommentKind | CommentAssociation;
diff_hunk?: string;
diffHunk?: string;
score?: {
formatting?: {
content: Record<string, { count: number; score: number }>;
Expand Down
2 changes: 1 addition & 1 deletion src/types/content-evaluator-module-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Type, Static } from "@sinclair/typebox";

export type CommentToEvaluate = { id: number; comment: string };

export type ReviewCommentToEvaluate = { id: number; comment: string; diff_hunk: string };
export type ReviewCommentToEvaluate = { id: number; comment: string; diffHunk: string };

export const openAiRelevanceResponseSchema = Type.Record(Type.String(), Type.Number({ minimum: 0, maximum: 1 }));

Expand Down
108 changes: 54 additions & 54 deletions tests/__mocks__/results/content-evaluator-results.json

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions tests/__mocks__/results/data-purge-result.json

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions tests/__mocks__/results/formatting-evaluator-results.json

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions tests/__mocks__/results/github-comment-results.json

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions tests/__mocks__/results/output.html

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions tests/__mocks__/results/permit-generation-results.json

Large diffs are not rendered by default.

0 comments on commit 99089b2

Please sign in to comment.