question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
escapedcatcommented, Dec 2, 2021

@CJKay uhm, good point, wanna open up an issue for that? Maybe this should be a setting?

1reaction
curly210102commented, Oct 1, 2021

@escapedcat OK, I’ll focus on it tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scoped (class) enums: fundamentals and examples - nextptr
Scoped enums are strongly scoped user-defined types. Enumerators of a scoped enum stay in the enum's scope and must be accessed through the ......
Read more >
The Java EE Tutorial - 23.8 Using Scopes
The conversation scope exists within developer-controlled boundaries that extend it across multiple requests for long-running conversations. All long-running ...
Read more >
C++ static code analysis: Scoped enumerations should be used
Unscoped enumerations have two major drawbacks that are fixed by scoped enumerations: enum elements are visible from their enclosing scope, instead of ...
Read more >
conventional commits - Commitlint - Allow '/' in scope-enum
In my Angular project, I want to extend @commitlint/config-conventional with some pre-defined scopes . The Angular project has a library for UI ...
Read more >
Scope of Variables In Java - GeeksforGeeks
Java programs are organized in the form of classes. Every class is part of some package. Java scope rules can be covered under...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found