@@ -66,18 +66,29 @@ interface Settings {
6666// file
6767interface CloudFormationLintSettings {
6868 path : string ;
69+ appendRules : Array < string > ;
70+ ignoreRules : Array < string > ;
71+ overrideSpecPath : string ;
6972}
7073
71- // hold the Path setting
74+ // hold the Settings
7275let Path : string ;
76+ let AppendRules : Array < string > ;
77+ let IgnoreRules : Array < string > ;
78+ let OverrideSpecPath : string ;
79+
7380// The settings have changed. Is send on server activation as well.
7481connection . onDidChangeConfiguration ( ( change ) => {
7582 console . log ( 'Settings have been updated...' ) ;
7683 let settings = < Settings > change . settings ;
77- console . log ( 'Settings: ' + settings ) ;
84+ console . log ( 'Settings: ' + JSON . stringify ( settings ) ) ;
85+
7886 Path = settings . cfnLint . path || 'cfn-lint' ;
87+ IgnoreRules = settings . cfnLint . ignoreRules ;
88+ OverrideSpecPath = settings . cfnLint . overrideSpecPath ;
89+ AppendRules = settings . cfnLint . appendRules ;
90+
7991 // Revalidate any open text documents
80- console . log ( 'Path set to: ' + Path ) ;
8192 documents . all ( ) . forEach ( validateCloudFormationFile ) ;
8293} ) ;
8394
@@ -122,6 +133,26 @@ function validateCloudFormationFile(document: TextDocument): void {
122133 if ( is_cfn ) {
123134 let args = [ '--format' , 'json' , '--template' , file_to_lint ] ;
124135
136+ if ( IgnoreRules . length > 0 ) {
137+ args . push ( '--ignore-checks' )
138+
139+ for ( var ignoreRule of IgnoreRules ) {
140+ args . push ( ignoreRule )
141+ }
142+ }
143+
144+ if ( AppendRules . length > 0 ) {
145+ args . push ( '--append-rules' )
146+
147+ for ( var appendRule of AppendRules ) {
148+ args . push ( appendRule )
149+ }
150+ }
151+
152+ if ( OverrideSpecPath !== "" ) {
153+ args . push ( '--override-spec' , OverrideSpecPath )
154+ }
155+
125156 connection . console . log ( `running............. ${ Path } ${ args } ` ) ;
126157
127158 let child = spawn (
0 commit comments