Required and optional scope-enum
See original GitHub issueExpected Behavior
Hello everyone and thanks for your hard work! I recently faced a use-case and I’m not sure if my idea is achievable with the current implementation.
I’m working on a no-managed legacy mono-repo where every single folder is a project.
I would really like to set some rules that somehow enforce:
- no empty scopes in order to always have in the git history the reference to the edited project (
scope-empty
) ✅ - set the possible scopes (
scope-enum
which already supports multiple scopes) ✅ - set which one is required and which one is not (e.g I may want to highlight in the scope the project but also what has been done
feat(project-a, docs): ...
. It would be also ok to just specify the project as scopefeat(project-a): ...
, butfeat(docs): ...
should not be valid) 🤔
Current Behavior
"rules": {
"scope-empty": [2, "never"],
"scope-enum": [2, "always", [
"project-a",
"project-b",
"api",
"docs",
...,
]
]
}
Affected packages
- cli
- core
- prompt
- config-angular
Possible Solution
"rules": {
"scope-empty": [2, "never"],
"scope-enum": [2, "always", [
"project-a",
"project-b",
"api",
"docs"
]
],
// No more than one of...
"scope-required-enum": [2, "always", [
"project-a",
"project-b"
]
],
"scope-optional-enum": [1, "always", [
"api",
"docs"
]
]
}
Does it makes sense to you? Would it be probably better to create a plugin like selective-scope
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
Enumeration declaration - cppreference.com
3) Opaque enum declaration for an unscoped enumeration must specify the name and the underlying type. Each enumerator becomes a named constant ...
Read more >strongly typed enum - `class` keyword optional? - Stack Overflow
What you call "strongly typed enum" is really named scoped enumerations, and for those the class or struct keyword is mandatory.
Read more >C enumeration declarations | Microsoft Learn
An enumeration type declaration gives the name of the (optional) enumeration tag. And, it defines the set of named integer identifiers (called ...
Read more >enumeration declaration - cppreference.com
Unscoped enumeration Each enumerator becomes a named constant of the enumeration's type (that is, name), visible in the enclosing scope, and can be...
Read more >Allow per-type scope-enum · Issue #395 - GitHub
I'd like to limit the valid scopes on a per-type basis. For example, the docs type should accept all and each of my...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think my use-case is very specific so I will leave my solution here just here for the moment. Thanks for the help in the meanwhile! Stay safe!
Only a suggestion if you want to do that.