puppet-lint 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/puppet-lint.rb CHANGED
@@ -13,7 +13,7 @@ require 'puppet-lint/plugins'
13
13
  class PuppetLint::NoCodeError < StandardError; end
14
14
 
15
15
  class PuppetLint
16
- VERSION = '0.1.6'
16
+ VERSION = '0.1.7'
17
17
 
18
18
  attr_reader :code, :file
19
19
 
@@ -53,7 +53,7 @@ class PuppetLint::Plugins::CheckResources < PuppetLint::CheckPlugin
53
53
  if value_token.first == :NAME
54
54
  warn "unquoted file mode on line #{value_token.last[:line]}"
55
55
  end
56
- if value_token.last[:value] !~ /\d{4}/
56
+ if value_token.last[:value] !~ /\d{4}/ and value_token.first != :VARIABLE
57
57
  warn "mode should be represented as a 4 digit octal value on line #{value_token.last[:line]}"
58
58
  end
59
59
  elsif attr_token.first == :NAME and attr_token.last[:value] == 'ensure'
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.6'
3
+ s.version = '0.1.7'
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
@@ -21,6 +21,13 @@ describe PuppetLint::Plugins::CheckResources do
21
21
  its(:errors) { should be_empty }
22
22
  end
23
23
 
24
+ describe 'file mode as a variable' do
25
+ let(:code) { "file { 'foo': mode => $file_mode }" }
26
+
27
+ its(:warnings) { should be_empty }
28
+ its(:errors) { should be_empty }
29
+ end
30
+
24
31
  describe 'ensure as only attr in a single line resource' do
25
32
  let(:code) { "file { 'foo': ensure => present }" }
26
33
 
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
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: 2011-10-06 00:00:00 Z
18
+ date: 2011-10-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rspec