Report
I'm trying to split Dangerfile into multiple smaller files.
For that, I am trying to use danger.import_dangerfile(path:'scripts/DangerExtensions/child_danger1.rb') method.
But this gives the error
[!] Invalid Dangerfile file: Not a directory @ rb_sysopen - scripts/DangerExtensions/child_danger1.rb/Dangerfile. Updating the Danger gem might fix the issue. Your Danger version: 8.5.0, latest Danger version: 8.6.1
What did you expect to happen?
When giving the full path to this method, danger should import the file and run it.
What happened instead?
When giving the full path to this method, danger blindly appends Dangerfile to it and tries to open the file.
|
def import_dangerfile_from_path(path) |
|
raise "`import_dangerfile_from_path` requires a string" unless path.kind_of?(String) |
|
local_path = File.join(path, "Dangerfile") |
|
@dangerfile.parse(Pathname.new(local_path)) |
|
end |
With this, if I have multiple files, I have to place each file with the name Dangerfile in separate folders, which is a limitation I would say.
Your Environment
PS: I am happy to open a PR to fix this if maintainers agree with this 🙂
Report
I'm trying to split Dangerfile into multiple smaller files.
For that, I am trying to use
danger.import_dangerfile(path:'scripts/DangerExtensions/child_danger1.rb')method.But this gives the error
[!] InvalidDangerfilefile: Not a directory @ rb_sysopen - scripts/DangerExtensions/child_danger1.rb/Dangerfile. Updating the Danger gem might fix the issue. Your Danger version: 8.5.0, latest Danger version: 8.6.1What did you expect to happen?
When giving the full path to this method, danger should import the file and run it.
What happened instead?
When giving the full path to this method, danger blindly appends
Dangerfileto it and tries to open the file.danger/lib/danger/danger_core/plugins/dangerfile_danger_plugin.rb
Lines 133 to 137 in 314bb92
With this, if I have multiple files, I have to place each file with the name
Dangerfilein separate folders, which is a limitation I would say.Your Environment
Which CI are you running on?
Github actions
Are you running the latest version of Danger?
Danger version
8.5.0What is your Dangerfile?
PS: I am happy to open a PR to fix this if maintainers agree with this 🙂