puppet-lint 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/puppet-lint.rb CHANGED
@@ -5,7 +5,7 @@ require 'puppet'
5
5
  class PuppetLint::NoCodeError < StandardError; end
6
6
 
7
7
  class PuppetLint
8
- VERSION = '0.1.2'
8
+ VERSION = '0.1.3'
9
9
 
10
10
  attr_reader :code, :file
11
11
 
@@ -30,6 +30,13 @@ class PuppetLint::Plugins::CheckWhitespace < PuppetLint::CheckPlugin
30
30
  end
31
31
 
32
32
  # SHOULD align fat comma arrows (=>) within blocks of attributes
33
+ if in_selector
34
+ if line.strip =~ /\}[,;]?$/
35
+ in_selector = false
36
+ selector_indent_length = 0
37
+ end
38
+ end
39
+
33
40
  if line =~ /^( +\w+ +)=>/
34
41
  line_indent = $1
35
42
  if in_resource
data/puppet-lint.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'puppet-lint'
3
- s.version = '0.1.2'
3
+ s.version = '0.1.3'
4
4
  s.homepage = 'https://github.com/rodjek/puppet-lint/'
5
5
  s.summary = 'Ensure your Puppet manifests conform with the Puppetlabs style guide'
6
6
  s.description = 'Checks your Puppet manifests against the Puppetlabs
@@ -47,4 +47,18 @@ describe PuppetLint::Plugins::CheckWhitespace do
47
47
  its(:warnings) { should be_empty }
48
48
  its(:errors) { should be_empty }
49
49
  end
50
+
51
+ describe 'selector inside a resource' do
52
+ let(:code) { "
53
+ ensure => $ensure ? {
54
+ present => directory,
55
+ absent => undef,
56
+ },
57
+ owner => 'foo4',
58
+ group => 'foo4',
59
+ mode => '0755'," }
60
+
61
+ its(:warnings) { should be_empty }
62
+ its(:errors) { should be_empty }
63
+ end
50
64
  end
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: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tim Sharpe