puppet-lint 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -72,7 +72,7 @@ class PuppetLint::Plugins::CheckClasses < PuppetLint::CheckPlugin
|
|
72
72
|
class_tokens = tokens[class_idx[:start]..class_idx[:end]]
|
73
73
|
inherits_idx = class_tokens.index { |r| r.type == :INHERITS }
|
74
74
|
unless inherits_idx.nil?
|
75
|
-
inherited_class_token =
|
75
|
+
inherited_class_token = class_tokens[inherits_idx].next_code_token
|
76
76
|
if inherited_class_token.value.end_with? '::params'
|
77
77
|
notify :warning, {
|
78
78
|
:message => 'class inheriting from params class',
|
data/lib/puppet-lint/version.rb
CHANGED
@@ -2,14 +2,17 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'class_inherits_from_params_class' do
|
4
4
|
describe 'parameterised class that inherits from a params class' do
|
5
|
-
let(:code) { "
|
5
|
+
let(:code) { "
|
6
|
+
# commented
|
7
|
+
class foo($bar = $name) inherits foo::params { }"
|
8
|
+
}
|
6
9
|
|
7
10
|
its(:problems) {
|
8
11
|
should have_problem({
|
9
12
|
:kind => :warning,
|
10
13
|
:message => "class inheriting from params class",
|
11
|
-
:linenumber =>
|
12
|
-
:column =>
|
14
|
+
:linenumber => 3,
|
15
|
+
:column => 40,
|
13
16
|
})
|
14
17
|
should_not have_problem :kind => :error
|
15
18
|
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tim Sharpe
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-09-
|
18
|
+
date: 2012-09-26 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|