Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.

Commit 55c68b7

Browse files
committed
refactor: remove unused exports and functions
1 parent 8277400 commit 55c68b7

File tree

18 files changed

+100
-835
lines changed

18 files changed

+100
-835
lines changed

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"@sinclair/typebox": "^0.31.22",
3838
"@supabase/supabase-js": "^2.4.0",
3939
"@types/ms": "^0.7.31",
40-
"@types/parse5": "^7.0.0",
4140
"@typescript-eslint/eslint-plugin": "^5.59.11",
4241
"@typescript-eslint/parser": "^5.59.11",
4342
"@uniswap/permit2-sdk": "^1.2.0",
@@ -59,7 +58,6 @@
5958
"node-html-parser": "^6.1.5",
6059
"nodemon": "^2.0.19",
6160
"openai": "^4.2.0",
62-
"parse5": "^7.1.2",
6361
"prettier": "^2.7.1",
6462
"probot": "^12.2.4",
6563
"tsx": "^3.12.7",
@@ -68,7 +66,6 @@
6866
"devDependencies": {
6967
"@types/dotenv": "^8.2.0",
7068
"@types/eslint": "^8.40.2",
71-
"@types/jest": "^29.5.5",
7269
"@types/jsdom": "^21.1.4",
7370
"@types/libsodium-wrappers": "^0.7.10",
7471
"@types/lodash": "^4.14.197",
@@ -78,9 +75,7 @@
7875
"eslint": "^8.43.0",
7976
"jest": "^29.6.2",
8077
"knip": "^2.33.4",
81-
"octokit": "^3.1.1",
8278
"rimraf": "3.0.2",
83-
"smee-client": "^1.2.3",
8479
"source-map-support": "^0.5.21",
8580
"ts-jest": "^29.1.1",
8681
"typescript": "^4.9.5"
@@ -108,4 +103,4 @@
108103
"ext": "ts",
109104
"exec": "yarn start"
110105
}
111-
}
106+
}

src/adapters/supabase/helpers/pretty-logs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ interface Metadata {
162162
[key: string]: any;
163163
}
164164

165-
export enum Colors {
165+
enum Colors {
166166
reset = "\x1b[0m",
167167
bright = "\x1b[1m",
168168
dim = "\x1b[2m",

src/adapters/supabase/helpers/tables/locations.ts

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { SupabaseClient } from "@supabase/supabase-js";
22
import { Super } from "./super";
3-
import { Database } from "../../types/database";
4-
import { Context as ProbotContext } from "probot";
3+
// import { Database } from "../../types/database";
54

65
// currently trying to save all of the location metadata of the event.
76
// seems that focusing on the IssueComments will provide the most value
87

9-
export type LocationsRow = Database["public"]["Tables"]["logs"]["Row"];
8+
// type LocationsRow = Database["public"]["Tables"]["logs"]["Row"];
109
export class Locations extends Super {
1110
locationResponse: LocationResponse | undefined;
1211

@@ -30,50 +29,6 @@ export class Locations extends Super {
3029
if (error) throw this.runtime.logger.error("Error getting location data", new Error(error.message));
3130
return locationData;
3231
}
33-
34-
public async getLocationsMetaData(context: ProbotContext, issueCommentId: string) {
35-
const graphQlQuery = `
36-
query {
37-
node(id: "${issueCommentId}") {
38-
... on IssueComment {
39-
id
40-
author {
41-
login
42-
... on User {
43-
id
44-
}
45-
}
46-
issue {
47-
id
48-
number
49-
repository {
50-
id
51-
name
52-
owner {
53-
... on Organization {
54-
id
55-
login
56-
}
57-
}
58-
}
59-
}
60-
}
61-
}
62-
}
63-
`;
64-
65-
this.locationResponse = (await context.octokit.graphql(graphQlQuery)) as LocationResponse;
66-
console.trace(this.locationResponse);
67-
68-
this.user_id = this.locationResponse.data.node.author.id;
69-
this.comment_id = this.locationResponse.data.node.id;
70-
this.issue_id = this.locationResponse.data.node.issue.id;
71-
this.repository_id = this.locationResponse.data.node.issue.repository.id;
72-
this.node_id = this.locationResponse.data.node.issue.repository.id;
73-
this.node_type = "IssueComment";
74-
75-
return this.locationResponse;
76-
}
7732
}
7833

7934
interface LocationResponse {

src/adapters/supabase/helpers/tables/logs.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,17 @@ export class Logs {
187187
});
188188
}
189189

190-
http(log: string, metadata?: any, postComment?: boolean): LogReturn | null {
191-
metadata = this._addDiagnosticInformation(metadata);
192-
return this._log({
193-
level: LogLevel.HTTP,
194-
consoleLog: this.console.http,
195-
logMessage: log,
196-
metadata,
197-
postComment,
198-
type: "http",
199-
});
200-
}
190+
// http(log: string, metadata?: any, postComment?: boolean): LogReturn | null {
191+
// metadata = this._addDiagnosticInformation(metadata);
192+
// return this._log({
193+
// level: LogLevel.HTTP,
194+
// consoleLog: this.console.http,
195+
// logMessage: log,
196+
// metadata,
197+
// postComment,
198+
// type: "http",
199+
// });
200+
// }
201201

202202
verbose(log: string, metadata?: any, postComment?: boolean): LogReturn | null {
203203
metadata = this._addDiagnosticInformation(metadata);
@@ -211,17 +211,17 @@ export class Logs {
211211
});
212212
}
213213

214-
silly(log: string, metadata?: any, postComment?: boolean): LogReturn | null {
215-
metadata = this._addDiagnosticInformation(metadata);
216-
return this._log({
217-
level: LogLevel.SILLY,
218-
consoleLog: this.console.silly,
219-
logMessage: log,
220-
metadata,
221-
postComment,
222-
type: "silly",
223-
});
224-
}
214+
// silly(log: string, metadata?: any, postComment?: boolean): LogReturn | null {
215+
// metadata = this._addDiagnosticInformation(metadata);
216+
// return this._log({
217+
// level: LogLevel.SILLY,
218+
// consoleLog: this.console.silly,
219+
// logMessage: log,
220+
// metadata,
221+
// postComment,
222+
// type: "silly",
223+
// });
224+
// }
225225

226226
constructor(
227227
supabase: SupabaseClient,

src/handlers/comment/handlers/issue/comment-scoring-rubric.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ContributorClassesKeys } from "./contribution-style-types";
88
import { FormatScoreConfig, FormatScoreConfigParams } from "./element-score-config";
99
import { Context } from "../../../../types/context";
1010

11-
export type Tags = keyof HTMLElementTagNameMap;
11+
type Tags = keyof HTMLElementTagNameMap;
1212

1313
const md = new MarkdownIt();
1414
const ZERO = new Decimal(0);

src/handlers/comment/handlers/issue/default-roles-scoring.ts

Lines changed: 0 additions & 81 deletions
This file was deleted.

src/handlers/comment/handlers/issue/evaluate-comments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export interface EnrichedRelevance {
6161
score: Decimal;
6262
}
6363

64-
export function enrichRelevanceData(
64+
function enrichRelevanceData(
6565
contributorComments: Comment[]
6666
): (value: Decimal, index: number, array: Decimal[]) => EnrichedRelevance {
6767
return (score, index) => ({

src/handlers/comment/handlers/issue/scoreSources.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,6 @@ interface ScoreParams {
118118
*
119119
*/
120120

121-
export function botCommandsAndHumanCommentsFilter(comment: Comment) {
121+
function botCommandsAndHumanCommentsFilter(comment: Comment) {
122122
return !comment.body.startsWith("/") /* No Commands */ && comment.user.type === "User";
123123
} /* No Bots */

0 commit comments

Comments
 (0)