simplecov 0.16.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +92 -0
  3. data/CODE_OF_CONDUCT.md +76 -0
  4. data/README.md +271 -112
  5. data/doc/alternate-formatters.md +10 -0
  6. data/lib/simplecov/combine/branches_combiner.rb +32 -0
  7. data/lib/simplecov/combine/files_combiner.rb +24 -0
  8. data/lib/simplecov/combine/lines_combiner.rb +43 -0
  9. data/lib/simplecov/combine/results_combiner.rb +60 -0
  10. data/lib/simplecov/combine.rb +30 -0
  11. data/lib/simplecov/command_guesser.rb +6 -3
  12. data/lib/simplecov/configuration.rb +110 -9
  13. data/lib/simplecov/coverage_statistics.rb +56 -0
  14. data/lib/simplecov/defaults.rb +6 -2
  15. data/lib/simplecov/file_list.rb +66 -13
  16. data/lib/simplecov/filter.rb +2 -1
  17. data/lib/simplecov/formatter/multi_formatter.rb +2 -2
  18. data/lib/simplecov/formatter/simple_formatter.rb +4 -4
  19. data/lib/simplecov/last_run.rb +3 -1
  20. data/lib/simplecov/lines_classifier.rb +2 -2
  21. data/lib/simplecov/profiles/hidden_filter.rb +5 -0
  22. data/lib/simplecov/profiles/rails.rb +1 -1
  23. data/lib/simplecov/profiles.rb +9 -7
  24. data/lib/simplecov/result.rb +39 -6
  25. data/lib/simplecov/result_adapter.rb +30 -0
  26. data/lib/simplecov/result_merger.rb +18 -11
  27. data/lib/simplecov/simulate_coverage.rb +29 -0
  28. data/lib/simplecov/source_file/branch.rb +84 -0
  29. data/lib/simplecov/source_file/line.rb +72 -0
  30. data/lib/simplecov/source_file.rb +223 -126
  31. data/lib/simplecov/useless_results_remover.rb +16 -0
  32. data/lib/simplecov/version.rb +1 -1
  33. data/lib/simplecov.rb +248 -63
  34. metadata +31 -53
  35. data/lib/simplecov/jruby_fix.rb +0 -44
  36. data/lib/simplecov/railtie.rb +0 -9
  37. data/lib/simplecov/railties/tasks.rake +0 -13
  38. data/lib/simplecov/raw_coverage.rb +0 -41
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 340ec350009dc4d27081bccbe681b30a6dfbe03f
4
- data.tar.gz: 5eedaa4adbf5662d5dc6bf43f9d4965c2e135eeb
2
+ SHA256:
3
+ metadata.gz: ce12d99507e5e8bd75399d80855c495907b8dda937fb5e2a33d2895e9f74e370
4
+ data.tar.gz: ae53aefe53c30c3b1d6c1c0b70aa34c1193642d4a879f77a0c3522960fc92773
5
5
  SHA512:
6
- metadata.gz: 80b657d9ebef95e175be573adb3abec9946352eb8d6bbb1408f6fcafc890ef4f260f76abcfd13389d3367efed1c517b56d9f2041783eb41548b7ad663a4138e0
7
- data.tar.gz: d5747876139d624da59057ec9c212ea459c0e288a0fcf4ef45228efc0683c9f4479488e2e4063d9cf2ca6eeb38a38feb3fdf6a7f52ba02b43faa7f62d1774623
6
+ metadata.gz: e9a60e36936b9b5018a6998ade1742373bfa67b96688411ab42c90ac82ca6280abe9d407dcef4d45398ed28803ca876d6f82ce0cabc878d6141897cca4dab91e
7
+ data.tar.gz: 7056045c2385516ce0029af14558bd95c9c84bc85319d82bddfcf2011b7db87a5291168bb739c1ff02d8830e133065b3f2fda605e03b7c2e6ed094b61bff9240
data/CHANGELOG.md CHANGED
@@ -1,3 +1,95 @@
1
+ 0.18.0 (2020-01-28)
2
+ ===================
3
+
4
+ Huge release! Highlights are support for branch coverage (Ruby 2.5+) and dropping support for EOL'ed Ruby versions (< 2.4).
5
+ Please also read the other beta patch notes.
6
+
7
+ ## Enhancements
8
+ * You can now define the minimum expected coverage by criterion like `minimum_coverage line: 90, branch: 80`
9
+ * Memoized some internal data structures that didn't change to reduce SimpleCov overhead
10
+ * Both `FileList` and `SourceFile` now have a `coverage` method that returns a hash that points from a coverage criterion to a `CoverageStatistics` object for uniform access to overall coverage statistics for both line and branch coverage
11
+
12
+ ## Bugfixes
13
+ * we were losing precision by rounding the covered strength early, that has been removed. **For Formatters** this also means that you may need to round it yourself now.
14
+ * Removed an inconsistency in how we treat skipped vs. irrelevant lines (see [#565](https://github.com/colszowka/simplecov/issues/565)) - SimpleCov's definition of 100% is now "You covered everything that you could" so if coverage is 0/0 that's counted as a 100% no matter if the lines were irrelevant or ignored/skipped
15
+
16
+ ## Noteworthy
17
+ * `FileList` stopped inheriting from Array, it includes Enumerable so if you didn't use Array specific methods on it in formatters you should be fine
18
+
19
+ 0.18.0.beta3 (2020-01-20)
20
+ ========================
21
+
22
+ ## Enhancements
23
+ * Instead of ignoring old `.resultset.json`s that are inside the merge timeout, adapt and respect them
24
+
25
+ ## Bugfixes
26
+ * Remove the constant warning printing if you still have a `.resultset.json` in pre 0.18 layout that is within your merge timeout
27
+
28
+ 0.18.0.beta2 (2020-01-19)
29
+ ===================
30
+
31
+ ## Enhancements
32
+ * only turn on the requested coverage criteria (when activating branch coverage before SimpleCov would also instruct Ruby to take Method coverage)
33
+ * Change how branch coverage is displayed, now it's `branch_type: hit_count` which should be more self explanatory. See [#830](https://github.com/colszowka/simplecov/pull/830) for an example and feel free to give feedback!
34
+ * Allow early running exit tasks and avoid the `at_exit` hook through the `SimpleCov.run_exit_tasks!` method. (thanks [@macumber](https://github.com/macumber))
35
+ * Allow manual collation of result sets through the `SimpleCov.collate` entrypoint. See the README for more details (thanks [@ticky](https://github.com/ticky))
36
+ * Within `case`, even if there is no `else` branch declared show missing coverage for it (aka no branch of it). See [#825](https://github.com/colszowka/simplecov/pull/825)
37
+ * Stop symbolizing all keys when loading cache (should lead to be faster and consume less memory)
38
+ * Cache whether we can use/are using branch coverage (should be slightly faster)
39
+
40
+ ## Bugfixes
41
+ * Fix a crash that happened when an old version of our internal cache file `.resultset.json` was still present
42
+
43
+ 0.18.0.beta1 (2020-01-05)
44
+ ===================
45
+
46
+ This is a huge release highlighted by changing our support for ruby versions to 2.4+ (so things that aren't EOL'ed) and finally adding branch coverage support!
47
+
48
+ This release is still beta because we'd love for you to test out branch coverage and get your feedback before doing a full release.
49
+
50
+ On a personal note from [@PragTob](https://github.com/PragTob/) thanks to [ruby together](https://rubytogether.org/) for sponsoring this work on SimpleCov making it possible to deliver this and subsequent releases.
51
+
52
+ ## Breaking
53
+ * Dropped support for all EOL'ed rubies meaning we only support 2.4+. Simplecov can no longer be installed on older rubies, but older simplecov releases should still work. (thanks [@deivid-rodriguez](https://github.com/deivid-rodriguez))
54
+ * Dropped the `rake simplecov` task that "magically" integreated with rails. It was always undocumented, caused some issues and [had some issues](https://github.com/colszowka/simplecov/issues/689#issuecomment-561572327). Use the integration as described in the README please :)
55
+
56
+ ## Enhancements
57
+
58
+ * Branch coverage is here! Please try it out and test it! You can activate it with `enable_coverage :branch`. See the README for more details. This is thanks to a bunch of people most notably [@som4ik](https://github.com/som4ik), [@tycooon](https://github.com/tycooon), [@stepozer](https://github.com/stepozer), [@klyonrad](https://github.com/klyonrad) and your humble maintainers also contributed ;)
59
+ * If the minimum coverage is set to be greater than 100, a warning will be shown. See [#737](https://github.com/colszowka/simplecov/pull/737) (thanks [@belfazt](https://github.com/belfazt))
60
+ * Add a configuration option to disable the printing of non-successful exit statuses. See [#747](https://github.com/colszowka/simplecov/pull/746) (thanks [@JacobEvelyn](https://github.com/JacobEvelyn))
61
+ * Calculating 100% coverage is now stricter, so 100% means 100%. See [#680](https://github.com/colszowka/simplecov/pull/680) thanks [@gleseur](https://github.com/gleseur)
62
+
63
+ ## Bugfixes
64
+
65
+ * Add new instance of `Minitest` constant. The `MiniTest` constant (with the capital T) will be removed in the next major release of Minitest. See [#757](https://github.com/colszowka/simplecov/pull/757) (thanks [@adam12](https://github.com/adam12))
66
+
67
+ 0.17.1 (2019-09-16)
68
+ ===================
69
+
70
+ Bugfix release for problems with ParallelTests.
71
+
72
+ ## Bugfixes
73
+
74
+ * Avoid hanging with parallel_tests. See [#746](https://github.com/colszowka/simplecov/pull/746) (thanks [@annaswims](https://github.com/annaswims))
75
+
76
+ 0.17.0 (2019-07-02)
77
+ ===================
78
+
79
+ Maintenance release with nice convenience features and important bugfixes.
80
+ Notably this **will be the last release to support ruby versions that have reached their end of life**. Moving forward official CRuby support will be 2.4+ and JRuby support will be 9.2+. Older versions might still work but no guarantees.
81
+
82
+ ## Enhancements
83
+
84
+ * Per default filter hidden files and folders. See [#721](https://github.com/colszowka/simplecov/pull/721) (thanks [Renuo AG](https://www.renuo.ch))
85
+ * Print the exit status explicitly when it's not a successful build so it's easier figure out SimpleCov failed the build in the output. See [#688](https://github.com/colszowka/simplecov/pull/688) (thanks [@daemonsy](https://github.com/daemonsy))
86
+
87
+ ## Bugfixes
88
+
89
+ * Avoid a premature failure exit code when setting `minimum_coverage` in combination with using [parallel_tests](https://github.com/grosser/parallel_tests). See [#706](https://github.com/colszowka/simplecov/pull/706) (thanks [@f1sherman](https://github.com/f1sherman))
90
+ * Project roots with special characters no longer cause crashes. See [#717](https://github.com/colszowka/simplecov/pull/717) (thanks [@deivid-rodriguez](https://github.com/deivid-rodriguez))
91
+ * Avoid continously overriding test results with manual `ResultMergere.store_results` usage. See [#674](https://github.com/colszowka/simplecov/pull/674) (thanks [@tomeon](https://github.com/tomeon))
92
+
1
93
  0.16.1 (2018-03-16)
2
94
  ===================
3
95
 
@@ -0,0 +1,76 @@
1
+ # SimpleCov Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at simplecov.team@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
74
+
75
+ For answers to common questions about this code of conduct, see
76
+ https://www.contributor-covenant.org/faq