File tree 3 files changed +20
-0
lines changed 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,10 @@ def self.build(args = [])
128
128
PuppetLint . configuration . ignore_paths = paths . split ( ',' )
129
129
end
130
130
131
+ opts . on ( '--top-scope-variables VARS' , 'A comma separated list of allowed top scope variables' ) do |vars |
132
+ PuppetLint . configuration . top_scope_variables = vars . split ( ',' )
133
+ end
134
+
131
135
PuppetLint . configuration . checks . each do |check |
132
136
opts . on ( "--no-#{ check } -check" , "Skip the #{ check } check." ) do
133
137
PuppetLint . configuration . send ( :"disable_#{ check } " )
Original file line number Diff line number Diff line change
1
+ # foo
2
+ define test::top_scope_variables () {
3
+ notice ($role )
4
+ }
Original file line number Diff line number Diff line change @@ -121,6 +121,18 @@ def initialize(args)
121
121
its ( :stdout ) { is_expected . to eq ( '' ) }
122
122
end
123
123
124
+ context 'when passed top scope variables option' do
125
+ let ( :args ) do
126
+ [
127
+ '--top-scope-variables=role' ,
128
+ 'spec/fixtures/test/manifests/top_scope_variables.pp' ,
129
+ ]
130
+ end
131
+
132
+ its ( :exitstatus ) { is_expected . to eq ( 0 ) }
133
+ its ( :stdout ) { is_expected . to eq ( '' ) }
134
+ end
135
+
124
136
context 'when limited to errors only' do
125
137
let ( :args ) do
126
138
[
You can’t perform that action at this time.
0 commit comments