@@ -18,6 +18,52 @@ To get started creating templates, take a look at the following resources.
1818 - [ Custom templates for dotnet new
1919] ( https://docs.microsoft.com/en-us/dotnet/core/tools/custom-templates )
2020
21+ ## Template analyzer
22+
23+ Sayed is working in his free time to create a tool that can be used to analyze .NET Core templates. You can install the analyzer with the command.
24+
25+ ``` bash
26+ > dotnet tool install --global sayedha.template.command
27+ ```
28+
29+ For usage info run ` templates -h ` .
30+
31+ After installing the tool you can invoke it by running ` templates ` in the command line. You can analyze templates that are stored in a local folder
32+ with the ` -f ` parameter. You can also analyze templates that are contained in a NuGet package (.nupkg) file with the ` -p ` switch.
33+
34+ For example to analyze a folder you would run.
35+
36+ ``` bash
37+ > templates -f < path-to-folder>
38+ ```
39+
40+ When you pass in a path, the tool will search the sub-folders to discover templates. If you are building several templates, you can pass
41+ in a parent folder that contains all the templates, and each template that is discovered will be analyzed.
42+
43+ ### What the tool looks for
44+
45+ Error if missing a required property
46+ - ` $.author ` ,
47+ - ` $.sourceName ` ,
48+ - ` $.classifications ` ,
49+ - ` $.identity ` ,
50+ - ` $.name ` ,
51+ - ` $.shortName ` ,
52+ - ` $.tags ` ,
53+ - ` $.tags.language ` ,
54+ - ` $.tags.type `
55+
56+ Warnings for missing recommended properties
57+ - ` $.defaultName ` ,
58+ - ` $.description ` ,
59+ - ` $.symbols ` ,
60+ - ` $.symbols.Framework ` ,
61+ - ` $.symbols.Framework.choices `
62+
63+ Error if ` $.tags.type ` is not set to either project or item
64+ Warning if ` $.symbols.Framework.type ` is not set to parameter.
65+ Warning if ` $.symbols.Framework.datatype ` is not set to choice.
66+
2167## How to enable cli templates in Visual Studio and Visual Studio for Mac
2268
2369The feature to show templates that are installed using the command-line interface (cli) is a preview feature. This feature is disabled by default.
0 commit comments