midscene/commitlint.config.js
Leyang 2589a9c4ca
docs(android): update android docs (#607)
* docs: release android automation

* chore(docs): update doubao docs

* chore(docs): merge docs for doubao

* docs(android): update

* docs(site): add more android case

* docs(site): update slogan and authors

* docs(site): android yaml

* docs(core): instruction for override config

* docs(core): update readme

* Update README.md

* docs(core): update readme

* docs(core): update readme

* docs(core): update readme

* docs(core): update readme

* docs(core): update README and blog for Android automation support

* docs(core): update android playground doc

* docs(core): enhance Android integration documentation with setup instructions

* docs(core): update android playground doc

* docs(core): update Android integration documentation and add setup instructions

* docs(core): update bridge mode title

* docs(core): update yaml docs

* docs(site): chore update

* docs(site): update YAML documentation with setup instructions and clarify parameters

* docs(core): update instructions

* chore: update docs

* chore: update bridge mode docs

* docs(site): translate to zh

* docs(site): translate error

* docs(site): remove unnecessary code block in YAML automation documentation

* docs(core): update blog

* docs(core): update instructions

* docs(core): update instructions

---------

Co-authored-by: yutao <yutao.tao@bytedance.com>
Co-authored-by: yuyutaotao <167746126+yuyutaotao@users.noreply.github.com>
2025-04-21 20:51:17 +08:00

48 lines
1.1 KiB
JavaScript

// commitlint.config.js
const fs = require('node:fs');
const path = require('node:path');
// read subdirectories of the directory
function getSubdirectories(dir) {
if (!fs.existsSync(dir)) return [];
return fs
.readdirSync(dir, { withFileTypes: true })
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name);
}
// get subdirectories of the directory
const appsScopes = getSubdirectories(path.join(__dirname, 'apps'));
const packagesScopes = getSubdirectories(path.join(__dirname, 'packages'));
// merge all scopes and remove duplicates
const allScopes = [
// basic scopes
'workflow',
'llm',
'playwright',
'puppeteer',
'mcp',
'bridge',
// automatically added scopes
...appsScopes,
...packagesScopes,
];
// remove duplicates
const uniqueScopes = [...new Set(allScopes)];
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-enum': [
2, // Level: Error
'always', // Apply rule always
uniqueScopes,
],
// Add rule to disallow empty scopes
'scope-empty': [2, 'never'],
},
};