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

New interface to specify multiple formatters #317

Merged
merged 2 commits into from
Jul 14, 2014
Merged

New interface to specify multiple formatters #317

merged 2 commits into from
Jul 14, 2014

Conversation

sferik
Copy link
Collaborator

@sferik sferik commented Jul 14, 2014

This is the implementation of my proposal for a new multiple formatter interface. To restate:

SimpleCov.formatters = [
  SimpleCov::Formatter::HTMLFormatter,
  SimpleCov::Formatter::CSVFormatter,
]

This is the current interface:

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
  SimpleCov::Formatter::CSVFormatter,
]

I think my proposal is better than the current interface because (conventionally) the [] method is used to fetch a value, not to set a value.

This proposal would not require breaking the current interface SimpleCov.formatter because the new method is named SimpleCov.formatters (with an “s”).

I’ve left the decision to deprecate SimpleCov::Formatter::MultiFormatter.[] up to the maintainers. IMHO, a version of simplecov should be released with a much simpler interface. For example, I find it a bit strange that SimpleCov.formatter is both a setter and a getter, when there is also an explicit SimpleCov.formatter= attribute writer. I’m not sure why the setter needs to be spelled two different ways.

@bf4
Copy link
Collaborator

bf4 commented Jul 14, 2014

Would you mind adding yourself to the CHANGELOG? Thanks. If you're up for coming on board as a collaborator, I'm happy to ask @colszowka

@sferik sferik changed the title Update multiple formatter interface New multiple formatter interface Jul 14, 2014
@sferik sferik changed the title New multiple formatter interface New interface to specify multiple formatters Jul 14, 2014
@sferik
Copy link
Collaborator Author

sferik commented Jul 14, 2014

I’ve added this change to the CHANGELOG. Let me know if you want me to squash that into the previous commit.

As for joining as a collaborator, I would be honored to be a member of the team, if @colszowka will have me. I maintain a number of other Ruby projects, so I can’t promise that I will have much free time to dedicate to simplecov but I will contribute when I can.

@colszowka
Copy link
Collaborator

Sure thing, added you @sferik - welcome aboard and thanks for the suggestion @bf4!

@bf4
Copy link
Collaborator

bf4 commented Jul 14, 2014

@sferik The way I see it, is anyone making regular quality PR's should be invited as a collab as a way of saying "keep doing what you're doing; I trust you". It helps grease the wheel of progress :) Which is why I have commit on some projects I don't commit much too.... ;)

bf4 added a commit that referenced this pull request Jul 14, 2014
New interface to specify multiple formatters
@bf4 bf4 merged commit e966aaa into simplecov-ruby:master Jul 14, 2014
@bf4
Copy link
Collaborator

bf4 commented Jul 14, 2014

Y'know, I forgot that we should update the README as well.

@sferik
Copy link
Collaborator Author

sferik commented Jul 14, 2014

@bf4 I can update the README now that I have a commit bit. 😄

@bf4
Copy link
Collaborator

bf4 commented Jul 15, 2014

Since it's somewhat on topic, @colszowka please also add @xaviershay as collaborator

@colszowka
Copy link
Collaborator

Done, welcome on board @xaviershay :)

@sferik
Copy link
Collaborator Author

sferik commented Jul 15, 2014

@xaviershay Welcome to the team! 😄

@xaviershay
Copy link
Collaborator

wooo

@sferik sferik mentioned this pull request Jul 18, 2014
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Feb 3, 2015
0.9.1, 2014-09-21 ([changes](simplecov-ruby/simplecov@v0.9.0...v0.9.1))
====================

## Bugfixes

 * In 0.9.0, we introduced a regression that made SimpleCov no-op mode fail on Ruby 1.8, while
   dropping 1.8 support altogether is announced only for v1.0. This has been fixed.
   See [#333](simplecov-ruby/simplecov#333) (thanks (@sferik)


0.9.0, 2014-07-17 ([changes](simplecov-ruby/simplecov@v0.8.2...v0.9.0))
====================

**A warm welcome and big thank you to the new contributors [@xaviershay](https://github.com/xaviershay), [@sferik](https://github.com/sferik) and especially [@bf4](https://github.com/bf4) for tackling a whole lot of issues and pull requests for this release!**

## Enhancements

  * New interface to specify multiple formatters.
    See [#317](simplecov-ruby/simplecov#317) (thanks @sferik)
  * Document in the README how to exclude code from coverage reports,
    and that the feature shouldn't be abused for skipping untested
    private code.
    See [#304](simplecov-ruby/simplecov#304)
  * Clarify Ruby version support.
    See [#279](simplecov-ruby/simplecov#279) (thanks @deivid-rodriguez)

## Bugfixes

  * Ensure calculations return Floats, not Fixnum or Rational. Fixes segfaults with mathn.
    See [#245](simplecov-ruby/simplecov#245) (thanks to @bf4)
  * Using `Kernel.exit` instead of exit to avoid uncaught throw :IRB_EXIT when
    exiting irb sessions.
    See [#287](simplecov-ruby/simplecov#287) (thanks @wless1)
    See [#285](simplecov-ruby/simplecov#285)
  * Does not look for .simplecov in ~/ when $HOME is not set.
    See [#311](simplecov-ruby/simplecov#311) (thanks @lasseebert)
  * Exit with code only if it's Numeric > 0.
    See [#302](simplecov-ruby/simplecov#303 @hajder)
  * Make default filter case insensitive.
    See [#280](simplecov-ruby/simplecov#280) (thanks @ryanatball)
  * Improve regexp that matches functional tests.
    See [#276](simplecov-ruby/simplecov#276) (thanks @sferik)
  * Fix TravisCI [#272](simplecov-ruby/simplecov#272) [#278](simplecov-ruby/simplecov#278), [#302](simplecov-ruby/simplecov#302)
  * Fix global config load.
    See [#311](simplecov-ruby/simplecov#311) (thanks @lasseebert)
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

Successfully merging this pull request may close these issues.

None yet

4 participants