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

Interesting behavior with specific group names. #1038

Open
MyklClason opened this issue Dec 4, 2022 · 0 comments
Open

Interesting behavior with specific group names. #1038

MyklClason opened this issue Dec 4, 2022 · 0 comments

Comments

@MyklClason
Copy link

Using ruby 3.1.2p20, simplecov (0.21.2). I have this setup I'm using:

require "simplecov"
require "simplecov-lcov"
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
   SimpleCov::Formatter::LcovFormatter,
   SimpleCov::Formatter::HTMLFormatter
 ])
SimpleCov.start do
  add_filter(%r{^/spec/}) # For RSpec
  add_filter(%r{^/test/}) # For Minitest

  add_filter "config" # Exclude /config files

  enable_coverage(:branch) # Report branch coverage to trigger branch-level undercover warnings

  %w[Components Controllers Helpers Mailers Models Mutations Views].each do |app_group|
    add_group app_group, "app/#{app_group.downcase}" # Add app folder groups
  end

  big = 100
  add_group ">#{big}LOC" do |src_file|
    src_file.lines.count >= big
  end

  tiny = 10
  add_group "<#{tiny}LOC" do |src_file|
    src_file.lines.count <= tiny
  end
end

The interesting thing is that the big and tiny groups appear in the same group for the HTML output (big then tiny below it). It still creates the two groups, but they contain the same information.

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

1 participant