|
@@ -1,107 +0,0 @@
|
|
|
-const fs = require('fs');
|
|
|
-const path = require('path');
|
|
|
-const { execSync } = require('child_process');
|
|
|
-
|
|
|
-const scopes = fs
|
|
|
- .readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true })
|
|
|
- .filter((dirent) => dirent.isDirectory())
|
|
|
- .map((dirent) => dirent.name.replace(/s$/, ''));
|
|
|
-
|
|
|
-
|
|
|
-const scopeComplete = execSync('git status --porcelain || true')
|
|
|
- .toString()
|
|
|
- .trim()
|
|
|
- .split('\n')
|
|
|
- .find((r) => ~r.indexOf('M src'))
|
|
|
- ?.replace(/(\/)/g, '%%')
|
|
|
- ?.match(/src%%((\w|-)*)/)?.[1]
|
|
|
- ?.replace(/s$/, '');
|
|
|
-
|
|
|
-
|
|
|
-module.exports = {
|
|
|
- ignores: [(commit) => commit.includes('init')],
|
|
|
- extends: ['@commitlint/config-conventional'],
|
|
|
- rules: {
|
|
|
- 'body-leading-blank': [2, 'always'],
|
|
|
- 'footer-leading-blank': [1, 'always'],
|
|
|
- 'header-max-length': [2, 'always', 108],
|
|
|
- 'subject-empty': [2, 'never'],
|
|
|
- 'type-empty': [2, 'never'],
|
|
|
- 'subject-case': [0],
|
|
|
- 'type-enum': [
|
|
|
- 2,
|
|
|
- 'always',
|
|
|
- [
|
|
|
- 'feat',
|
|
|
- 'fix',
|
|
|
- 'perf',
|
|
|
- 'style',
|
|
|
- 'docs',
|
|
|
- 'test',
|
|
|
- 'refactor',
|
|
|
- 'build',
|
|
|
- 'ci',
|
|
|
- 'chore',
|
|
|
- 'revert',
|
|
|
- 'wip',
|
|
|
- 'workflow',
|
|
|
- 'types',
|
|
|
- 'release',
|
|
|
- ],
|
|
|
- ],
|
|
|
- },
|
|
|
- prompt: {
|
|
|
-
|
|
|
- alias: {
|
|
|
- f: 'docs: fix typos',
|
|
|
- r: 'docs: update README',
|
|
|
- s: 'style: update code format',
|
|
|
- b: 'build: bump dependencies',
|
|
|
- c: 'chore: update config',
|
|
|
- },
|
|
|
- customScopesAlign: !scopeComplete ? 'top' : 'bottom',
|
|
|
- defaultScope: scopeComplete,
|
|
|
- scopes: [...scopes, 'mock'],
|
|
|
- allowEmptyIssuePrefixs: false,
|
|
|
- allowCustomIssuePrefixs: false,
|
|
|
-
|
|
|
-
|
|
|
- typesAppend: [
|
|
|
- { value: 'wip', name: 'wip: work in process' },
|
|
|
- { value: 'workflow', name: 'workflow: workflow improvements' },
|
|
|
- { value: 'types', name: 'types: type definition file changes' },
|
|
|
- ],
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
-};
|