Skip to content

Commit

Permalink
Add lib
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed Jul 21, 2015
1 parent e084c47 commit 57f18c0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions lib/puppet-lint/plugins/alias_parameter.rb
@@ -0,0 +1,17 @@
PuppetLint.new_check(:alias_parameter) do
def check
resource_indexes.each do |r|
r[:tokens].select do |t|
if t.type == :NAME && t.value == 'alias' && \
t.next_code_token && t.next_code_token.type == :FARROW
notify :warning, {
:message => "alias parameter used",
:line => t.line,
:column => t.column,
:token => t,
}
end
end
end
end
end
2 changes: 1 addition & 1 deletion spec/puppet-lint/plugins/alias_parameter_spec.rb
Expand Up @@ -31,7 +31,7 @@
end

it 'should create warnings' do
expect(problems).to contain_warning('alias parameter used').on_line(3).in_column(37)
expect(problems).to contain_warning('alias parameter used').on_line(3).in_column(11)
end
end
end

0 comments on commit 57f18c0

Please sign in to comment.