simplecov_json_formatter 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f757b923131938814f1ca967951168fc1eebca119b011707e0f45dc88d0c712
4
- data.tar.gz: 927a0afbefee689ce71d15f6a21748a8e3e0daad14b6523ed9e6da6cfb791629
3
+ metadata.gz: ed76f412883d4b3acf146f750e65972606174a67a41ee8b295ea1892a37c2760
4
+ data.tar.gz: 176d3713a8d6781b04911bf88911cff530076ecd0e8a50eb3596a56611096fd1
5
5
  SHA512:
6
- metadata.gz: cce22c5ccf66888f8185e83495ddaa6f01781e5948aae9fe179b615dad6210694d3e3e981640cb6be0fe84912be9062da37f4f48f132a37c3239794174f067d7
7
- data.tar.gz: e53dcc9371a5436a96b337ea3123b0f4b51f8074313d6ed545049d31368ba349e8fb14222da2150a1a60b017d1d06930d9199f875d4e5dd53b398c312c4e576e
6
+ metadata.gz: 733c1930a1b246f3bec4c32bd82653470c385171454557ce2ceceab96315f4b670c76787261a33673be1cb3a33b4e95e5f977a6e7e28d25fc8895c56cd5e5e5b
7
+ data.tar.gz: ff9e3302d5ca638b9cb9da78ebd150e58e420dccf8d198d9c47b46ec9e22cc5a4667c2f14bd5ac17735085c593cb4691e93e5d2568ab3d62390c96ba085a82a4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ 0.1.4 (2022-02-12)
2
+ ==========
3
+
4
+ ## Enhancements
5
+ * Add support for simplecov's groups feature -w [#2](https://github.com/codeclimate-community/simplecov_json_formatter/pull/2) @PragTob
6
+
1
7
  0.1.3 (2021-05-02)
2
8
  ==========
3
9
 
data/README.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  ***Note: To learn more about SimpleCov, check out the main repo at [https://github.com/simplecov-ruby/simplecov](https://github.com/colszowka/simplecov***)***
4
4
 
5
- Generates a formatted JSON report of your [SimpleCov](https://github.com/simplecov-ruby/simplecov) ruby code coverage results on ruby 2.4+. Originally intended to add `simplecov`'s results reading capacity to CI tools.
5
+ Generates a formatted JSON report of your [SimpleCov](https://github.com/simplecov-ruby/simplecov) ruby code coverage results on ruby 2.4+. Originally intended to add `simplecov`'s results reading capacity to CI tools.
6
6
 
7
7
  ## Overview
8
8
 
9
- You can expect for this gem to produce a `coverage.json` file, located at the `coverage` folder.
9
+ You can expect for this gem to produce a `coverage.json` file, located at the `coverage` folder.
10
10
 
11
11
  Depending on your `SimpleCoV`'s settings you will experiment different outcomes. Particularly depending on which type of coverage are you running `SimpleCov` with:
12
12
 
@@ -15,13 +15,14 @@ Depending on your `SimpleCoV`'s settings you will experiment different outcomes.
15
15
 
16
16
  ## Development
17
17
 
18
- We encourage you to use docker for common operations like running tests, or debugging your code. Running `make sh` will start a new container instance based on the `Dockerfile` provided at root, finally a shell prompt will be displayed on your terminal. Also, syncronization with your local files will be already set.
18
+ We encourage you to use docker for common operations like running tests, or debugging your code. Running `make sh` will start a new container instance based on the `Dockerfile` provided at root, finally a shell prompt will be displayed on your terminal. Also, syncronization with your local files will be already set.
19
+
19
20
  ### Tests
20
21
  `make test` will trigger the excution of both running tests and running rubocop as linter, by simply running `rake`, this actions will be run inside a new container but using your local files.
21
22
 
22
23
  ### Format
23
24
 
24
- `make format` will run `rubocop -a` which stands for _autocorrect_ and format your code according to the `.rubocop.yml` config file.
25
+ `make format` will run `rubocop -a` which stands for _autocorrect_ and format your code according to the `.rubocop.yml` config file.
25
26
 
26
27
  ## Copyright
27
28
 
@@ -9,22 +9,38 @@ module SimpleCovJSONFormatter
9
9
  end
10
10
 
11
11
  def format
12
+ format_files
13
+ format_groups
14
+
15
+ formatted_result
16
+ end
17
+
18
+ private
19
+
20
+ def format_files
12
21
  @result.files.each do |source_file|
13
22
  formatted_result[:coverage][source_file.filename] =
14
23
  format_source_file(source_file)
15
24
  end
16
-
17
- formatted_result
18
25
  end
19
26
 
20
- private
27
+ def format_groups
28
+ @result.groups.each do |name, file_list|
29
+ formatted_result[:groups][name] = {
30
+ lines: {
31
+ covered_percent: file_list.covered_percent
32
+ }
33
+ }
34
+ end
35
+ end
21
36
 
22
37
  def formatted_result
23
38
  @formatted_result ||= {
24
39
  meta: {
25
40
  simplecov_version: SimpleCov::VERSION
26
41
  },
27
- coverage: {}
42
+ coverage: {},
43
+ groups: {}
28
44
  }
29
45
  end
30
46
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleCovJSONFormatter
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov_json_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Federico Moya
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-02 00:00:00.000000000 Z
11
+ date: 2022-02-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: JSON formatter for SimpleCov
14
14
  email:
@@ -28,7 +28,7 @@ homepage: https://github.com/fede-moya/simplecov_json_formatter
28
28
  licenses:
29
29
  - MIT
30
30
  metadata: {}
31
- post_install_message:
31
+ post_install_message:
32
32
  rdoc_options: []
33
33
  require_paths:
34
34
  - lib
@@ -43,8 +43,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  requirements: []
46
- rubygems_version: 3.0.3
47
- signing_key:
46
+ rubygems_version: 3.0.8
47
+ signing_key:
48
48
  specification_version: 4
49
49
  summary: JSON formatter for SimpleCov
50
50
  test_files: []