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

[Bug] Crash if running brakemen.run without specifying options #2

Open
Goose97 opened this issue Jul 27, 2023 · 1 comment
Open

[Bug] Crash if running brakemen.run without specifying options #2

Goose97 opened this issue Jul 27, 2023 · 1 comment

Comments

@Goose97
Copy link

Goose97 commented Jul 27, 2023

Hi, I encountered an error while using your library

Describing the error

It occurs when I try to run brakeman without supplying any options

# In Dangerfile
brakeman.run

It crashes with this error

/Users/goose/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/danger-brakeman_scanner-0.1.1/lib/danger_plugin.rb:18:in `dirname': no implicit conversion of nil into String (TypeError)

  def run(options = File.dirname(Kernel.caller_locations.first.absolute_path))

I had a look and here's what I found:

  1. It crashes in this line, specifically because Kernel.caller_locations.first.absolute_path is nil
  2. According to this and this, absolute_path can return nil in some situations (those links are pretty old so I'm not sure if they're still hold true today). Using eval seems like one of them. and danger uses it

Dependencies version

  • ruby (3.2.2)
  • danger (9.3.1)
  • danger-brakeman_scanner (0.1.1)
  • brakeman (6.0.1)

Please let me know if there's anything missing

@BuonOmo
Copy link
Contributor

BuonOmo commented Jul 27, 2023

Unfortunately this gem is in a stale status for now, the company maintaining it (Klaxit) has been bought by a Python company!

@hugobarthelemy may I also have maintainer access to this repo? Or can you help with this issue ? (cc @Quiwin)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants