Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
asmundg committed Apr 13, 2021
1 parent 22ba0b6 commit 23dbb46
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/changefile/promptForChange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export async function promptForChange(options: BeachballOptions) {
const packageInfos = getPackageInfos(cwd);
const packageGroups = getPackageGroups(packageInfos, options.path, options.groups);

// Check recent commit messages for structured conventional
// commits. If present, and --useConventionalCommits is set, fetch
// change type and description from the first available commit
// message.
const fromConventionalCommits =
(options.useConventionalCommits &&
recentMessages.map(parseConventionalCommit).filter(<T>(obj: T | undefined): obj is T => !!obj)) ||
Expand Down Expand Up @@ -71,6 +75,7 @@ export async function promptForChange(options: BeachballOptions) {
},
};

// Only include structured commit messages that map to an allowed change type.
const allowedConventionalCommit = fromConventionalCommits.find((c) => !disallowedChangeTypes?.includes(c.type));
const showChangeTypePrompt = !options.type && !allowedConventionalCommit && changeTypePrompt.choices!.length > 1;

Expand Down

0 comments on commit 23dbb46

Please sign in to comment.