puppet-lint 0.1.13 → 0.2.0.pre1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +5 -0
- data/README.md +19 -5
- data/bin/puppet-lint +2 -0
- data/lib/puppet-lint.rb +2 -11
- data/lib/puppet-lint/configuration.rb +4 -0
- data/lib/puppet-lint/lexer.rb +244 -0
- data/lib/puppet-lint/plugin.rb +125 -54
- data/lib/puppet-lint/plugins/check_classes.rb +135 -49
- data/lib/puppet-lint/plugins/check_conditionals.rb +34 -23
- data/lib/puppet-lint/plugins/check_resources.rb +114 -28
- data/lib/puppet-lint/plugins/check_strings.rb +67 -79
- data/lib/puppet-lint/plugins/check_variables.rb +13 -18
- data/lib/puppet-lint/plugins/check_whitespace.rb +70 -40
- data/lib/puppet-lint/tasks/puppet-lint.rb +11 -3
- data/lib/puppet-lint/version.rb +3 -0
- data/puppet-lint.gemspec +8 -29
- data/spec/puppet-lint/check_classes_spec.rb +72 -23
- data/spec/puppet-lint/check_conditionals_spec.rb +19 -3
- data/spec/puppet-lint/check_resources_spec.rb +9 -16
- data/spec/puppet-lint/check_strings_spec.rb +94 -7
- data/spec/puppet-lint/check_variables_spec.rb +20 -10
- data/spec/puppet-lint/check_whitespace_spec.rb +13 -0
- data/spec/spec_helper.rb +15 -10
- metadata +30 -17
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'spec_helper'
|
2
3
|
|
3
4
|
describe PuppetLint::Plugins::CheckWhitespace do
|
@@ -74,6 +75,18 @@ describe PuppetLint::Plugins::CheckWhitespace do
|
|
74
75
|
its(:problems) { should be_empty }
|
75
76
|
end
|
76
77
|
|
78
|
+
|
79
|
+
describe 'length of lines with UTF-8 characters' do
|
80
|
+
let(:code) { "
|
81
|
+
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
82
|
+
# ┃ Configuration ┃
|
83
|
+
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛"
|
84
|
+
}
|
85
|
+
its(:problems) {
|
86
|
+
should be_empty
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
77
90
|
describe 'issue #37' do
|
78
91
|
let(:code) { "
|
79
92
|
class { 'lvs::base':
|
data/spec/spec_helper.rb
CHANGED
@@ -82,19 +82,24 @@ RSpec::Matchers.define :only_have_problem do |filter|
|
|
82
82
|
|
83
83
|
match do |actual|
|
84
84
|
res = filter_array_of_hashes(actual, filter)
|
85
|
-
res.length == actual.length
|
85
|
+
res.length == actual.length && res.length == 1
|
86
86
|
end
|
87
87
|
|
88
88
|
failure_message_for_should do |problems|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
89
|
+
filtered_problems = filter_array_of_hashes(actual, filter)
|
90
|
+
if filtered_problems.length > 1
|
91
|
+
message = "Multiple problems found matching the filter."
|
92
|
+
else
|
93
|
+
left = problems - filter_array_of_hashes(actual, filter)
|
94
|
+
message = "There were problems not matching filter."
|
95
|
+
message << "
|
96
|
+
* filter = #{filter.inspect}
|
97
|
+
* unmatched = [
|
98
|
+
"
|
99
|
+
left.each { |prob| message << " #{prob.inspect}," }
|
100
|
+
message << "
|
101
|
+
]"
|
102
|
+
end
|
98
103
|
message
|
99
104
|
end
|
100
105
|
|
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet-lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: -554294500
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
- pre
|
8
11
|
- 1
|
9
|
-
|
10
|
-
version: 0.1.13
|
12
|
+
version: 0.2.0.pre1
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- Tim Sharpe
|
@@ -15,7 +17,7 @@ autorequire:
|
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date: 2012-
|
20
|
+
date: 2012-07-11 00:00:00 +10:00
|
19
21
|
default_executable:
|
20
22
|
dependencies:
|
21
23
|
- !ruby/object:Gem::Dependency
|
@@ -57,24 +59,27 @@ extensions: []
|
|
57
59
|
extra_rdoc_files: []
|
58
60
|
|
59
61
|
files:
|
62
|
+
- .gitignore
|
60
63
|
- .travis.yml
|
61
|
-
- bin/puppet-lint
|
62
64
|
- Gemfile
|
65
|
+
- LICENSE
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- bin/puppet-lint
|
69
|
+
- lib/puppet-lint.rb
|
63
70
|
- lib/puppet-lint/configuration.rb
|
71
|
+
- lib/puppet-lint/lexer.rb
|
64
72
|
- lib/puppet-lint/plugin.rb
|
73
|
+
- lib/puppet-lint/plugins.rb
|
65
74
|
- lib/puppet-lint/plugins/check_classes.rb
|
66
75
|
- lib/puppet-lint/plugins/check_conditionals.rb
|
67
76
|
- lib/puppet-lint/plugins/check_resources.rb
|
68
77
|
- lib/puppet-lint/plugins/check_strings.rb
|
69
78
|
- lib/puppet-lint/plugins/check_variables.rb
|
70
79
|
- lib/puppet-lint/plugins/check_whitespace.rb
|
71
|
-
- lib/puppet-lint/plugins.rb
|
72
80
|
- lib/puppet-lint/tasks/puppet-lint.rb
|
73
|
-
- lib/puppet-lint.rb
|
74
|
-
- LICENSE
|
81
|
+
- lib/puppet-lint/version.rb
|
75
82
|
- puppet-lint.gemspec
|
76
|
-
- Rakefile
|
77
|
-
- README.md
|
78
83
|
- spec/puppet-lint/check_classes_spec.rb
|
79
84
|
- spec/puppet-lint/check_conditionals_spec.rb
|
80
85
|
- spec/puppet-lint/check_resources_spec.rb
|
@@ -103,12 +108,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
109
|
none: false
|
105
110
|
requirements:
|
106
|
-
- - "
|
111
|
+
- - ">"
|
107
112
|
- !ruby/object:Gem::Version
|
108
|
-
hash:
|
113
|
+
hash: 25
|
109
114
|
segments:
|
110
|
-
-
|
111
|
-
|
115
|
+
- 1
|
116
|
+
- 3
|
117
|
+
- 1
|
118
|
+
version: 1.3.1
|
112
119
|
requirements: []
|
113
120
|
|
114
121
|
rubyforge_project:
|
@@ -116,5 +123,11 @@ rubygems_version: 1.6.2
|
|
116
123
|
signing_key:
|
117
124
|
specification_version: 3
|
118
125
|
summary: Ensure your Puppet manifests conform with the Puppetlabs style guide
|
119
|
-
test_files:
|
120
|
-
|
126
|
+
test_files:
|
127
|
+
- spec/puppet-lint/check_classes_spec.rb
|
128
|
+
- spec/puppet-lint/check_conditionals_spec.rb
|
129
|
+
- spec/puppet-lint/check_resources_spec.rb
|
130
|
+
- spec/puppet-lint/check_strings_spec.rb
|
131
|
+
- spec/puppet-lint/check_variables_spec.rb
|
132
|
+
- spec/puppet-lint/check_whitespace_spec.rb
|
133
|
+
- spec/spec_helper.rb
|