-
Notifications
You must be signed in to change notification settings - Fork 66
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
Cleanup to match best practices in ruby and shell #98
base: main
Are you sure you want to change the base?
Conversation
The CI build failed but it appears like it was due to connectivity issues. Is that something that just needs to be kicked off again? |
lib/logstash/inputs/http.rb
Outdated
|
||
# The host or ip to bind | ||
config :host, :validate => :string, :default => "0.0.0.0" | ||
config :host, validate: :string, default: '0.0.0.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we tend to stick to => notation for hashes in the logstash and logstash plugins codebase
Thanks for the PR @teancom, I have restarted the tests in travis |
lib/logstash/inputs/http.rb
Outdated
@@ -243,19 +238,19 @@ def build_ssl_params | |||
end | |||
|
|||
def ssl_key_configured? | |||
!!(@ssl_certificate && @ssl_key) | |||
!(@ssl_certificate && @ssl_key).nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's skip these changes, IMO it's debatable which one of !!expr
or !(expr).nil?
is better
end | ||
|
||
def encoding_handled?(env) | ||
['gzip', 'deflate'].include? env['HTTP_CONTENT_ENCODING'] | ||
%w[gzip deflate].include? env['HTTP_CONTENT_ENCODING'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather stick with an array here, personal preference
source ./ci/setup.sh | ||
|
||
if [[ -f "ci/run.sh" ]]; then | ||
echo "Running custom build script in: `pwd`/ci/run.sh" | ||
echo "Running custom build script in: $(pwd)/ci/run.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we're indenting these lines we should indent the remaining ones in the block
Cleanup both ruby and shell scripts to match various linters' suggestions. Mostly using the new hash syntax, as well as small readability changes. Additionally, update gitignore to not accidentally add in the output from running `rake vendor`
9832fb0
to
f7e38cd
Compare
I reverted/cleaned up the issues you found, squashed, and repushed. Let me know if it looks better now. Thank you for taking the time to review! |
Cleanup both ruby and shell scripts to match various linters'
suggestions. Mostly using the new hash syntax, as well as small
readability changes. Additionally, update gitignore to not accidentally
add in the output from running
rake vendor
This was done as a "slate-cleaning" and a way to learn the repo before starting any of the issues marked "hacktober".