Skip to content

Scope: ability to select multiple scopes since the rule scope-enum allows multiple values.  #2782

Closed
@frederikdekegel

Description

@frederikdekegel

When using the rule scope-enum, @commitlint/prompt and @commitlint/cz-commitlint render the question as a list from which only one answer can be selected.
However, the rule scope-enum allows multiple values separated with a comma, back slash and/or forward slash

Expected Behavior

If the rule scope-enum is found in the config, the type of the question should be "checkbox" so multiple values can be selected.

Current Behavior

if the rule scope-enum is found in the config, the type of the question is "list" and only one value can be selected.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

From what I understand "inquirer" is used to render the question. So if the rule scope-enum is found in the config, the type of the question should be "checkbox".

Steps to Reproduce (for bugs)

  1. Add scope-enum as a rule in the rules section of the commitlint config.
  2. Use @commitlint/prompt or @commitlint/cz-commitlint to render the question

Context

No being able to select multiple values for scope, forced me to duplicate the rule scope-enum and name it scope-choice so that the question is rendered as a question of type "text" instead of "list".

Your Environment

Executable Version
commitlint --version 13.2.0
git --version 2.31.0
node --version 14.17.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions