Skip to content

Backport(v1.16): rubocop: fix trailing-whitespace (#4928) #4943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fluent/plugin/in_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def on_message_complete
end
path_info = uri.path

if (@add_query_params)
if (@add_query_params)

query_params = WEBrick::HTTPUtils.parse_query(uri.query)

Expand Down
2 changes: 1 addition & 1 deletion lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def update_watcher(tail_watcher, pe, new_inode)
if @follow_inodes && new_inode.nil?
# nil inode means the file disappeared, so we only need to stop it.
@tails.delete(tail_watcher.path)
# https://github.com/fluent/fluentd/pull/4237#issuecomment-1633358632
# https://github.com/fluent/fluentd/pull/4237#issuecomment-1633358632
# Because of this problem, log duplication can occur during `rotate_wait`.
# Need to set `rotate_wait 0` for a workaround.
# Duplication will occur if `refresh_watcher` is called during the `rotate_wait`.
Expand Down
4 changes: 2 additions & 2 deletions lib/fluent/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def setup_global_logger(supervisor: false)
$log.enable_debug if system_config.log_level <= Fluent::Log::LEVEL_DEBUG

$log.info "init #{process_type} logger",
path: actual_log_path,
path: actual_log_path,
rotate_age: @log_rotate_age,
rotate_size: @log_rotate_size
end
Expand Down Expand Up @@ -995,7 +995,7 @@ def main_process(&block)
def build_system_config(conf)
system_config = SystemConfig.create(conf, @cl_opt[:strict_config_value])
# Prefer the options explicitly specified in the command line
#
#
# TODO: There is a bug that `system_config.log.rotate_age/rotate_size` are
# not merged with the command line options since they are not in
# `SYSTEM_CONFIG_PARAMETERS`.
Expand Down
4 changes: 2 additions & 2 deletions lib/fluent/winsvc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
op.parse(ARGV)
if opts[:service_name] == nil
raise "Error: No Windows Service name set. Use '--service-name'"
end
end

def read_fluentdopt(service_name)
Win32::Registry::HKEY_LOCAL_MACHINE.open("SYSTEM\\CurrentControlSet\\Services\\#{service_name}") do |reg|
Expand All @@ -54,7 +54,7 @@ class FluentdService < Daemon
def initialize(service_name)
@service_name = service_name
end

def service_main
@pid = service_main_start(@service_name)
while running?
Expand Down
12 changes: 6 additions & 6 deletions test/config/test_plugin_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class AllBooleanParams < Fluent::Plugin::Input

class BooleanParamsWithoutValue < ::Test::Unit::TestCase
CONFIG = <<CONFIG
flag1
flag1
flag2 # yaaaaaaaaaay
flag3
flag3
flag4 # yaaaaaaaaaay
<child>
flag1
Expand All @@ -37,10 +37,10 @@ class BooleanParamsWithoutValue < ::Test::Unit::TestCase
</child>
# with following whitespace
<child>
flag1
flag2
flag3
flag4
flag1
flag2
flag3
flag4
</child>
CONFIG

Expand Down
4 changes: 2 additions & 2 deletions test/plugin/test_buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -946,9 +946,9 @@ def create_chunk_es(metadata, es)
# 1. `write_once`: 42 [events] * 1 [stream]
# 2. `write_step_by_step`: 4 [events]* 10 [streams] + 2 [events] * 1 [stream]
# 3. `write_step_by_step` (by `ShouldRetry`): 1 [event] * 42 [streams]
#
#
# Example of staged chunk lock behavior:
#
#
# 1. mon_enter in write_step_by_step
# 2. ShouldRetry occurs
# 3. mon_exit in write_step_by_step
Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_filter_grep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def messages
end

test "don't raise an exception" do
assert_nothing_raised {
assert_nothing_raised {
filter(%[regexp1 message WARN], ["\xff".force_encoding('UTF-8')])
}
end
Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_in_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ def test_cors_disallowed
assert_equal ["403", "403"], res_codes
end

def test_add_query_params
def test_add_query_params
d = create_driver(config + "add_query_params true")
assert_equal true, d.instance.add_query_params

Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ def invoke_slow_flush_log_threshold_test(i)
config: config_element(
"ROOT", "", {},
[
config_element("buffer", "", {}),
config_element("buffer", "", {}),
config_element("secondary", "", {"@type" => "test", "name" => "test"}),
]
),
Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_parser_csv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_incompatibility_between_normal_and_fast_parser
text = 'a"b,"a"""c"'
assert_raise(CSV::MalformedCSVError) {
normal.instance.parse(text) { |t, r| }
}
}
assert_nothing_raised {
# generate broken record
fast.instance.parse(text) { |t, r| }
Expand Down
2 changes: 1 addition & 1 deletion test/test_tls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class UniqueIdTest < Test::Unit::TestCase
TEST_TLS1_2_CASES = {
'New TLS v1.2' => :'TLS1_2',
'Old TLS v1.2' => :'TLSv1_2'
}
}
TEST_TLS_CASES = TEST_TLS1_1_CASES.merge(TEST_TLS1_2_CASES)

sub_test_case 'constants' do
Expand Down