Skip to content

Commit c571deb

Browse files
committed
refactor: hide barnacle triage helpers
1 parent 3967683 commit c571deb

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

scripts/github/barnacle-auto-response.mjs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Barnacle owns deterministic GitHub triage and auto-response behavior.
22

3-
export const activePrLimit = 10;
3+
const activePrLimit = 10;
44

55
const thirdPartyExtensionMessage =
66
"Please publish this as a third-party plugin on [ClawHub](https://clawhub.ai) instead of adding it to the core repo. Docs: https://docs.openclaw.ai/plugin and https://docs.openclaw.ai/tools/clawhub";
77

8-
export const rules = [
8+
const rules = [
99
{
1010
label: "r: skill",
1111
close: true,
@@ -159,7 +159,7 @@ export const candidateLabels = {
159159
externalPluginCandidate: "triage: external-plugin-candidate",
160160
};
161161

162-
export const bugSubtypeLabelSpecs = {
162+
const bugSubtypeLabelSpecs = {
163163
regression: {
164164
color: "D93F0B",
165165
description: "Behavior that previously worked and now fails",
@@ -251,15 +251,15 @@ const candidateActionRules = [
251251
const normalizeLogin = (login) => login.toLowerCase();
252252
const automationPrHeadPrefixes = ["clawsweeper/", "clownfish/"];
253253

254-
export function isAutomationPullRequest(pullRequest) {
254+
function isAutomationPullRequest(pullRequest) {
255255
const headRefName = pullRequest.headRefName ?? pullRequest.head?.ref ?? "";
256256
return (
257257
typeof headRefName === "string" &&
258258
automationPrHeadPrefixes.some((prefix) => headRefName.startsWith(prefix))
259259
);
260260
}
261261

262-
export function extractIssueFormValue(body, field) {
262+
function extractIssueFormValue(body, field) {
263263
if (!body) {
264264
return "";
265265
}
@@ -281,17 +281,17 @@ export function extractIssueFormValue(body, field) {
281281
return "";
282282
}
283283

284-
export function hasLinkedReference(text) {
284+
function hasLinkedReference(text) {
285285
return /(?:#\d+|github\.com\/openclaw\/openclaw\/(?:issues|pull)\/\d+)/i.test(text);
286286
}
287287

288-
export function hasFilledTemplateLine(body, field) {
288+
function hasFilledTemplateLine(body, field) {
289289
const escapedField = field.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
290290
const regex = new RegExp(`^\\s*-\\s*${escapedField}:\\s*\\S`, "im");
291291
return regex.test(body);
292292
}
293293

294-
export function hasMostlyBlankTemplate(body) {
294+
function hasMostlyBlankTemplate(body) {
295295
if (!body) {
296296
return true;
297297
}
@@ -332,7 +332,7 @@ function stripPullRequestTemplateBoilerplate(text) {
332332
);
333333
}
334334

335-
export function hasConcreteBehaviorContext(body, text) {
335+
function hasConcreteBehaviorContext(body, text) {
336336
if (hasLinkedReference(text)) {
337337
return true;
338338
}
@@ -349,7 +349,7 @@ export function hasConcreteBehaviorContext(body, text) {
349349
);
350350
}
351351

352-
export function hasClearDesignContext(body, text) {
352+
function hasClearDesignContext(body, text) {
353353
if (hasConcreteBehaviorContext(body, text)) {
354354
return true;
355355
}
@@ -359,15 +359,15 @@ export function hasClearDesignContext(body, text) {
359359
);
360360
}
361361

362-
export function isMarkdownOrDocsFile(filename) {
362+
function isMarkdownOrDocsFile(filename) {
363363
return (
364364
filename.startsWith("docs/") ||
365365
/\.mdx?$/i.test(filename) ||
366366
/(^|\/)(README|CHANGELOG|CONTRIBUTING|AGENTS|CLAUDE)\.md$/i.test(filename)
367367
);
368368
}
369369

370-
export function isTestLikeFile(filename) {
370+
function isTestLikeFile(filename) {
371371
return (
372372
/(^|\/)(__tests__|fixtures?|snapshots?)(\/|$)/i.test(filename) ||
373373
/(^|\/)test\/helpers\//i.test(filename) ||
@@ -377,7 +377,7 @@ export function isTestLikeFile(filename) {
377377
);
378378
}
379379

380-
export function isInfraLikeFile(filename) {
380+
function isInfraLikeFile(filename) {
381381
return (
382382
/^\.github\/(?:workflows|actions)\//.test(filename) ||
383383
filename.startsWith("scripts/") ||
@@ -390,7 +390,7 @@ export function isInfraLikeFile(filename) {
390390
);
391391
}
392392

393-
export function surfacesForFile(filename) {
393+
function surfacesForFile(filename) {
394394
const surfaces = new Set();
395395
if (/\.generated\/|generated|\.snap$/i.test(filename)) {
396396
surfaces.add("generated");

0 commit comments

Comments
 (0)