Skip to content

Commit

Permalink
Merge pull request #32 from DavidS/rubocop-0.53.0
Browse files Browse the repository at this point in the history
Update to rubocop 0.53.0
  • Loading branch information
da-ar authored Mar 6, 2018
2 parents fb825be + 0fd5b40 commit 6818dab
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 12 deletions.
27 changes: 23 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ Style/TrailingCommaInArguments:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/TrailingCommaInLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs,
and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/SymbolArray:
Description: Using percent style obscures symbolic intent of array's contents.
EnforcedStyle: brackets
Expand Down Expand Up @@ -135,3 +131,26 @@ Style/BracesAroundHashParameters:
# see http://www.virtuouscode.com/2016/01/06/about-the-ruby-squiggly-heredoc-syntax/
Layout/IndentHeredoc:
Enabled: false

# Updated in 0.53 (or thereabouts)
Style/TrailingCommaInArrayLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs,
and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs,
and re-ordering nicer.
EnforcedStyleForMultiline: comma

# Add allowing "is", as it is a technical term in puppet
Naming/UncommunicativeMethodParamName:
Description: Checks for method parameter names that contain capital letters, end in
numbers, or do not meet a minimal length.
Enabled: true
MinNameLength: 3
AllowNamesEndingInNumbers: true
AllowedNames:
- io
- id
- is
ForbiddenNames: []
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ end
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec) do |t|
if RUBY_PLATFORM == "java"
if RUBY_PLATFORM == 'java'
t.exclude_pattern = 'spec/{acceptance/**/*.rb,integration/**/*.rb,puppet/resource_api/*_context_spec.rb,puppet/util/network_device/simple/device_spec.rb}'
t.rspec_opts = '--tag ~agent_test'
end
Expand Down
2 changes: 1 addition & 1 deletion puppet-resource_api.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path('../lib', __FILE__) # __dir__ not supported on ruby-1.9 # rubocop:disable Style/ExpandPathArguments
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'puppet/resource_api/version'

Expand Down
6 changes: 3 additions & 3 deletions spec/puppet/resource_api/base_context_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
RSpec.describe Puppet::ResourceApi::BaseContext do
class TestContext < described_class
attr_reader :last_level, :last_message
def send_log(l, m)
@last_level = l
@last_message = m
def send_log(log, msg)
@last_level = log
@last_message = msg
end
end

Expand Down
6 changes: 3 additions & 3 deletions spec/puppet/resource_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@
end
let(:provider_class) do
Class.new do
def canonicalize(_context, x)
x[0][:test_string] = ['canon', x[0][:test_string]].compact.join unless x[0][:test_string] && x[0][:test_string].start_with?('canon')
x
def canonicalize(_context, resources)
resources[0][:test_string] = ['canon', resources[0][:test_string]].compact.join unless resources[0][:test_string] && resources[0][:test_string].start_with?('canon')
resources
end

def get(_context)
Expand Down

0 comments on commit 6818dab

Please sign in to comment.