It is overly difficult to debug Dangerfiles
See original GitHub issueToday, I had some mad issues with a Dangerfile. I eventually narrowed it down to the diffForFile
crashing on a file that had been removed (that’s another, separate issue).
Problems include cryptic error messages, no line numbers to debug with, and, worst of all, apparently no console.log
? Any time I tried to use console.log
, it would usually not work.
I’m not really sure why this is the case.
I know it’s a pretty massive departure in architecture, and may have been covered before, but:
What is dangerfile
just exported a function with the following signature:
module.exports = function dangerfile({
danger,
warn,
fail,
message,
schedule,
markdown,
}) {
}
Then, danger can just require the dangerfile, and inject in all the things it needs to. That would remove the need to essentially just eval
the code, give people more control, allow console.log
, and, most importantly, show line numbers in error messages.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
It seems to be working these days. Thoughts on closing this?
yeah that’s completely understandable.
is there a simple reason that
console.log
doesn’t work? That would solve most debugging. Another thing that Fastlane does is tell you the line number your config crashed on, which would be helpful (I’m pretty sure it does a similareval
thing, despite being ruby).