auto-commit-msg icon indicating copy to clipboard operation
auto-commit-msg copied to clipboard

Add scope

Open MichaelCurrin opened this issue 3 years ago • 0 comments

WIP code

// too much refactor is needed in prepareCommitMsg to use a scope variable
// so just add to type for now


getScope() {
    if (this.isPackageRelated()) {
        return CONVENTIONAL_SCOPE.DEPENDENCIES
    }

    return CONVENTIONAL_SCOPE.UNKNOWN

    export function preparePrefix(
        type: CONVENTIONAL_TYPE,
        scope: CONVENTIONAL_SCOPE
    ) {
        return `${type}(${scope})`;
    }




    /**
     * Conventional commit scopes.
     *
     * See convention-commits.md doc for more info.
     */
    export enum CONVENTIONAL_SCOPE {
        DEPENDENCIES = "deps",
        UNKNOWN = "",
    }

MichaelCurrin avatar Feb 27 '22 12:02 MichaelCurrin