simplecov-rspec 0.3.2 → 0.4.1

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: c140510851befaa363a4a01c35f0db12b18966dd7cb94312f4f32fe0d8772029
4
- data.tar.gz: 399fb0c4494b9bbdbccd3e7c3e9b2be5a7856a4ef71b73e2712faff1b1dc6ea2
3
+ metadata.gz: 87a2ca379dd6c7b82d24adfcade3be186112c3a99bf3fdbc6287242d81f94d97
4
+ data.tar.gz: 5cfb879e90d193616d037bab89703064ff96e81bf904b6245fda30fc11a90b08
5
5
  SHA512:
6
- metadata.gz: 402fb8ea61162c1efb934779af412e61836c872335f5c5a0264d0bd6b09be57c3ef0164210ae7336a3b9d21d4a8cbcd92c6e632653afe1fee018a9a5c95d7949
7
- data.tar.gz: 27ef5ca48e03a7db7c2a57842f59c849aa3e210faa02bd0e749868147ed9e8dd4370efc9615083fbe5889b23cec905680dac4c7cec62dd950d3f417d9e4f06e0
6
+ metadata.gz: eb709f134eec4e8517e3d0e8b013e3f54983e145552f5b34ef226d2015e286aa255f1d4da56756d78a246ba3c538a448ad1c69eaedaa57957ff82610237ccefe
7
+ data.tar.gz: 94ba9238a621933d1e8abb3c303502627043cc49854b564f59396b53793d1a4ed6a62654d5ec5d4c1964c89c412034831c9a3593c3ae3b743d8f8ae469964047
data/.commitlintrc.yml ADDED
@@ -0,0 +1,16 @@
1
+ ---
2
+ extends: '@commitlint/config-conventional'
3
+
4
+ rules:
5
+ # See: https://commitlint.js.org/reference/rules.html
6
+ #
7
+ # Rules are made up by a name and a configuration array. The configuration array contains:
8
+ #
9
+ # * Severity [0..2]: 0 disable rule, 1 warning if violated, or 2 error if violated
10
+ # * Applicability [always|never]: never inverts the rule
11
+ # * Value: value to use for this rule
12
+ #
13
+ # Run `npx commitlint --print-config` to see the current setting for all rules.
14
+ #
15
+ body-leading-blank: [2, 'always']
16
+ footer-leading-blank: [2, 'always']
data/.husky/commit-msg ADDED
@@ -0,0 +1 @@
1
+ npx --no-install commitlint --edit "$1"
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.4.1"
3
+ }
data/.rubocop.yml CHANGED
@@ -1,38 +1,11 @@
1
- AllCops:
2
- NewCops: enable
3
- SuggestExtensions: false
4
- DefaultFormatter: fuubar
5
-
6
- # Output extra information for each offense to make it easier to diagnose:
7
- DisplayCopNames: true
8
- DisplayStyleGuide: true
9
- ExtraDetails: true
1
+ inherit_gem:
2
+ main_branch_shared_rubocop_config: config/rubocop.yml
10
3
 
4
+ AllCops:
11
5
  # RuboCop enforces rules depending on the oldest version of Ruby which
12
6
  # your project supports:
13
7
  TargetRubyVersion: 3.1
14
8
 
15
- Gemspec/DevelopmentDependencies:
16
- Enabled: false
17
-
18
- Layout/LineLength:
19
- Max: 120
20
-
21
- # The DSL for RSpec and the gemspec file make it very hard to limit block length
22
- Metrics/BlockLength:
23
- Exclude:
24
- - '**/*_spec.rb'
25
- - '*.gemspec'
26
-
27
- Metrics/ModuleLength:
28
- CountAsOne: ['hash']
29
-
30
- Metrics/ClassLength:
31
- CountAsOne: ['hash']
32
-
33
- Style/AsciiComments:
34
- Enabled: false
35
-
36
9
  Style/StderrPuts:
37
10
  Enabled: false
38
11
 
data/CHANGELOG.md CHANGED
@@ -4,6 +4,27 @@ Changes for each release are listed in this file.
4
4
 
5
5
  This project adheres to [Semantic Versioning](https://semver.org/) for its releases.
6
6
 
7
+ ## [0.4.1](https://github.com/main-branch/simplecov-rspec/compare/v0.4.0...v0.4.1) (2025-04-16)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * Automate commit-to-publish workflow ([9594c8e](https://github.com/main-branch/simplecov-rspec/commit/9594c8e1c838e33abc16f844fd0ab4c445c94965))
13
+
14
+ ## v0.4.0 (2024-10-10)
15
+
16
+ [Full Changelog](https://github.com/main-branch/simplecov-rspec/compare/v0.3.2..v0.4.0)
17
+
18
+ Changes since v0.3.2:
19
+
20
+ * e06d866 build: update create_github_release dependency
21
+ * b8aafa3 docs: add conventional commit badge to README
22
+ * 596b217 build: remove semver pr label check
23
+ * bed5192 build: enforce conventional commit message formatting
24
+ * d036188 Clarify gem installation and configuration via env variables
25
+ * 1d89785 Add TargetRubyVersion in .rubocop.yml
26
+ * 2017a2f Use shared Rubocop config
27
+
7
28
  ## v0.3.2 (2024-09-17)
8
29
 
9
30
  [Full Changelog](https://github.com/main-branch/simplecov-rspec/compare/v0.3.1..v0.3.2)
data/README.md CHANGED
@@ -4,8 +4,8 @@
4
4
  [![Documentation](https://img.shields.io/badge/Documentation-Latest-green)](https://rubydoc.info/gems/simplecov-rspec/)
5
5
  [![Change Log](https://img.shields.io/badge/CHANGELOG-Latest-green)](https://rubydoc.info/gems/simplecov-rspec/file/CHANGELOG.md)
6
6
  [![Build Status](https://github.com/main-branch/simplecov-rspec/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/main-branch/simplecov-rspec/actions/workflows/continuous_integration.yml)
7
- [![Maintainability](https://api.codeclimate.com/v1/badges/9a58b51d18910db724c7/maintainability)](https://codeclimate.com/github/main-branch/simplecov-rspec/maintainability)
8
- [![Test Coverage](https://api.codeclimate.com/v1/badges/9a58b51d18910db724c7/test_coverage)](https://codeclimate.com/github/main-branch/simplecov-rspec/test_coverage)
7
+ [![Conventional
8
+ Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
9
9
  [![Slack](https://img.shields.io/badge/slack-main--branch/simplecov--rspec-yellow.svg?logo=slack)](https://main-branch.slack.com/archives/C07MCM9J72B)
10
10
 
11
11
  `simplecov-rspec` is a Ruby gem that integrates SimpleCov with RSpec to ensure your
@@ -31,29 +31,41 @@ If configured to list the lines that were not covered by tests, RSpec will addit
31
31
  ```
32
32
 
33
33
  * [Installation](#installation)
34
- * [Getting Started](#getting-started)
35
- * [Basic Setup](#basic-setup)
36
- * [Configuration from Environment Variables](#configuration-from-environment-variables)
34
+ * [Getting started](#getting-started)
35
+ * [Basic setup](#basic-setup)
36
+ * [Configuration from environment variables](#configuration-from-environment-variables)
37
37
  * [Development](#development)
38
38
  * [Contributing](#contributing)
39
+ * [Commit message guidelines](#commit-message-guidelines)
40
+ * [Pull request guidelines](#pull-request-guidelines)
39
41
  * [License](#license)
40
- * [Code of Conduct](#code-of-conduct)
42
+ * [Code of conduct](#code-of-conduct)
41
43
 
42
44
  ## Installation
43
45
 
44
- Install the gem and add to the application's Gemfile by executing:
46
+ To install the gem, add to the following line to your application's gemspec OR Gemfile:
45
47
 
46
- ```bash
47
- bundle add simplecov-rspec
48
+ gemspec:
49
+
50
+ ```ruby
51
+ spec.add_development_dependency "simplecov-rspec", '~> 0.1'
48
52
  ```
49
53
 
54
+ Gemfile:
55
+
56
+ ```ruby
57
+ gem "simplecov-rspec", "~> 0.1", groups: [:development, :test]
58
+ ```
59
+
60
+ and then run `bundle install`
61
+
50
62
  If bundler is not being used to manage dependencies, install the gem by executing:
51
63
 
52
64
  ```bash
53
65
  gem install simplecov-rspec
54
66
  ```
55
67
 
56
- ## Getting Started
68
+ ## Getting started
57
69
 
58
70
  To use `simplecov-rspec`, follow these steps:
59
71
 
@@ -76,7 +88,7 @@ This will configure RSpec to fail when test coverage falls below 100%.
76
88
 
77
89
  That is it!
78
90
 
79
- ### Basic Setup
91
+ ### Basic setup
80
92
 
81
93
  To initialize simplecov-rspec with defaults, add the following to your `spec_helper.rb`:
82
94
 
@@ -117,11 +129,10 @@ This block is passed on to `SimpleCov::RSpec.start`. See [Configuring
117
129
  SimpleCov](https://github.com/simplecov-ruby/simplecov?tab=readme-ov-file#configuring-simplecov)
118
130
  for details.
119
131
 
120
- ### Configuration from Environment Variables
121
-
122
- Environment variables can be used to set these options as follows:
132
+ ### Configuration from environment variables
123
133
 
124
- You can configure `simplecov-rspec` using the following environment variables:
134
+ Environment variables can be used to configure `simplecov-rspec`. These environment
135
+ variables take presidence over the values passed to `SimpleCov::RSpec.start`.
125
136
 
126
137
  * **`COVERAGE_THRESHOLD`**: Sets the minimum coverage threshold (0-100). Overrides
127
138
  `coverage_threshold`.
@@ -145,8 +156,8 @@ uncovered lines on different platforms than the one you run for local developmen
145
156
  If you want to contribute or experiment with the gem, follow these steps to set up
146
157
  your development environment:
147
158
 
148
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake
149
- spec` to run the tests. You can also run `bin/console` for an interactive prompt that
159
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake`
160
+ to run linting, tests, etc. just like the CI build. You can also run `bin/console` for an interactive prompt that
150
161
  will allow you to experiment.
151
162
 
152
163
  To install this gem onto your local machine, run `bundle exec rake install`. To
@@ -163,12 +174,37 @@ welcoming space for collaboration, and contributors are expected to adhere to th
163
174
  [code of
164
175
  conduct](https://github.com/main-branch/simplecov-rspec/blob/main/CODE_OF_CONDUCT.md).
165
176
 
177
+ ### Commit message guidelines
178
+
179
+ All commit messages must follow the [Conventional Commits
180
+ standard](https://www.conventionalcommits.org/en/v1.0.0/). This helps us maintain a
181
+ clear and structured commit history, automate versioning, and generate changelogs
182
+ effectively.
183
+
184
+ To ensure compliance, this project includes:
185
+
186
+ * A git commit-msg hook that validates your commit messages before they are accepted.
187
+
188
+ To activate the hook, you must have node installed and run `npm install`.
189
+
190
+ * A GitHub Actions workflow that will enforce the Conventional Commit standard as
191
+ part of the continuous integration pipeline.
192
+
193
+ Any commit message that does not conform to the Conventional Commits standard will
194
+ cause the workflow to fail and not allow the PR to be merged.
195
+
196
+ ### Pull request guidelines
197
+
198
+ All pull requests must be merged using rebase merges. This ensures that commit
199
+ messages from the feature branch are preserved in the release branch, keeping the
200
+ history clean and meaningful.
201
+
166
202
  ## License
167
203
 
168
204
  The gem is available as open source under the terms of the [MIT
169
205
  License](https://opensource.org/licenses/MIT).
170
206
 
171
- ## Code of Conduct
207
+ ## Code of conduct
172
208
 
173
209
  Everyone interacting in the Simplecov::Rspec project's codebases, issue trackers,
174
210
  chat rooms and mailing lists is expected to follow the [code of
data/Rakefile CHANGED
@@ -25,6 +25,13 @@ rescue Bundler::BundlerError => e
25
25
  exit e.status_code
26
26
  end
27
27
 
28
+ # Make it so that calling `rake release` just calls `rake release:rubygems_push` to
29
+ # avoid creating and pushing a new tag.
30
+
31
+ Rake::Task['release'].clear
32
+ desc 'Customized release task to avoid creating a new tag'
33
+ task release: 'release:rubygem_push'
34
+
28
35
  CLEAN << 'pkg'
29
36
  CLOBBER << 'Gemfile.lock'
30
37
 
@@ -44,14 +51,9 @@ CLEAN << 'rspec-report.xml'
44
51
 
45
52
  require 'rubocop/rake_task'
46
53
 
47
- RuboCop::RakeTask.new do |t|
48
- t.options = %w[
49
- --format progress
50
- --format json --out rubocop-report.json
51
- ]
52
- end
54
+ RuboCop::RakeTask.new
53
55
 
54
- CLEAN << 'rubocop-report.json'
56
+ # YARD
55
57
 
56
58
  unless RUBY_PLATFORM == 'java'
57
59
  # yard:build
@@ -3,6 +3,6 @@
3
3
  module Simplecov
4
4
  class Rspec
5
5
  # This gem's version
6
- VERSION = '0.3.2'
6
+ VERSION = '0.4.1'
7
7
  end
8
8
  end
@@ -231,6 +231,21 @@ module SimpleCov
231
231
  #
232
232
  def rspec_dry_run? = @rspec_dry_run
233
233
 
234
+ # An uncovered line
235
+ #
236
+ # @!attribute project_filename [rw]
237
+ # The path to the file with uncovered lines relative to the project root
238
+ # @return [String]
239
+ # @api private
240
+ #
241
+ # @!attribute line_number [rw]
242
+ # The line number of the uncovered line
243
+ # @return [Integer]
244
+ # @api private
245
+ #
246
+ # @api private
247
+ UncoveredLine = Struct.new(:project_filename, :line_number)
248
+
234
249
  private
235
250
 
236
251
  # rubocop:disable Metrics/ParameterLists
@@ -323,21 +338,6 @@ module SimpleCov
323
338
  # @private
324
339
  def show_uncovered_lines_report? = list_uncovered_lines? && uncovered_lines_found?
325
340
 
326
- # An uncovered line
327
- #
328
- # @!attribute project_filename [rw]
329
- # The path to the file with uncovered lines relative to the project root
330
- # @return [String]
331
- # @api private
332
- #
333
- # @!attribute line_number [rw]
334
- # The line number of the uncovered line
335
- # @return [Integer]
336
- # @api private
337
- #
338
- # @api private
339
- UncoveredLine = Struct.new(:project_filename, :line_number)
340
-
341
341
  # Return the uncovered lines from the SimpleCov result
342
342
  # @return [Array<UncoveredLine>]
343
343
  # @api private
data/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "devDependencies": {
3
+ "@commitlint/cli": "^19.5.0",
4
+ "@commitlint/config-conventional": "^19.5.0",
5
+ "husky": "^9.1.0"
6
+ },
7
+ "scripts": {
8
+ "postinstall": "husky",
9
+ "prepare": "husky"
10
+ }
11
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "bootstrap-sha": "1024da0c250fa409d5f5f99d2f1dfd27bd1a1aab",
3
+ "packages": {
4
+ ".": {
5
+ "release-type": "ruby",
6
+ "package-name": "simplecov-rspec",
7
+ "changelog-path": "CHANGELOG.md",
8
+ "version-file": "lib/simplecov-rspec/version.rb",
9
+ "bump-minor-pre-major": true,
10
+ "bump-patch-for-minor-pre-major": true,
11
+ "draft": false,
12
+ "prerelease": false,
13
+ "include-component-in-tag": false
14
+ }
15
+ },
16
+ "plugins": [
17
+ {
18
+ "type": "sentence-case"
19
+ }
20
+ ],
21
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
22
+ }
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Couball
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-09-17 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: simplecov
@@ -44,14 +43,14 @@ dependencies:
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: '1.5'
46
+ version: '2.1'
48
47
  type: :development
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - "~>"
53
52
  - !ruby/object:Gem::Version
54
- version: '1.5'
53
+ version: '2.1'
55
54
  - !ruby/object:Gem::Dependency
56
55
  name: fuubar
57
56
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +65,20 @@ dependencies:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
67
  version: '2.5'
68
+ - !ruby/object:Gem::Dependency
69
+ name: main_branch_shared_rubocop_config
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '0.1'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0.1'
69
82
  - !ruby/object:Gem::Dependency
70
83
  name: rake
71
84
  requirement: !ruby/object:Gem::Requirement
@@ -194,7 +207,10 @@ executables: []
194
207
  extensions: []
195
208
  extra_rdoc_files: []
196
209
  files:
210
+ - ".commitlintrc.yml"
211
+ - ".husky/commit-msg"
197
212
  - ".markdownlint.yml"
213
+ - ".release-please-manifest.json"
198
214
  - ".rspec"
199
215
  - ".rubocop.yml"
200
216
  - ".yardopts"
@@ -205,6 +221,8 @@ files:
205
221
  - Rakefile
206
222
  - lib/simplecov-rspec.rb
207
223
  - lib/simplecov-rspec/version.rb
224
+ - package.json
225
+ - release-please-config.json
208
226
  homepage: https://github.com/main-branch/simplecov-rspec
209
227
  licenses:
210
228
  - MIT
@@ -212,10 +230,9 @@ metadata:
212
230
  allowed_push_host: https://rubygems.org
213
231
  homepage_uri: https://github.com/main-branch/simplecov-rspec
214
232
  source_code_uri: https://github.com/main-branch/simplecov-rspec
215
- documentation_uri: https://rubydoc.info/gems/simplecov-rspec/0.3.2
216
- changelog_uri: https://rubydoc.info/gems/simplecov-rspec/0.3.2/file/CHANGELOG.md
233
+ documentation_uri: https://rubydoc.info/gems/simplecov-rspec/0.4.1
234
+ changelog_uri: https://rubydoc.info/gems/simplecov-rspec/0.4.1/file/CHANGELOG.md
217
235
  rubygems_mfa_required: 'true'
218
- post_install_message:
219
236
  rdoc_options: []
220
237
  require_paths:
221
238
  - lib
@@ -232,8 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
249
  requirements:
233
250
  - 'Platform: Mac, Linux, or Windows'
234
251
  - 'Ruby: MRI 3.1 or later, TruffleRuby 24 or later, or JRuby 9.4 or later'
235
- rubygems_version: 3.5.16
236
- signing_key:
252
+ rubygems_version: 3.6.7
237
253
  specification_version: 4
238
254
  summary: Configure SimpleCov to fail RSpec if the test coverage falls below a given
239
255
  threshold