dotnet / dotnet/templating

Request to support snake case as a value form

Open
#8,302 1 comment 2 reactions 0 assignees View on GitHub
triage:transfer-to-sdk
Dominant language
No language data
Stars
1.7k
Forks
399
Avg merge
3d 5h
Merged PRs (30d)
39

Description

### Is your feature request related to a problem? Please describe.

I'm working on a template for an ASP.NET gRPC project. The template includes ".proto" files with package names using snake_case, such as `package my_greeter`. I would like to be able to replace this with another symbol when generating a project using `dotnet new`.

I can see that [Value Forms](https://github.com/dotnet/templating/wiki/Value-Forms) might be able to help with my use case, but it does not currently support snake case. Please consider my request to add snake case as a value form.

### Describe the solution you'd like.

Add a new [Value Form](https://github.com/dotnet/templating/wiki/Value-Forms) to support snake_case, for instance:

`snakeCase` - Converts the value to snake case using the casing rules of the invariant culture.

```json
"forms": {
"snake": {
"identifier": "snakeCase"
}
}
```

I believe this could be implemented in a similar way to `kebabCase` as per [KebabCaseValueFormFactory](https://github.com/dotnet/templating/blob/main/src/Microsoft.TemplateEngine.Orchestrator.RunnableProjects/ValueForms/KebabCaseValueFormFactory.cs).

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.