UNPKG

@elsikora/git-branch-lint

Version:
27 lines (26 loc) 1.15 kB
import type { IBranchLintConfig } from "../../domain/type/config.type"; import { BranchTemplatePolicy } from "../../domain/policy/branch-template.policy"; /** * Use case for linting branch names */ export declare class LintBranchNameUseCase { private readonly BRANCH_TEMPLATE_POLICY; constructor(branchTemplatePolicy?: BranchTemplatePolicy); /** * Execute the use case * @param branchName The branch name to lint * @param config The branch configuration * @throws {ProhibitedBranchError} When branch name is prohibited * @throws {PatternMatchError} When branch name doesn't match pattern * @throws {BranchTooShortError} When branch name is shorter than the minimum length * @throws {BranchTooLongError} When branch name is longer than the maximum length */ execute(branchName: string, config: IBranchLintConfig): void; /** * Validate the branch name against the pattern * @param branchName The branch name to validate * @param config The branch configuration * @throws {PatternMatchError} When branch name doesn't match pattern */ private validatePattern; }