Skip to content

Commit 8f96f78

Browse files
committed
feature-296-bugbot-autofix: Remove unused FileRepository and related utility functions, along with associated tests, to streamline the codebase. Update constants and logger by removing deprecated code. This cleanup enhances maintainability and reduces complexity.
1 parent 2c67a55 commit 8f96f78

7 files changed

Lines changed: 0 additions & 270 deletions

File tree

src/data/repository/file_repository.ts

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

src/utils/__tests__/file_utils.test.ts

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

src/utils/__tests__/title_utils.test.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
extractIssueNumberFromBranch,
33
extractIssueNumberFromPush,
4-
extractVersionFromBranch,
54
} from '../title_utils';
65

76
jest.mock('../logger', () => ({
@@ -38,22 +37,4 @@ describe('title_utils', () => {
3837
expect(extractIssueNumberFromPush('release/1.0.0')).toBe(-1);
3938
});
4039
});
41-
42-
describe('extractVersionFromBranch', () => {
43-
it('extracts version from branch name ending with x.y.z', () => {
44-
expect(extractVersionFromBranch('release/1.2.3')).toBe('1.2.3');
45-
expect(extractVersionFromBranch('hotfix/2.0.0')).toBe('2.0.0');
46-
});
47-
48-
it('returns undefined when no version in branch', () => {
49-
expect(extractVersionFromBranch('release/next')).toBeUndefined();
50-
expect(extractVersionFromBranch('main')).toBeUndefined();
51-
});
52-
53-
it('handles undefined or empty branch', () => {
54-
expect(extractVersionFromBranch('')).toBeUndefined();
55-
expect(extractVersionFromBranch(undefined as unknown as string)).toBeUndefined();
56-
});
57-
});
58-
5940
});

src/utils/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export const TITLE = 'Copilot'
2-
export const REPO_URL = 'https://github.com/vypdev/copilot'
32

43
/** Default OpenCode model: provider/modelID (e.g. opencode/kimi-k2.5-free). Reuse for CLI, action and Ai fallbacks. */
54
export const OPENCODE_DEFAULT_MODEL = 'opencode/kimi-k2.5-free'

src/utils/file_utils.ts

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

src/utils/logger.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import readline from 'readline';
2-
31
let loggerDebug = false;
42
let loggerRemote = false;
53
let structuredLogging = false;
@@ -102,13 +100,3 @@ export function logDebugError(message: unknown) {
102100
logError(message);
103101
}
104102
}
105-
106-
export function logSingleLine(message: string) {
107-
if (loggerRemote) {
108-
console.log(message);
109-
return;
110-
}
111-
readline.clearLine(process.stdout, 0);
112-
readline.cursorTo(process.stdout, 0);
113-
process.stdout.write(message);
114-
}

src/utils/title_utils.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,3 @@ export const extractIssueNumberFromPush = (branchName: string): number => {
2222
logDebugInfo(`Linked Issue: #${issueNumber}`);
2323
return issueNumber;
2424
}
25-
26-
export const extractVersionFromBranch = (branchName: string): string | undefined => {
27-
const match = branchName?.match(/^[^/]+\/(\d+\.\d+\.\d+)$/);
28-
29-
if (match) {
30-
return match[1];
31-
} else {
32-
logDebugInfo('No version found in the branch name.');
33-
return undefined;
34-
}
35-
};
36-

0 commit comments

Comments
 (0)