Skip to content

Commit 0f40c0d

Browse files
committed
Fix RuboCop warnings
Address some RuboCop warnings and rename a method to have a clearer name.
1 parent a0dafc0 commit 0f40c0d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/overcommit/hook_runner.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def run
5151

5252
attr_reader :log
5353

54-
def run_hooks
54+
def run_hooks # rubocop:disable Metrics/MethodLength
5555
if @hooks.any?(&:enabled?)
5656
@printer.start_run
5757

@@ -78,7 +78,7 @@ def run_hooks
7878

7979
if hook_failed
8080
message = @context.post_fail_message
81-
@printer.after(message) unless message.nil?
81+
@printer.hook_run_failed(message) unless message.nil?
8282
end
8383

8484
!hook_failed

lib/overcommit/printer.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def run_succeeded
7575
end
7676
end
7777

78-
def after(message)
78+
def hook_run_failed(message)
7979
log.newline
8080
log.log message
8181
log.newline
@@ -131,9 +131,7 @@ def synchronize_all_methods
131131
self.class.__send__(:alias_method, old_method, method_name)
132132

133133
self.class.send(:define_method, new_method) do |*args|
134-
@lock.synchronize do
135-
__send__(old_method, *args)
136-
end
134+
@lock.synchronize { __send__(old_method, *args) }
137135
end
138136

139137
self.class.__send__(:alias_method, method_name, new_method)

0 commit comments

Comments
 (0)