diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-05 15:00:00 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-05 15:00:00 -0800 |
commit | 686113531d23f30e9973d659c456ae33eb9cff1f (patch) | |
tree | f225de7251a8b49b8d183dd168bab0a0addbe23f /lib/chef/audit | |
parent | d1cf34b059a16a81e0fc48de52ba29863bb41fe6 (diff) | |
download | chef-686113531d23f30e9973d659c456ae33eb9cff1f.tar.gz |
autofixing whitespace cops
4174 Style/SpaceInsideHashLiteralBraces
1860 Style/SpaceAroundOperators
1336 Style/SpaceInsideBlockBraces
1292 Style/AlignHash
997 Style/SpaceAfterComma
860 Style/SpaceAroundEqualsInParameterDefault
310 Style/EmptyLines
294 Style/IndentationConsistency
267 Style/TrailingWhitespace
238 Style/ExtraSpacing
212 Style/SpaceBeforeBlockBraces
166 Style/MultilineOperationIndentation
144 Style/TrailingBlankLines
120 Style/EmptyLineBetweenDefs
101 Style/IndentationWidth
82 Style/SpaceAroundBlockParameters
40 Style/EmptyLinesAroundMethodBody
29 Style/EmptyLinesAroundAccessModifier
1 Style/RescueEnsureAlignment
Diffstat (limited to 'lib/chef/audit')
-rw-r--r-- | lib/chef/audit/audit_reporter.rb | 4 | ||||
-rw-r--r-- | lib/chef/audit/control_group_data.rb | 9 | ||||
-rw-r--r-- | lib/chef/audit/logger.rb | 2 | ||||
-rw-r--r-- | lib/chef/audit/runner.rb | 1 |
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/chef/audit/audit_reporter.rb b/lib/chef/audit/audit_reporter.rb index e647f143ae..a40cae93dd 100644 --- a/lib/chef/audit/audit_reporter.rb +++ b/lib/chef/audit/audit_reporter.rb @@ -154,13 +154,13 @@ class Chef end def headers(additional_headers = {}) - options = {"X-Ops-Audit-Report-Protocol-Version" => PROTOCOL_VERSION} + options = { "X-Ops-Audit-Report-Protocol-Version" => PROTOCOL_VERSION } options.merge(additional_headers) end def encode_gzip(data) "".tap do |out| - Zlib::GzipWriter.wrap(StringIO.new(out)){|gz| gz << data } + Zlib::GzipWriter.wrap(StringIO.new(out)) { |gz| gz << data } end end diff --git a/lib/chef/audit/control_group_data.rb b/lib/chef/audit/control_group_data.rb index 688341adad..4dffbdf3dd 100644 --- a/lib/chef/audit/control_group_data.rb +++ b/lib/chef/audit/control_group_data.rb @@ -49,7 +49,7 @@ class Chef class ControlGroupData attr_reader :name, :status, :number_succeeded, :number_failed, :controls, :metadata - def initialize(name, metadata={}) + def initialize(name, metadata = {}) @status = "success" @controls = [] @number_succeeded = 0 @@ -58,7 +58,6 @@ class Chef @metadata = metadata end - def example_success(control_data) @number_succeeded += 1 control = create_control(control_data) @@ -80,7 +79,7 @@ class Chef def to_hash # We sort it so the examples appear in the output in the same order # they appeared in the recipe - controls.sort! {|x,y| x.line_number <=> y.line_number} + controls.sort! { |x, y| x.line_number <=> y.line_number } h = { :name => name, :status => status, @@ -105,7 +104,7 @@ class Chef group[:id] = SecureRandom.uuid group[:controls].collect!.with_index do |c, i| # i is zero-indexed, and we want the display one-indexed - c[:sequence_number] = i+1 + c[:sequence_number] = i + 1 c end group @@ -117,7 +116,7 @@ class Chef attr_reader :name, :resource_type, :resource_name, :context, :line_number attr_accessor :status, :details - def initialize(control_data={}) + def initialize(control_data = {}) control_data.each do |k, v| self.instance_variable_set("@#{k}", v) end diff --git a/lib/chef/audit/logger.rb b/lib/chef/audit/logger.rb index 9e1b779f5b..759683ccc8 100644 --- a/lib/chef/audit/logger.rb +++ b/lib/chef/audit/logger.rb @@ -20,7 +20,7 @@ require "stringio" class Chef class Audit class Logger - def self.puts(message="") + def self.puts(message = "") @buffer ||= StringIO.new @buffer.puts(message) diff --git a/lib/chef/audit/runner.rb b/lib/chef/audit/runner.rb index 561c50734c..100a72d2e1 100644 --- a/lib/chef/audit/runner.rb +++ b/lib/chef/audit/runner.rb @@ -52,6 +52,7 @@ class Chef end private + # Prepare to run audits: # - Require files # - Configure RSpec |