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 non-parenthesis warnings #4590

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Conversation

Watson1978
Copy link
Contributor

Which issue(s) this PR fixes:
Fixes #

What this PR does / why we need it:
This patch will suppress following warnings:

$ ruby -w -I"lib:test" test/plugin/test_out_http.rb
test/plugin/test_out_http.rb:445: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
test/plugin/test_out_http.rb:446: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
test/plugin/test_out_http.rb:482: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
test/plugin/test_out_http.rb:483: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator

Seems we will see this warning If we omit the parentheses in the method and pass a regular expression as an argument.

irb(main):001> $VERBOSE=true
=> true
irb(main):002> p /m/
(irb):2: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
/m/
=> /m/

Docs Changes:

Release Note:

This patch will suppress following warnings:
```
$ ruby -w -I"lib:test" test/plugin/test_out_http.rb
test/plugin/test_out_http.rb:445: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
test/plugin/test_out_http.rb:446: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
test/plugin/test_out_http.rb:482: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
test/plugin/test_out_http.rb:483: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
```

Seems we will see this warning If we omit the parentheses in the method and pass a regular expression as an argument.

```
irb(main):001> $VERBOSE=true
=> true
irb(main):002> p /m/
(irb):2: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
/m/
=> /m/
```

Signed-off-by: Watson <watson1978@gmail.com>
Copy link
Contributor

@daipom daipom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@daipom daipom added this to the v1.17.1 milestone Aug 15, 2024
@daipom daipom added the backport to LTS We will backport this fix to the LTS branch label Aug 15, 2024
@daipom daipom merged commit ebdfab3 into fluent:master Aug 15, 2024
16 checks passed
@Watson1978 Watson1978 deleted the parenthesis branch August 15, 2024 05:54
@daipom daipom removed the backport to LTS We will backport this fix to the LTS branch label Aug 15, 2024
@daipom
Copy link
Contributor

daipom commented Aug 15, 2024

These tests are for sigv4 feature, which is added in v1.17.0:

So, we don't need to backport this.

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.

2 participants