diff --git a/.git-hooks/commit-msg1 b/.git-hooks/commit-msg similarity index 100% rename from .git-hooks/commit-msg1 rename to .git-hooks/commit-msg diff --git a/commit-v.js b/commit-v.js deleted file mode 100644 index 9cadcb2e4..000000000 --- a/commit-v.js +++ /dev/null @@ -1,14 +0,0 @@ -import { execSync } from 'child_process'; - -const commitMessage = process.argv[2]; -console.log(process.argv); -if (commitMessage) { - // Проверяем, содержит ли сообщение коммита определенные ключевые слова - const isPatch = /^(fix|chore)/.test(commitMessage); // Например, если тип "fix" или "chore" - - if (isPatch) { - console.log('Обновление версии патча...'); - - execSync('cd src/front && npm version patch', { stdio: 'inherit' }); - } -} diff --git a/commitlint.config.js b/commitlint.config.js index c94a4fb25..362b26445 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,4 +1,3 @@ -import { execSync } from 'child_process'; export default { rules: { 'header-max-length': [2, 'always', 72], // Максимальная длина заголовка @@ -28,24 +27,6 @@ export default { Например: feat [X-01]: я тут накоммитил`, ]; - } else { - const isPatch = /^(fix|chore)/.test(header); // Например, если тип "fix" или "chore" - const command = { - feat: 'patch', - fix: 'patch', - docs: 'patch', - style: 'patch', - refactor: 'patch', - perf: 'patch', - test: 'patch', - chore: 'patch', - }; - console.log(command); - if (isPatch) { - console.log('Обновление версии патча...'); - - execSync('cd src/front && npm version patch', { stdio: 'inherit' }); - } } return [true]; }, diff --git a/eslint.config.mjs b/eslint.config.mjs index 3ba55f9dc..5133493a4 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -10,7 +10,7 @@ export default [ pluginJs.configs.recommended, ...pluginVue.configs["flat/essential"], {rules: { - 'no-console': 'warn', + 'no-console': 'error', }} ]; \ No newline at end of file diff --git a/sys/hooks/commit-msg b/sys/hooks/commit-msg new file mode 100644 index 000000000..4153db065 --- /dev/null +++ b/sys/hooks/commit-msg @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +npm run commitlint --edit ${1}