Skip to content

Commit 111ba38

Browse files
committed
Layout/MultilineMethodCallBraceLayout
This commit enables the Rubocop Layout/MultilineMethodCallBraceLayout cop and addresses all offenses.
1 parent b45783a commit 111ba38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+218
-171
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ I18n/GetText/DecorateStringFormattingUsingPercent:
2222
I18n/RailsI18n/DecorateString:
2323
Enabled: false
2424

25-
# This cop supports safe auto-correction (--auto-correct).
26-
# Configuration parameters: EnforcedStyle.
27-
# SupportedStyles: symmetrical, new_line, same_line
28-
Layout/MultilineMethodCallBraceLayout:
29-
Enabled: false
30-
3125
# This cop supports safe auto-correction (--auto-correct).
3226
# Configuration parameters: EnforcedStyle, IndentationWidth.
3327
# SupportedStyles: aligned, indented, indented_relative_to_receiver

lib/puppet.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ def self.base_context(settings)
227227
loaders << Puppet::Environments::StaticPrivate.new(
228228
Puppet::Node::Environment.create(default_environment,
229229
modulepath,
230-
Puppet::Node::Environment::NO_MANIFEST))
230+
Puppet::Node::Environment::NO_MANIFEST)
231+
)
231232
end
232233
end
233234

lib/puppet/datatypes.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ def create_type(loader)
158158

159159
created_type = Puppet::Pops::Types::PObjectType.new(
160160
@type_name,
161-
Puppet::Pops::Parser::EvaluatingParser.new.parse_string("{ #{@interface} }").body)
161+
Puppet::Pops::Parser::EvaluatingParser.new.parse_string("{ #{@interface} }").body
162+
)
162163

163164
if !@implementation_class.nil?
164165
if @implementation_class < Puppet::Pops::Types::PuppetObject

lib/puppet/error.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ def self.from_issue_and_stack(issue, args = {})
105105
nil,
106106
nil,
107107
issue.issue_code,
108-
args)
108+
args
109+
)
109110
end
110111
end
111112

lib/puppet/file_bucket/dipper.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def diff(checksum_a, checksum_b, file_a, file_b)
7070
file_diff = Puppet::FileBucket::File.indirection.find(
7171
source_path,
7272
:bucket_path => @local_path,
73-
:diff_with => checksum_b)
73+
:diff_with => checksum_b
74+
)
7475
elsif file_b
7576
tmp_file = ::Tempfile.new('diff')
7677
begin
@@ -167,7 +168,8 @@ def list(fromdate, todate)
167168
:bucket_path => @local_path,
168169
:list_all => true,
169170
:fromdate => fromdate,
170-
:todate => todate)
171+
:todate => todate
172+
)
171173
raise Puppet::Error, _("File not found") unless file_bucket_list
172174

173175
file_bucket_list.to_s

lib/puppet/functions/assert_type.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ def assert_type(type, value)
7979
else
8080
raise Puppet::Pops::Types::TypeAssertionError.new(
8181
Puppet::Pops::Types::TypeMismatchDescriber.singleton.describe_mismatch('assert_type():', type, inferred_type),
82-
type, inferred_type)
82+
type, inferred_type
83+
)
8384
end
8485
end
8586
value

lib/puppet/functions/contain.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ def contain(scope, *classes)
3434
if Puppet[:tasks]
3535
raise Puppet::ParseErrorWithIssue.from_issue_and_stack(
3636
Puppet::Pops::Issues::CATALOG_OPERATION_NOT_SUPPORTED_WHEN_SCRIPTING,
37-
{:operation => 'contain'})
37+
{:operation => 'contain'}
38+
)
3839
end
3940

4041
# Make call patterns uniform and protected against nested arrays, also make

lib/puppet/functions/include.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ def include(scope, *classes)
4242
if Puppet[:tasks]
4343
raise Puppet::ParseErrorWithIssue.from_issue_and_stack(
4444
Puppet::Pops::Issues::CATALOG_OPERATION_NOT_SUPPORTED_WHEN_SCRIPTING,
45-
{:operation => 'include'})
45+
{:operation => 'include'}
46+
)
4647
end
4748

4849
classes = scope.transform_and_assert_classnames(classes.flatten)

lib/puppet/functions/require.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def require_impl(scope, *classes)
5050
if Puppet[:tasks]
5151
raise Puppet::ParseErrorWithIssue.from_issue_and_stack(
5252
Puppet::Pops::Issues::CATALOG_OPERATION_NOT_SUPPORTED_WHEN_SCRIPTING,
53-
{:operation => 'require'})
53+
{:operation => 'require'}
54+
)
5455
end
5556

5657
# Make call patterns uniform and protected against nested arrays, also make

lib/puppet/http/service.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ def add_puppet_headers(headers)
121121
def build_url(api, server, port)
122122
URI::HTTPS.build(host: server,
123123
port: port,
124-
path: api
125-
).freeze
124+
path: api).freeze
126125
end
127126

128127
def get_mime_types(model)

0 commit comments

Comments
 (0)