From f71818ea1edc7ba970c244b304b0a03c66fe472a Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Mon, 26 Apr 2021 20:14:31 +0200 Subject: [PATCH 1/2] feat: Create conventionalCommit.ts --- src/generate/conventionalCommit.ts | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/generate/conventionalCommit.ts diff --git a/src/generate/conventionalCommit.ts b/src/generate/conventionalCommit.ts new file mode 100644 index 00000000..0ca259b5 --- /dev/null +++ b/src/generate/conventionalCommit.ts @@ -0,0 +1,44 @@ +/** + * Conventional commit module. + * + * Categorize changes of a path using the Conventional Commit standard like `fix`. + * + * Here all as functions. But rewriting all as classes might be lower lift and okay. +* Maybe first pass it just rewriting class.method calls in tests (as a new test file) as function +calls with data. + */ + +import { CONVENTIONAL_TYPE } from "../src/lib/constants"; + +const CI_CRITERIA = { + dirs: { + // includes: [], + // startsWith: [], + equals: [ + ".circleci", + ".github/workflows", + ], + }, + // extensions: { + // equals: [], + // }, + names: { + includes: [ + "netlify.toml", + "travis.yml", + "tox.ini", + ], + // startsWith: [], + // equals: [], + }, +}; + +function related(criteria) { + return true; +} + +function main() { + if (related(CI_CRITERIA) === true) { + return CONVENTIONAL_TYPE.CI; + } +} From 1e66175614f024bdec7bb68fa237ffc7fc5323a4 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sun, 18 Jul 2021 12:20:17 +0200 Subject: [PATCH 2/2] fix: update conventionalCommit.ts --- src/generate/conventionalCommit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generate/conventionalCommit.ts b/src/generate/conventionalCommit.ts index 0ca259b5..47162087 100644 --- a/src/generate/conventionalCommit.ts +++ b/src/generate/conventionalCommit.ts @@ -8,7 +8,7 @@ calls with data. */ -import { CONVENTIONAL_TYPE } from "../src/lib/constants"; +import { CONVENTIONAL_TYPE } from "../lib/constants"; const CI_CRITERIA = { dirs: {