Skip to content

Conversation

Watson1978
Copy link
Contributor

@Watson1978 Watson1978 commented Jul 16, 2025

Which issue(s) this PR fixes:
Fixes #

What this PR does / why we need it:
Now, lib/fluent/config/dsl.rb causes failure on rubocop check.

Related to https://github.com/fluent/fluentd/actions/runs/16310944121/job/46066401079

Kernel.eval is used to get a constant value. There are no security issues.

def self.const_missing(name)
return ::Kernel.const_get(name) if ::Kernel.const_defined?(name)
if name.to_s =~ /^Fluent::Config::DSL::Element::(.*)$/
name = "#{$1}".to_sym
return ::Kernel.const_get(name) if ::Kernel.const_defined?(name)
end
::Kernel.eval("#{name}")
end

So, this PR will excude the file.

Docs Changes:
Not needed.

Release Note:

Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
@daipom
Copy link
Contributor

daipom commented Jul 16, 2025

Thanks!
Could you briefly describe why it is a false positive?

@Watson1978
Copy link
Contributor Author

Could you briefly describe why it is a false positive?

Update the description.
Thanks.

@daipom daipom added this to the v1.19.0 milestone Jul 16, 2025
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 the CI Test/CI issues label Jul 16, 2025
@daipom daipom merged commit 13cf042 into fluent:master Jul 16, 2025
17 checks passed
@Watson1978 Watson1978 deleted the rubocop branch July 16, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Test/CI issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants