puppet-lint 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/bin/puppet-lint CHANGED
@@ -17,6 +17,7 @@ require 'optparse'
17
17
  require 'rubygems'
18
18
  require 'puppet-lint'
19
19
 
20
+ options = {}
20
21
  opts = OptionParser.new do |opts|
21
22
  opts.banner = help
22
23
 
@@ -24,6 +25,10 @@ opts = OptionParser.new do |opts|
24
25
  puts "Puppet-lint " + PuppetLint::VERSION
25
26
  exit 0
26
27
  end
28
+
29
+ opts.on("--fail-on-warnings", "Return a non-zero exit status for warnings.") do
30
+ options[:fail_on_warnings] = true
31
+ end
27
32
  end
28
33
 
29
34
  # Read command line options into `options` hash
@@ -45,6 +50,10 @@ begin
45
50
  l = PuppetLint.new
46
51
  l.file = ARGV[0]
47
52
  l.run
53
+
54
+ if l.errors? or (l.warnings? and options[:fail_on_warnings])
55
+ exit 1
56
+ end
48
57
  rescue PuppetLint::NoCodeError
49
58
  puts "puppet-lint: no file specified or specified file does not exist"
50
59
  puts "puppet-lint: try 'puppet-lint --help' for more information"
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.4'
8
+ VERSION = '0.1.5'
9
9
 
10
10
  attr_reader :code, :file
11
11
 
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.4'
3
+ s.version = '0.1.5'
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
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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
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-09-09 00:00:00 Z
18
+ date: 2011-10-04 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rspec