2.8.6: NoMethodError "undefined method 'first'" in profdata_coverage_dir whenever --scheme is used
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
Start with Project#profdata_coverage_dir at lib/slather/project.rb:237, identified by the stack trace, and trace how --scheme selects the coverage directory. Reproduce with the documented slather coverage command on an Xcode workspace, then confirm the command generates a coverage report without raising NoMethodError.
Written by the indexing model from the issue text.
Description
Since 2.8.6, any slather coverage run with a scheme (--scheme or scheme: in .slather.yml) fails in Project#profdata_coverage_dir with a NoMethodError.
2.8.5 works with the same project and command.
Environment
slather: 2.8.6 (works on 2.8.5)
Ruby: 4.0.7
Xcode: 26.2
CI: Azure Pipelines, Microsoft-hosted macOS agent
macOS: macos-latest
Steps to reproduce
- Run tests with code coverage enabled for an Xcode workspace.
- Run:
gem install slather -v 2.8.6
slather coverage --cobertura-xml --output-directory test-reports/xml --scheme <SchemeName>
Expected
A coverage report is generated, as it is on 2.8.5.
Actual
/usr/local/lib/ruby/gems/3.3.0/gems/slather-2.8.6/lib/slather/project.rb:237:in `profdata_coverage_dir': undefined method `first' for nil (NoMethodError)
end.first
^^^^^^
from /usr/local/lib/ruby/gems/3.3.0/gems/slather-2.8.6/lib/slather/project.rb:568:in `find_binary_files'
from /usr/local/lib/ruby/gems/3.3.0/gems/slather-2.8.6/lib/slather/project.rb:498:in `configure_binary_file'
from /usr/local/lib/ruby/gems/3.3.0/gems/slather-2.8.6/lib/slather/project.rb:370:in `configure'
from /usr/local/lib/ruby/gems/3.3.0/gems/slather-2.8.6/lib/slather/command/coverage_command.rb:62:in `execute'
from /usr/local/lib/ruby/gems/3.3.0/gems/clamp-1.5.2/lib/clamp/command.rb:66:in `run'
from /usr/local/lib/ruby/gems/3.3.0/gems/clamp-1.5.2/lib/clamp/subcommand/execution.rb:18:in `execute'
from /usr/local/lib/ruby/gems/3.3.0/gems/clamp-1.5.2/lib/clamp/command.rb:66:in `run'
from /usr/local/lib/ruby/gems/3.3.0/gems/clamp-1.5.2/lib/clamp/command.rb:140:in `run'
from /usr/local/lib/ruby/gems/3.3.0/gems/slather-2.8.6/bin/slather:17:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/3.3.0/rubygems.rb:305:in `load'
from /usr/local/lib/ruby/site_ruby/3.3.0/rubygems.rb:305:in `activate_and_load_bin_path'
from /usr/local/lib/ruby/gems/3.3.0/bin/slather:25:in `<main>'
undefined method `first' for nil
- Dominant language
- Ruby
- Stars
- 1.6k
- Forks
- 239
- Avg merge
- 10h 19m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SlatherOrg/slather
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
SlatherOrg/slather#582 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
SlatherOrg/slather#580 · 9 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 56/100
SlatherOrg/slather#578 · 3 comments · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
SlatherOrg/slather#577 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
SlatherOrg/slather#576 · 2 comments ·
All issues in SlatherOrg/slather
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
voxpupuli/puppet-wireguard#151 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug f:search
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
manyfold3d/manyfold#7346 · 1 comment ·
Maintainers usually reply within 1 day
-
bug javascript smallFix update
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
puzzle/decidim-zuerich#636 ·