-
Notifications
You must be signed in to change notification settings - Fork 554
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
Many "instance variable not initialized" warnings #106
Comments
I don't think that Ruby 1.9.3 is the issue here as it builds fine on 1.9.3 on Travis CI (see http://travis-ci.org/#!/colszowka/simplecov/jobs/283900) and also works fine for me. Do you run Ruby with a very high warning level? Obviously your Ruby gives warnings for Ruby code that is perfectly valid (in my opinion) as accessing potentially uninitialized instance vars using |
I am using the standard ruby 1.9.3 provided by |
Hm, for me |
Please also check out http://www.ruby-forum.com/topic/199672 and http://stackoverflow.com/questions/2098742/ruby-instance-variable-not-initialized-warning for further info. I'm not sure whether this should be fixed in SimpleCov as this by default does not cause warnings and it's perfectly valid ruby code. Initializing all those variables might be a bigger tradeoff for source code readbility than having it cause harmless warnings in verbose ruby mode. Keeping this open for now. |
For some of these instance variable the code was |
In my pull release I did not fix the Could you have a look at |
In my case the default warning level seems to be 2:
|
Simplecov should be able to run without generating Ruby warnings. With simplecov triggering Ruby warnings, it makes it impossible for library authors using simplecov to measure both coverage and ensure their own code is free of warnings at the same time. Rails and RSpec have both been able to remove all warnings from their own large code bases. |
@colszowka is there a problem with my pull request? Should I change it somehow? The commits in it fix most of these warning with minimal code changes. |
@gioele, yes, I was commenting on #108. I meant adding something like How are you currently setting the warning level? |
Ok guys, merged @mvz 's pull request, so the warnings should be reduced now. Although I personally think Ruby is being slightly ridiculous with this particular warning I can see that people running their test suite at a higher warning level than I do don't want a test tool like simplecov to mess up their beautiful warning-free output. v0.6.4 should be released today or tomorrow. Thanks for your patience and effort! |
v0.6.4, 2012-05-10 ([changes](simplecov-ruby/simplecov@v0.6.3...v0.6.4)) ------------------- * [BUGFIX] Encoding issues with ISO-8859-encoded source files fixed. See simplecov-ruby/simplecov#117. (thanks to @Deradon) * [BUGFIX] Ensure ZeroDivisionErrors won't occur when calculating the coverage result, which previously could happen in certain cases. See simplecov-ruby/simplecov#128. (thanks to @japgolly) * [REFACTORING] Changed a couple instance variable lookups so SimpleCov does not cause a lot of warnings when running ruby at a higher warning level. See simplecov-ruby/simplecov#106 and simplecov-ruby/simplecov#119. (thanks to @mvz and @gioele) v0.6.3, 2012-05-10 ([changes](simplecov-ruby/simplecov@v0.6.2...v0.6.3)) ------------------- * [BUGFIX] Modified the API-changes for newer multi_json versions introduced with #122 and v0.6.2 so they are backwards-compatible with older multi_json gems in order to avoid simplecov polluting the multi_json minimum version requirement for entire applications. See simplecov-ruby/simplecov#132 * Added appraisal gem to the test setup in order to run the test suite against both 1.0 and 1.3 multi_json gems and ensure the above actually works :)
Make this package to Ruby 1.9.3 only. v0.7.1, 2012-10-12 ([changes](simplecov-ruby/simplecov@v0.7.0...v0.7.1)) ------------------- * [BUGFIX] The gem packages of 0.7.0 (both simplecov and simplecov-html) pushed to Rubygems had some file permission issues, leading to problems when installing SimpleCov in a root/system Rubygems install and then trying to use it as a normal user (see simplecov-ruby/simplecov#171, thanks @envygeeks for bringing it up). The gem build process has been changed to always enforce proper permissions before packaging to avoid this issue in the future. v0.7.0, 2012-10-10 ([changes](simplecov-ruby/simplecov@v0.6.4...v0.7.0)) ------------------- * [FEATURE] The new `maximum_coverage_drop` and `minimum_coverage` now allow you to fail your build when the coverage dropped by more than what you allowed or is below a minimum value required. Also, `refuse_coverage_drop` disallows any coverage drops between test runs. See simplecov-ruby/simplecov#151, simplecov-ruby/simplecov#11, simplecov-ruby/simplecov#90, and simplecov-ruby/simplecov#96 (thanks to @infertux) * [FEATURE] SimpleCov now ships with a built-in MultiFormatter which allows the easy usage of multiple result formatters at the same time without the need to write custom wrapper code. See simplecov-ruby/simplecov#158 (thanks to @nikitug) * [BUGFIX] The usage of digits, hyphens and underscores in group names could lead to broken tab navigation in the default simplecov-html reports. See simplecov-ruby/simplecov-html#14 (thanks to @ebelgarts) * [REFACTORING] A few more ruby warnings removed. See simplecov-ruby/simplecov#106 and simplecov-ruby/simplecov#139. (thanks to @lukejahnke) * A [Pledgie button](simplecov-ruby/simplecov@63cfa99) for those that feel generous :) * The usual bunch of README fixes and documentation tweaks. Thanks to everyone who contributed those!
Make this package to Ruby 1.9.3 only. v0.7.1, 2012-10-12 ([changes](simplecov-ruby/simplecov@v0.7.0...v0.7.1)) ------------------- * [BUGFIX] The gem packages of 0.7.0 (both simplecov and simplecov-html) pushed to Rubygems had some file permission issues, leading to problems when installing SimpleCov in a root/system Rubygems install and then trying to use it as a normal user (see simplecov-ruby/simplecov#171, thanks @envygeeks for bringing it up). The gem build process has been changed to always enforce proper permissions before packaging to avoid this issue in the future. v0.7.0, 2012-10-10 ([changes](simplecov-ruby/simplecov@v0.6.4...v0.7.0)) ------------------- * [FEATURE] The new `maximum_coverage_drop` and `minimum_coverage` now allow you to fail your build when the coverage dropped by more than what you allowed or is below a minimum value required. Also, `refuse_coverage_drop` disallows any coverage drops between test runs. See simplecov-ruby/simplecov#151, simplecov-ruby/simplecov#11, simplecov-ruby/simplecov#90, and simplecov-ruby/simplecov#96 (thanks to @infertux) * [FEATURE] SimpleCov now ships with a built-in MultiFormatter which allows the easy usage of multiple result formatters at the same time without the need to write custom wrapper code. See simplecov-ruby/simplecov#158 (thanks to @nikitug) * [BUGFIX] The usage of digits, hyphens and underscores in group names could lead to broken tab navigation in the default simplecov-html reports. See simplecov-ruby/simplecov-html#14 (thanks to @ebelgarts) * [REFACTORING] A few more ruby warnings removed. See simplecov-ruby/simplecov#106 and simplecov-ruby/simplecov#139. (thanks to @lukejahnke) * A [Pledgie button](simplecov-ruby/simplecov@63cfa99) for those that feel generous :) * The usual bunch of README fixes and documentation tweaks. Thanks to everyone who contributed those!
v0.6.4, 2012-05-10 ([changes](simplecov-ruby/simplecov@v0.6.3...v0.6.4)) ------------------- * [BUGFIX] Encoding issues with ISO-8859-encoded source files fixed. See simplecov-ruby/simplecov#117. (thanks to @Deradon) * [BUGFIX] Ensure ZeroDivisionErrors won't occur when calculating the coverage result, which previously could happen in certain cases. See simplecov-ruby/simplecov#128. (thanks to @japgolly) * [REFACTORING] Changed a couple instance variable lookups so SimpleCov does not cause a lot of warnings when running ruby at a higher warning level. See simplecov-ruby/simplecov#106 and simplecov-ruby/simplecov#119. (thanks to @mvz and @gioele) v0.6.3, 2012-05-10 ([changes](simplecov-ruby/simplecov@v0.6.2...v0.6.3)) ------------------- * [BUGFIX] Modified the API-changes for newer multi_json versions introduced with #122 and v0.6.2 so they are backwards-compatible with older multi_json gems in order to avoid simplecov polluting the multi_json minimum version requirement for entire applications. See simplecov-ruby/simplecov#132 * Added appraisal gem to the test setup in order to run the test suite against both 1.0 and 1.3 multi_json gems and ensure the above actually works :)
Make this package to Ruby 1.9.3 only. v0.7.1, 2012-10-12 ([changes](simplecov-ruby/simplecov@v0.7.0...v0.7.1)) ------------------- * [BUGFIX] The gem packages of 0.7.0 (both simplecov and simplecov-html) pushed to Rubygems had some file permission issues, leading to problems when installing SimpleCov in a root/system Rubygems install and then trying to use it as a normal user (see simplecov-ruby/simplecov#171, thanks @envygeeks for bringing it up). The gem build process has been changed to always enforce proper permissions before packaging to avoid this issue in the future. v0.7.0, 2012-10-10 ([changes](simplecov-ruby/simplecov@v0.6.4...v0.7.0)) ------------------- * [FEATURE] The new `maximum_coverage_drop` and `minimum_coverage` now allow you to fail your build when the coverage dropped by more than what you allowed or is below a minimum value required. Also, `refuse_coverage_drop` disallows any coverage drops between test runs. See simplecov-ruby/simplecov#151, simplecov-ruby/simplecov#11, simplecov-ruby/simplecov#90, and simplecov-ruby/simplecov#96 (thanks to @infertux) * [FEATURE] SimpleCov now ships with a built-in MultiFormatter which allows the easy usage of multiple result formatters at the same time without the need to write custom wrapper code. See simplecov-ruby/simplecov#158 (thanks to @nikitug) * [BUGFIX] The usage of digits, hyphens and underscores in group names could lead to broken tab navigation in the default simplecov-html reports. See simplecov-ruby/simplecov-html#14 (thanks to @ebelgarts) * [REFACTORING] A few more ruby warnings removed. See simplecov-ruby/simplecov#106 and simplecov-ruby/simplecov#139. (thanks to @lukejahnke) * A [Pledgie button](simplecov-ruby/simplecov@63cfa99) for those that feel generous :) * The usual bunch of README fixes and documentation tweaks. Thanks to everyone who contributed those!
SimpleCov version 0.5.4, when used with ruby 1.9.3-p0, produces a series of warning:
The text was updated successfully, but these errors were encountered: