Skip to content

Commit e3e046b

Browse files
notlmnfregante
authored andcommitted
Add limit-commit-title-length feature (#2115)
1 parent e0fc47f commit e3e046b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

source/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ export const isQuickPR = (): boolean => isCompare() && /[?&]quick_pull=1(&|$)/.t
7272

7373
export const isReleasesOrTags = (): boolean => /^(releases|tags)/.test(getRepoPath()!);
7474

75+
export const isEditingFile = (): boolean => /^edit/.test(getRepoPath()!);
76+
7577
export const isRepo = (): boolean => /^[^/]+\/[^/]+/.test(getCleanPathname()) &&
7678
!reservedNames.includes(getOwnerAndRepo().ownerName) &&
7779
!isNotifications() &&

test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,3 +406,15 @@ test('isSingleTagPage', urlMatcherMacro, pageDetect.isSingleTagPage, [
406406
'https://github.com/sindresorhus/refined-github',
407407
'https://github.com/sindresorhus/refined-github/graphs'
408408
]);
409+
410+
test('isEditingFile', urlMatcherMacro, pageDetect.isEditingFile, [
411+
'https://github.com/sindresorhus/refined-github/edit/master/readme.md',
412+
'https://github.com/sindresorhus/refined-github/edit/ghe-injection/source/background.ts'
413+
], [
414+
'https://github.com/sindresorhus/refined-github',
415+
'https://github.com/sindresorhus/refined-github/pulls',
416+
'https://github.com/edit',
417+
'https://github.com/orgs/edit/dashboard',
418+
'https://github.com/sindresorhus/edit',
419+
'https://github.com/sindresorhus/refined-github/blob/master/edit.txt'
420+
]);

0 commit comments

Comments
 (0)