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

Invalid Dangerfile file: undefined method `map' for nil:NilClass #35

Open
valeriomazzeo opened this issue Apr 18, 2017 · 9 comments
Open

Comments

@valeriomazzeo
Copy link

When parsing a config file that doesn't have any excluded directory, danger-swiftlint crashes.

Adding the following to my config file fixes the issue.

excluded:
  - excluded_dir

Stacktrace:

[!] The exception involves the following plugins:
 -  danger-swiftlint

/Users/valerio/.rvm/gems/ruby-2.3.1/gems/danger-swiftlint-0.4.1/lib/danger_plugin.rb:124:in `excluded_files_from_config':  (Danger::DSLError)
[!] Invalid `Dangerfile` file: undefined method `map' for nil:NilClass
Did you mean?  tap
 #  from Dangerfile:22
 #  -------------------------------------------
 #  swiftlint.config_file = ".swiftlint.yml"
 >  swiftlint.lint_files
 #  
 #  -------------------------------------------
	from /Users/valerio/.rvm/gems/ruby-2.3.1/gems/danger-swiftlint-0.4.1/lib/danger_plugin.rb:42:in `lint_files'
	from Dangerfile:22:in `block in parse'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/gems/danger-5.0.2/lib/danger/danger_core/dangerfile.rb:199:in `eval'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/gems/danger-5.0.2/lib/danger/danger_core/dangerfile.rb:199:in `block in parse'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/gems/danger-5.0.2/lib/danger/danger_core/dangerfile.rb:195:in `instance_eval'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/gems/danger-5.0.2/lib/danger/danger_core/dangerfile.rb:195:in `parse'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/gems/danger-5.0.2/lib/danger/danger_core/dangerfile.rb:272:in `run'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/gems/danger-5.0.2/lib/danger/commands/pr.rb:58:in `block in run'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/gems/danger-5.0.2/lib/danger/commands/local_helpers/local_setup.rb:38:in `setup'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/gems/danger-5.0.2/lib/danger/commands/pr.rb:57:in `run'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/gems/danger-5.0.2/bin/danger:5:in `<top (required)>'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/bin/danger:23:in `load'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/bin/danger:23:in `<main>'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
	from /Users/valerio/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'
@ashfurrow
Copy link
Owner

Hmm, good catch/fix. Thanks for opening the issue. I'll try to get to this soon but it might be a while, if anyone else is available I'd appreciate assistance 🙇

@valeriomazzeo
Copy link
Author

np 👍

@thiagofelix
Copy link
Collaborator

@ashfurrow isn't it same issue fixed by #37?

@ashfurrow
Copy link
Owner

I believe so, @valeriomazzeo could you take a look?

@valeriomazzeo
Copy link
Author

Does #37 fix also the case when the excluded key is completely missing?

@ashfurrow
Copy link
Owner

It should, can you point to the current master and double-check? No worries, we're all busy 😅

@valeriomazzeo
Copy link
Author

I am traveling at the moment so won't be able to, until tomorrow :(

@ashfurrow
Copy link
Owner

No rush – travelling too or else I'd take a look :)

@omirho
Copy link
Collaborator

omirho commented Feb 22, 2018

@valeriomazzeo This was probably fixed by #37 .
Can you verify and close the issue?

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

No branches or pull requests

4 participants