dotnet / dotnet/templating

Improve documentation on default value forms

Open
#9,057 0 comments 1 reaction 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

The article https://github.com/dotnet/templating/wiki/Naming-and-default-value-forms is misleading in at least two ways:

1. The convention on the naming of `sourceName` is *much* more rigid than what is implied by the wording in the article. Specifically, using uppercase, lowercase, the `.` character and the numeric character `1` are all absolutely critical for controlling which exact value form is applied (as discussed in https://github.com/dotnet/templating/issues/2532#issuecomment-823350366).

The article states "A good choice for `sourceName` is the value that produces distinct values under the below transformations, for example `Template.1`". This is more than just a "good choice", it is actually the exact way you need to use it! The above linked issue was closed as not planned but I have validated all recommendations still hold today and the number of open issues and past discussions suggests confusion still prevails around default value forms, e.g. https://github.com/dotnet/templating/issues/6853

2. Although it describes the convention and the possible default value forms, the article fails to mention they are all actually accessible as built-in value transforms in the templating engine! There is a link for the article on creating new value transforms, but even more useful would be to know which ones exist in the first place.

For example, one option would be using the actual form identifiers in the table, or add an explicit column with the identifiers, e.g.:

- `identity`
- `safe_namespace`
- `safe_name`
- `lower_safe_namespace`
- `lower_safe_name`

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.