korekt-cli 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "korekt-cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "AI-powered code review CLI - Keep your kode korekt",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/git-logic.js CHANGED
@@ -48,6 +48,13 @@ export function normalizeRepoUrl(url) {
48
48
  return `https://gitlab.com/${user}/${repo}`;
49
49
  }
50
50
 
51
+ // Handle Bitbucket SSH format: git@bitbucket.org:user/repo.git
52
+ const bitbucketSshMatch = url.match(/git@bitbucket\.org:([^/]+)\/(.+?)(?:\.git)?$/);
53
+ if (bitbucketSshMatch) {
54
+ const [, user, repo] = bitbucketSshMatch;
55
+ return `https://bitbucket.org/${user}/${repo}`;
56
+ }
57
+
51
58
  // If already HTTPS or other format, return as-is (possibly removing .git suffix)
52
59
  return url.replace(/\.git$/, '');
53
60
  }
@@ -457,6 +457,18 @@ describe('normalizeRepoUrl', () => {
457
457
  expect(normalizeRepoUrl(sshUrl)).toBe(expected);
458
458
  });
459
459
 
460
+ it('should normalize Bitbucket SSH URL to HTTPS', () => {
461
+ const sshUrl = 'git@bitbucket.org:user/repo.git';
462
+ const expected = 'https://bitbucket.org/user/repo';
463
+ expect(normalizeRepoUrl(sshUrl)).toBe(expected);
464
+ });
465
+
466
+ it('should normalize Bitbucket SSH URL without .git suffix', () => {
467
+ const sshUrl = 'git@bitbucket.org:user/repo';
468
+ const expected = 'https://bitbucket.org/user/repo';
469
+ expect(normalizeRepoUrl(sshUrl)).toBe(expected);
470
+ });
471
+
460
472
  it('should remove .git suffix from HTTPS URLs', () => {
461
473
  const httpsUrl = 'https://github.com/user/repo.git';
462
474
  const expected = 'https://github.com/user/repo';