Skip to content

Commit 580d37d

Browse files
(PUP-11767) Enable Style/DefwithParentheses
1 parent 7875354 commit 580d37d

Some content is hidden

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

44 files changed

+73
-70
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,6 @@ Style/CombinableLoops:
229229

230230
Style/ColonMethodDefinition:
231231
Enabled: true
232+
233+
Style/DefWithParentheses:
234+
Enabled: true

lib/puppet/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def app_defaults
372372
# Initialize application defaults. It's usually not necessary to override this method.
373373
# @return [void]
374374
# @api public
375-
def initialize_app_defaults()
375+
def initialize_app_defaults
376376
Puppet.settings.initialize_app_defaults(app_defaults)
377377
end
378378

lib/puppet/application/apply.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def apply_catalog(catalog)
366366

367367
# Returns facts or nil
368368
#
369-
def get_facts()
369+
def get_facts
370370
facts = nil
371371
unless Puppet[:node_name_fact].empty?
372372
# Collect our facts.
@@ -381,7 +381,7 @@ def get_facts()
381381

382382
# Returns the node or raises and error if node not found.
383383
#
384-
def get_node()
384+
def get_node
385385
node = Puppet::Node.indirection.find(Puppet[:node_name_value])
386386
raise _("Could not find node %{node}") % { node: Puppet[:node_name_value] } unless node
387387

@@ -390,7 +390,7 @@ def get_node()
390390

391391
# Returns either a manifest (filename) or nil if apply should use content of Puppet[:code]
392392
#
393-
def get_manifest()
393+
def get_manifest
394394
manifest = nil
395395
# Set our code or file to use.
396396
if options[:code] or command_line.args.length == 0

lib/puppet/daemon.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def daemonize
5858

5959
# Close stdin/stdout/stderr so that we can finish our transition into 'daemon' mode.
6060
# @return nil
61-
def self.close_streams()
61+
def self.close_streams
6262
Puppet.debug("Closing streams for daemon mode")
6363
begin
6464
$stdin.reopen "/dev/null"
@@ -76,7 +76,7 @@ def self.close_streams()
7676
end
7777

7878
# Convenience signature for calling Puppet::Daemon.close_streams
79-
def close_streams()
79+
def close_streams
8080
Puppet::Daemon.close_streams
8181
end
8282

lib/puppet/face/help.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def legacy_applications
160160
# @return [Array] An Array of Arrays. The outer array contains one entry per application; each
161161
# element in the outer array is a pair whose first element is a String containing the application
162162
# name, and whose second element is a String containing the summary for that application.
163-
def all_application_summaries()
163+
def all_application_summaries
164164
available_application_names_special_sort().inject([]) do |result, appname|
165165
next result if exclude_from_docs?(appname)
166166

@@ -196,7 +196,7 @@ def all_application_summaries()
196196
COMMON = 'Common:'
197197
SPECIALIZED = 'Specialized:'
198198
BLANK = "\n"
199-
def available_application_names_special_sort()
199+
def available_application_names_special_sort
200200
full_list = Puppet::Application.available_application_names
201201
a_list = full_list & %w{apply agent config help lookup module resource}
202202
a_list = a_list.sort

lib/puppet/functions/break.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
dispatch :break_impl do
3838
end
3939

40-
def break_impl()
40+
def break_impl
4141
# get file, line if available, else they are set to nil
4242
file, line = Puppet::Pops::PuppetStack.top_of_stack
4343

lib/puppet/indirector/json.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def path(name, ext = '.json')
5050

5151
private
5252

53-
def data_dir()
53+
def data_dir
5454
Puppet.run_mode.server? ? Puppet[:server_datadir] : Puppet[:client_datadir]
5555
end
5656

lib/puppet/node/environment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ def hash
552552
end
553553

554554
# not private so it can be called in tests
555-
def self.extralibs()
555+
def self.extralibs
556556
if ENV['PUPPETLIB']
557557
split_path(ENV['PUPPETLIB'])
558558
else

lib/puppet/parser/ast/hostclass.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def instantiate(modname)
2323
return all_types
2424
end
2525

26-
def code()
26+
def code
2727
@context[:code]
2828
end
2929
end

lib/puppet/parser/ast/pops_bridge.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def instantiate_NodeDefinition(o, modname)
227227
end
228228
end
229229

230-
def code()
230+
def code
231231
Expression.new(:value => @value)
232232
end
233233

0 commit comments

Comments
 (0)