Skip to content
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

Suppress Ruby warnings #47

Merged
merged 8 commits into from
May 19, 2016
Merged

Conversation

okkez
Copy link
Contributor

@okkez okkez commented May 11, 2016

$ RUBYOPT="-w -v" bundle exec rake

Fluentd uses ServerEngine on Fluentd master branch.
I've worked to eliminate warning messages that is
reported when running Fluentd's test.
Some warning messages are reported from ServerEngine's code
when I execute Fluentd's test.

okkez added 8 commits May 11, 2016 13:25
This change suppresses following warnings (about 45 lines or more):

lib/serverengine/daemon_logger.rb:61: warning: instance variable @file_dev not initialized
lib/serverengine/daemon_logger.rb:63: warning: instance variable @file_dev not initialized
(snip)
lib/serverengine/daemon_logger.rb:56: warning: instance variable @file_dev not initialized
lib/serverengine/daemon_logger.rb:121: warning: instance variable @file_dev not initialized
This change can suppresses following warnings(26 lines):

lib/serverengine/config_loader.rb:43: warning: instance variable @logger not initialized
This change suppresses following warning:

lib/serverengine/daemon.rb:34: warning: shadowing outer local variable - load_config_proc
This change suppresses following warning:

lib/serverengine/supervisor.rb:152: warning: assigned but unused variable - stat
This change can suppress following warnings(84 lines):

spec/server_worker_context.rb:48: warning: method redefined; discarding old initialize
spec/server_worker_context.rb:48: warning: previous definition of initialize was here
spec/server_worker_context.rb:52: warning: method redefined; discarding old before_run
spec/server_worker_context.rb:52: warning: previous definition of before_run was here
spec/server_worker_context.rb:56: warning: method redefined; discarding old after_run
spec/server_worker_context.rb:56: warning: previous definition of after_run was here
spec/server_worker_context.rb:60: warning: method redefined; discarding old after_start
spec/server_worker_context.rb:60: warning: previous definition of after_start was here
spec/server_worker_context.rb:64: warning: method redefined; discarding old stop
spec/server_worker_context.rb:64: warning: previous definition of stop was here
spec/server_worker_context.rb:74: warning: method redefined; discarding old restart
spec/server_worker_context.rb:74: warning: previous definition of restart was here
spec/server_worker_context.rb:84: warning: method redefined; discarding old reload
spec/server_worker_context.rb:84: warning: previous definition of reload was here
spec/server_worker_context.rb:89: warning: method redefined; discarding old detach
spec/server_worker_context.rb:89: warning: previous definition of detach was here
spec/server_worker_context.rb:96: warning: method redefined; discarding old initialize
spec/server_worker_context.rb:96: warning: previous definition of initialize was here
spec/server_worker_context.rb:101: warning: method redefined; discarding old before_fork
spec/server_worker_context.rb:101: warning: previous definition of before_fork was here
spec/server_worker_context.rb:105: warning: method redefined; discarding old run
spec/server_worker_context.rb:105: warning: previous definition of run was here
spec/server_worker_context.rb:115: warning: method redefined; discarding old stop
spec/server_worker_context.rb:115: warning: previous definition of stop was here
spec/server_worker_context.rb:120: warning: method redefined; discarding old reload
spec/server_worker_context.rb:120: warning: previous definition of reload was here
spec/server_worker_context.rb:124: warning: method redefined; discarding old after_start
spec/server_worker_context.rb:124: warning: previous definition of after_start was here
This change suppresses following warnings:

spec/signal_thread_spec.rb:42: warning: assigned but unused variable - t
spec/signal_thread_spec.rb:58: warning: assigned but unused variable - n
spec/signal_thread_spec.rb:83: warning: shadowing outer local variable - t
spec/signal_thread_spec.rb:73: warning: assigned but unused variable - t
This change suppresses following warnings:

spec/socket_manager_spec.rb:40: warning: assigned but unused variable - from
spec/socket_manager_spec.rb:92: warning: assigned but unused variable - from
This change suppresses following warnings:

spec/socket_manager_spec.rb:10: warning: File.exists? is a deprecated name, use File.exist? instead
spec/socket_manager_spec.rb:10: warning: File.exists? is a deprecated name, use File.exist? instead
@okkez
Copy link
Contributor Author

okkez commented May 11, 2016

Many warnings (93lines) are remained.
We can use expect syntax to eliminate these warnings, I think.
But we use RSpec2, for now.

spec/daemon_logger_spec.rb:37: warning: possibly useless use of == in void context

@tagomoris
Copy link
Contributor

LGTM.
@naritta How about you?

@naritta naritta merged commit ba93820 into treasure-data:master May 19, 2016
@okkez okkez deleted the suppress-warnings branch May 19, 2016 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants