Skip to content

Commit 95ba6cb

Browse files
committed
chore(scripts): allow for shared scope
1 parent 28084ec commit 95ba6cb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/commit-scope-lint.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ const excludedFiles = ['.all-contributorsrc', 'README.md'] // Files that can be
1212

1313
const getCommitScope = () => {
1414
const commitMessage = fs.readFileSync(process.argv[3], 'utf8')
15-
const scope = commitMessage
16-
.substr(commitMessage.indexOf('('), commitMessage.indexOf(':') - commitMessage.indexOf('('))
17-
.replace(/(core)|(community)|(shared)|(util)|(-)|(\()|(\))/g, '')
15+
let scope = commitMessage.substr(
16+
commitMessage.indexOf('('),
17+
commitMessage.indexOf(':') - commitMessage.indexOf('(')
18+
)
19+
if (scope !== 'shared') {
20+
scope = scope.replace(/(core)|(community)|(shared)|(util)|(-)|(\()|(\))/g, '')
21+
}
1822

1923
return dotScopes[scope] || scope
2024
}

0 commit comments

Comments
 (0)