skunk icon indicating copy to clipboard operation
skunk copied to clipboard

[BUG] Error when running churn check

Open mehagar opened this issue 3 years ago • 1 comments

  • [x] I checked the documentation and found no answer
  • [x] I checked to make sure that this issue has not already been filed
  • [x] I'm reporting the issue to the correct repository (for multi-repository projects)

Version, Branch, or Commit:

0.5.1

Expected behavior:

I expected to run skunk and see the skunk metrics.

Actual behavior:

It gets to the churn check and then outputs:

running churn
Stopped processing SimpleCov as a previous error not related to SimpleCov has been detected
Traceback (most recent call last):
	23: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/bin/ruby_executable_hooks:24:in `<main>'
	22: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/bin/ruby_executable_hooks:24:in `eval'
	21: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/bin/skunk:23:in `<main>'
	20: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/bin/skunk:23:in `load'
	19: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/skunk-0.5.1/exe/skunk:10:in `<top (required)>'
	18: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/skunk-0.5.1/lib/skunk/cli/application.rb:30:in `execute'
	17: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/skunk-0.5.1/lib/skunk/cli/commands/default.rb:33:in `execute'
	16: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/commands/default.rb:24:in `critique'
	15: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/analysers_runner.rb:29:in `run'
	14: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/analysers_runner.rb:29:in `each'
	13: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/analysers_runner.rb:32:in `block in run'
	12: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/analysers/churn.rb:17:in `run'
	11: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/core/analysed_modules_collection.rb:32:in `each'
	10: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/core/analysed_modules_collection.rb:32:in `each'
	 9: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/analysers/churn.rb:18:in `block in run'
	 8: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/source_control_systems/git.rb:37:in `revisions_count'
	 7: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/source_control_systems/git.rb:33:in `churn'
	 6: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/source_control_systems/git.rb:33:in `new'
	 5: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/source_control_systems/git/churn.rb:30:in `initialize'
	 4: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/source_control_systems/git/churn.rb:48:in `call'
	 3: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/source_control_systems/git/churn.rb:48:in `each'
	 2: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/source_control_systems/git/churn.rb:48:in `block in call'
	 1: from /Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/source_control_systems/git/churn.rb:61:in `process_line'
/Users/michaelhagar/.rvm/gems/ruby-2.7.2@sa/gems/rubycritic-4.6.1/lib/rubycritic/source_control_systems/git/churn.rb:69:in `process_date': wrong number of arguments (given 0, expected 1) (ArgumentError)

Steps to reproduce:

The repo I'm running it on is private so I can't share it.

Context and environment:

  1. Skunk 0.5.1
  2. Ruby 2.7.2

mehagar avatar Apr 14 '21 23:04 mehagar

@mehagar Thanks for reporting this issue! Unfortunately I think this is an issue in rubycritic, could you please move it to the rubycritic project? I'm a contributor in that project but GitHub won't let me move it there.

I did some quick digging and I found that churn.rb:69 is not covered by any tests... so there is probably an issue there with ruby 2.7.2 and rubycritic 4.6.1.

Screen Shot 2021-04-15 at 8 42 29 AM

Also, any chance you could add a debugger in that line and see what parameter it is trying to be passed to the process_date method?

etagwerker avatar Apr 15 '21 12:04 etagwerker

@etagwerker @mehagar Can we close this issue then? Not sure if this is still a thing...

mateusdeap avatar Dec 13 '22 18:12 mateusdeap