1
+ //
2
+ // Copyright (c) Microsoft Corporation.
3
+ //
4
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
6
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
7
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
9
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
10
+ // THE SOFTWARE.
11
+ //
12
+
13
+ using System ;
14
+ using System . Collections . Generic ;
15
+ using System . Linq ;
16
+ using System . Management . Automation . Language ;
17
+ using Microsoft . Windows . Powershell . ScriptAnalyzer . Generic ;
18
+ using System . ComponentModel . Composition ;
19
+ using System . Globalization ;
20
+
21
+ namespace Microsoft . Windows . Powershell . ScriptAnalyzer . BuiltinRules
22
+ {
23
+ /// <summary>
24
+ /// DscExamplesExist: Checks that DSC examples for given resource are present
25
+ /// </summary>
26
+ [ Export ( typeof ( IDSCResourceRule ) ) ]
27
+ public class DscExamplesPresent : IDSCResourceRule
28
+ {
29
+ /// <summary>
30
+ /// AnalyzeDSCResource: Analyzes given DSC Resource
31
+ /// </summary>
32
+ /// <param name="ast">The script's ast</param>
33
+ /// <param name="fileName">The name of the script file being analyzed</param>
34
+ /// <returns>The results of the analysis</returns>
35
+ public IEnumerable < DiagnosticRecord > AnalyzeDSCResource ( Ast ast , string fileName )
36
+ {
37
+
38
+ }
39
+
40
+ /// <summary>
41
+ /// AnalyzeDSCClass: Analyzes given DSC class
42
+ /// </summary>
43
+ /// <param name="ast"></param>
44
+ /// <param name="fileName"></param>
45
+ /// <returns></returns>
46
+ public IEnumerable < DiagnosticRecord > AnalyzeDSCClass ( Ast ast , string fileName )
47
+ {
48
+
49
+ }
50
+
51
+
52
+ /// <summary>
53
+ /// GetName: Retrieves the name of this rule.
54
+ /// </summary>
55
+ /// <returns>The name of this rule</returns>
56
+ public string GetName ( )
57
+ {
58
+ return string . Format ( CultureInfo . CurrentCulture , Strings . NameSpaceFormat , GetSourceName ( ) , Strings . DscExamplesPresent ) ;
59
+ }
60
+
61
+ /// <summary>
62
+ /// GetCommonName: Retrieves the Common name of this rule.
63
+ /// </summary>
64
+ /// <returns>The common name of this rule</returns>
65
+ public string GetCommonName ( )
66
+ {
67
+ return string . Format ( CultureInfo . CurrentCulture , Strings . DscExamplesPresentCommonName ) ;
68
+ }
69
+
70
+ /// <summary>
71
+ /// GetDescription: Retrieves the description of this rule.
72
+ /// </summary>
73
+ /// <returns>The description of this rule</returns>
74
+ public string GetDescription ( )
75
+ {
76
+ return string . Format ( CultureInfo . CurrentCulture , Strings . DscExamplesPresentDescription ) ;
77
+ }
78
+
79
+ /// <summary>
80
+ /// GetSourceType: Retrieves the type of the rule: builtin, managed or module.
81
+ /// </summary>
82
+ public SourceType GetSourceType ( )
83
+ {
84
+ return SourceType . Builtin ;
85
+ }
86
+
87
+ /// <summary>
88
+ /// GetSeverity: Retrieves the severity of the rule: error, warning or information.
89
+ /// </summary>
90
+ /// <returns></returns>
91
+ public RuleSeverity GetSeverity ( )
92
+ {
93
+ return RuleSeverity . Information ;
94
+ }
95
+
96
+ /// <summary>
97
+ /// GetSourceName: Retrieves the module/assembly name the rule is from.
98
+ /// </summary>
99
+ public string GetSourceName ( )
100
+ {
101
+ return string . Format ( CultureInfo . CurrentCulture , Strings . DSCSourceName ) ;
102
+ }
103
+ }
104
+
105
+ }
0 commit comments