Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/branch-utilities/src/lib/base.utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ describe('base utils', () => {

expect(parseBranchName('#72- whatever').branchId).toBe(72)
expect(parseBranchName('feature/#72-ok').branchId).toBe(72)
expect(parseBranchName('1-foobar')).toEqual({ branchId: 1, branchName: 'foobar' } satisfies ReturnType<
typeof parseBranchName
>)
expect(parseBranchName('feat/42-foo-bar-baz')).toEqual({
branchId: 42,
branchName: 'foo-bar-baz',
} satisfies ReturnType<typeof parseBranchName>)
expect(parseBranchName('007-oh-james')).toEqual({ branchId: 7, branchName: 'oh-james' } satisfies ReturnType<
typeof parseBranchName
>)
})

test('works for github copilot created branches', () => {
Expand All @@ -107,7 +117,6 @@ describe('base utils', () => {

test('throws when invalid pattern', () => {
expect(() => parseBranchName('whrjwe')).toThrow()
expect(() => parseBranchName('copilot/123-fix')).toThrow()
expect(() => parseBranchName('feat/copilot/fix-123')).toThrow()
})
})
Expand Down
2 changes: 1 addition & 1 deletion packages/branch-utilities/src/lib/base.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const REGEX_MAIN = /^main$/
* @example #123-my-feature -> { id: '123', name: 'my-feature' }
* @example feature/#456-yanr -> { id: '456', name: 'yanr' }
*/
const REGEX_BRANCH_NAME_DEFAULT = /^[a-z]*\/?#(?<id>\d+)-(?<name>.*)$/
const REGEX_BRANCH_NAME_DEFAULT = /^[a-z]*\/?#?(?<id>\d+)-(?<name>.*)$/
Comment thread
mumenthalers marked this conversation as resolved.
Outdated
Comment thread
Copilot marked this conversation as resolved.
Outdated
/**
* regex to match the branch convention github copilot uses with the following named capture groups: id, name
* @example copilot/fix-789 -> { id: '789', name: 'fix' }
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-recommended/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"angular-eslint": "^20.5.1"
},
"peerDependencies": {
"angular-eslint": "^20.5.1 || ^21.0.0"
"angular-eslint": "^20.5.1 || ^21.0.0 || ^22.0.0"
Comment thread
mumenthalers marked this conversation as resolved.
Outdated
},
"peerDependenciesMeta": {
"angular-eslint": {
Expand Down
Loading