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

Plugin template: Remove unnecessary code #4128

Merged

Conversation

daipom
Copy link
Contributor

@daipom daipom commented Apr 6, 2023

Which issue(s) this PR fixes:
None

What this PR does / why we need it:
This code in test/helper.rb is unnecessary, so we should remove it.

$LOAD_PATH.unshift(File.expand_path("../../", __FILE__))

File.expand_path("../../", __FILE__) returns the repository's top directory path.
So, this enables using relative paths from the top for require, such as require test/helper.

However, we don't use this.
We use the following and use the relative paths from test/ or lib/.

Rake::TestTask.new(:test) do |t|
t.libs.push("lib", "test")

require "helper"
require "fluent/plugin/<%= plugin_filename %>"

So I think it's unnecessary as template content.

Docs Changes:

Release Note:
Same as the title.

@ashie
Copy link
Member

ashie commented Apr 6, 2023

@ashie ashie merged commit a6def0c into fluent:master Apr 6, 2023
@daipom daipom deleted the plugin-template-remove-unnecessary-code branch April 6, 2023 08:20
@daipom
Copy link
Contributor Author

daipom commented Apr 6, 2023

Thanks for your review!

@ashie ashie added this to the v1.16.1 milestone Apr 13, 2023
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