Open vlada-shubina opened 3 years ago
How does this fit in with @sayedihashimi 's tool?
One of the things we should validate for is the use of parens around complex conditions as discussed in #2209
How does this fit in with @sayedihashimi 's tool?
I think the idea is to have some similar validation, but it's built into dotnet new
instead of a stand alone tool.
The tool should accept multiple values for folder path/path to .nupkg
This is good, but in addition to this I think that when a folder path is specified, the tool should search the folder recursively for all templates. If a user is authoring a template pack (i.e. AWS/Uno/etc) they can pass the root folder to the validator and then it will discover all the templates that the folder contains.
I am cool with your thought process, @KathleenDollard . Seems worth the story points vs the other discussion.
The following was already done:
ITemplateValidator
and ITemplateValidatorFactory
implementations). Existing checks were reimplemented in this infrastructure. ITemplateValidator
and ITemplateValidatorFactory
are currently internal but ready to be made public once the feature is fully ready for release.validate
command) with no additional checks at the moment. It is possible to add additional checks by implementing ITemplateValidator
and ITemplateValidatorFactory
interfaces, adding them as additional component when loading host.Validate
) with no additional checks at the moment.The following tasks remain:
host.json
configuration
As a template author, I want a way to validate the templates, so that I can validate template before the publish. Audience: template authors
Background
The template configuration requires manual editing in of JSON configuration which is source of authoring mistakes. The configuration involves a lot of conditions, which are not validated in any way until the template is being generated. When grouping the templates the configuration is manually, and requires careful combination of the fields across multiple JSON files. The grouping errors are shown only when the template is being run (not when the package containing it is installed)
Planned validation checks:
(note: though some of the issues are closed, their comments contain suggested validation check)
name
parameter/symbolJustification
Technical details
We plan to expose 2 ways:
As part of this task, the validation in template engine and
dotnet new
should be improved as well.host.json
file.Feedback from @sayedihashimi