sevencop 0.43.1 → 0.45.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0cfed8aa90917558e096385531b8d1b7f24794cb41b2153763fe1c217f0f84f7
4
- data.tar.gz: 258f17c6bf2c728943af990aca94d21cdb41de6b8a0d227abfcf4c874fa63fe6
3
+ metadata.gz: 6397930dce89363902d194be1a0b259969d18fcf1224068130f9959178c77ff8
4
+ data.tar.gz: 51efafab1bd74a671469f4aca611d47892a9cefd3d862ce9795e444b57bbffca
5
5
  SHA512:
6
- metadata.gz: 56f863333bae7ab6cc68af8227a8177c2f7160ae40dbcf1f4a2cc5387014e0241cbfff0230fbc9295638bb60fd49511adbe25bf52a968a2b84a026504e6fd394
7
- data.tar.gz: bbb45e0b9d173fed7c302973b807453f6b27ea42e00057633d70375f6fc949954b73c1f10434dfdc457e393147860e84b0a9062bae86295b278dbb810be2df18
6
+ metadata.gz: 255171a35cbf105447f400f82e8ecce903a478a9b9dd3fff3e270ad9ee4b78a72c7f66502bfbae9c3d02d717a6787cc40d97a1f608c587563566b6d96f613a2d
7
+ data.tar.gz: 5a985d8e7ffd6fe1442f1f8992987618878bacbde3ea36137cb68d36340f66149d94653cd14e3bfe6640dc877eafbef34874514b59271d8ce58df7adfaf69dc4
data/.rubocop.yml CHANGED
@@ -7,8 +7,7 @@ require:
7
7
 
8
8
  AllCops:
9
9
  NewCops: enable
10
- SuggestExtensions: false
11
- TargetRubyVersion: 2.6
10
+ TargetRubyVersion: 2.7
12
11
 
13
12
  Gemspec/RequireMFA:
14
13
  Enabled: false
@@ -34,16 +33,6 @@ RSpec:
34
33
  RSpec/ExampleLength:
35
34
  Enabled: false
36
35
 
37
- RSpec/FilePath:
38
- CustomTransform:
39
- RSpecDescribeHttpEndpoint: rspec_describe_http_endpoint
40
- RSpecEmptyLineAfterLet: rspec_empty_line_after_let
41
- RSpecExamplesInSameGroup: rspec_examples_in_same_group
42
- RSpecMatcherConsistentParentheses: rspec_matcher_consistent_parentheses
43
- RSpecMemoizedHelperBlockDelimiter: rspec_memoized_helper_block_delimiter
44
- RSpecRailsHaveHttpStatus: rspec_rails_have_http_status
45
- RSpecRailsStatusCodeCheckBySubject: rspec_rails_status_code_check_by_subject
46
-
47
36
  RSpec/MultipleExpectations:
48
37
  Enabled: false
49
38
 
@@ -54,6 +43,7 @@ RSpec/SpecFilePathFormat:
54
43
  RSpecExamplesInSameGroup: rspec_examples_in_same_group
55
44
  RSpecMatcherConsistentParentheses: rspec_matcher_consistent_parentheses
56
45
  RSpecMemoizedHelperBlockDelimiter: rspec_memoized_helper_block_delimiter
46
+ RSpecPendingOnlyExampleGroup: rspec_pending_only_example_group
57
47
  RSpecRailsHaveHttpStatus: rspec_rails_have_http_status
58
48
  RSpecRailsStatusCodeCheckBySubject: rspec_rails_status_code_check_by_subject
59
49
 
data/Gemfile CHANGED
@@ -6,8 +6,13 @@ source 'https://rubygems.org'
6
6
  gemspec
7
7
 
8
8
  gem 'rake'
9
- gem 'rspec'
10
- gem 'rubocop'
11
- gem 'rubocop-performance'
12
- gem 'rubocop-rake'
13
- gem 'rubocop-rspec'
9
+
10
+ group :rubocop do
11
+ gem 'rubocop-performance'
12
+ gem 'rubocop-rake'
13
+ gem 'rubocop-rspec'
14
+ end
15
+
16
+ group :test do
17
+ gem 'rspec'
18
+ end
data/Gemfile.lock CHANGED
@@ -1,96 +1,90 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sevencop (0.43.1)
4
+ sevencop (0.45.0)
5
5
  activesupport
6
6
  rubocop
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (7.1.3.3)
11
+ activesupport (7.2.1)
12
12
  base64
13
13
  bigdecimal
14
- concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ concurrent-ruby (~> 1.0, >= 1.3.1)
15
15
  connection_pool (>= 2.2.5)
16
16
  drb
17
17
  i18n (>= 1.6, < 2)
18
+ logger (>= 1.4.2)
18
19
  minitest (>= 5.1)
19
- mutex_m
20
- tzinfo (~> 2.0)
20
+ securerandom (>= 0.3)
21
+ tzinfo (~> 2.0, >= 2.0.5)
21
22
  ast (2.4.2)
22
23
  base64 (0.2.0)
23
24
  bigdecimal (3.1.8)
24
- concurrent-ruby (1.2.3)
25
+ concurrent-ruby (1.3.4)
25
26
  connection_pool (2.4.1)
26
- diff-lcs (1.5.0)
27
+ diff-lcs (1.5.1)
27
28
  drb (2.2.1)
28
29
  i18n (1.14.5)
29
30
  concurrent-ruby (~> 1.0)
30
- json (2.7.1)
31
+ json (2.7.2)
31
32
  language_server-protocol (3.17.0.3)
32
- minitest (5.23.1)
33
- mutex_m (0.2.0)
34
- parallel (1.24.0)
35
- parser (3.3.0.5)
33
+ logger (1.6.1)
34
+ minitest (5.25.1)
35
+ parallel (1.26.3)
36
+ parser (3.3.5.0)
36
37
  ast (~> 2.4.1)
37
38
  racc
38
- racc (1.7.3)
39
+ racc (1.8.1)
39
40
  rainbow (3.1.1)
40
- rake (13.1.0)
41
- regexp_parser (2.9.0)
42
- rexml (3.2.6)
43
- rspec (3.12.0)
44
- rspec-core (~> 3.12.0)
45
- rspec-expectations (~> 3.12.0)
46
- rspec-mocks (~> 3.12.0)
47
- rspec-core (3.12.2)
48
- rspec-support (~> 3.12.0)
49
- rspec-expectations (3.12.3)
41
+ rake (13.2.1)
42
+ regexp_parser (2.9.2)
43
+ rspec (3.13.0)
44
+ rspec-core (~> 3.13.0)
45
+ rspec-expectations (~> 3.13.0)
46
+ rspec-mocks (~> 3.13.0)
47
+ rspec-core (3.13.1)
48
+ rspec-support (~> 3.13.0)
49
+ rspec-expectations (3.13.2)
50
50
  diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.12.0)
52
- rspec-mocks (3.12.6)
51
+ rspec-support (~> 3.13.0)
52
+ rspec-mocks (3.13.1)
53
53
  diff-lcs (>= 1.2.0, < 2.0)
54
- rspec-support (~> 3.12.0)
55
- rspec-support (3.12.1)
56
- rubocop (1.60.2)
54
+ rspec-support (~> 3.13.0)
55
+ rspec-support (3.13.1)
56
+ rubocop (1.66.1)
57
57
  json (~> 2.3)
58
58
  language_server-protocol (>= 3.17.0)
59
59
  parallel (~> 1.10)
60
60
  parser (>= 3.3.0.2)
61
61
  rainbow (>= 2.2.2, < 4.0)
62
- regexp_parser (>= 1.8, < 3.0)
63
- rexml (>= 3.2.5, < 4.0)
64
- rubocop-ast (>= 1.30.0, < 2.0)
62
+ regexp_parser (>= 2.4, < 3.0)
63
+ rubocop-ast (>= 1.32.2, < 2.0)
65
64
  ruby-progressbar (~> 1.7)
66
65
  unicode-display_width (>= 2.4.0, < 3.0)
67
- rubocop-ast (1.30.0)
68
- parser (>= 3.2.1.0)
69
- rubocop-capybara (2.20.0)
70
- rubocop (~> 1.41)
71
- rubocop-factory_bot (2.25.1)
72
- rubocop (~> 1.41)
73
- rubocop-performance (1.20.2)
66
+ rubocop-ast (1.32.3)
67
+ parser (>= 3.3.1.0)
68
+ rubocop-performance (1.21.1)
74
69
  rubocop (>= 1.48.1, < 2.0)
75
- rubocop-ast (>= 1.30.0, < 2.0)
70
+ rubocop-ast (>= 1.31.1, < 2.0)
76
71
  rubocop-rake (0.6.0)
77
72
  rubocop (~> 1.0)
78
- rubocop-rspec (2.26.1)
79
- rubocop (~> 1.40)
80
- rubocop-capybara (~> 2.17)
81
- rubocop-factory_bot (~> 2.22)
73
+ rubocop-rspec (3.0.4)
74
+ rubocop (~> 1.61)
82
75
  ruby-progressbar (1.13.0)
76
+ securerandom (0.3.1)
83
77
  tzinfo (2.0.6)
84
78
  concurrent-ruby (~> 1.0)
85
79
  unicode-display_width (2.5.0)
86
80
 
87
81
  PLATFORMS
82
+ ruby
88
83
  x86_64-linux
89
84
 
90
85
  DEPENDENCIES
91
86
  rake
92
87
  rspec
93
- rubocop
94
88
  rubocop-performance
95
89
  rubocop-rake
96
90
  rubocop-rspec
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # sevencop
2
2
 
3
- [![test](https://github.com/r7kamura/sevencop/actions/workflows/test.yml/badge.svg)](https://github.com/r7kamura/sevencop/actions/workflows/test.yml)
3
+ [![CI](https://github.com/r7kamura/sevencop/actions/workflows/ci.yml/badge.svg)](https://github.com/r7kamura/sevencop/actions/workflows/ci.yml)
4
4
 
5
5
  Opinionated custom cops for [RuboCop](https://github.com/rubocop/rubocop).
6
6
 
@@ -49,6 +49,7 @@ Note that all cops are `Enabled: false` by default.
49
49
  - [Sevencop/RSpecExamplesInSameGroup](lib/rubocop/cop/sevencop/rspec_examples_in_same_group.rb)
50
50
  - [Sevencop/RSpecMatcherConsistentParentheses](lib/rubocop/cop/sevencop/rspec_matcher_consistent_parentheses.rb)
51
51
  - [Sevencop/RSpecMemoizedHelperBlockDelimiter](lib/rubocop/cop/sevencop/rspec_memoized_helper_block_delimiter.rb)
52
+ - [Sevencop/RSpecPendingOnlyExampleGroup](lib/rubocop/cop/sevencop/rspec_pending_only_example_group.rb)
52
53
  - [Sevencop/RSpecRailsHaveHttpStatus](lib/rubocop/cop/sevencop/rspec_rails_have_http_status.rb)
53
54
  - [Sevencop/RSpecRailsStatusCodeCheckBySubject](lib/rubocop/cop/sevencop/rspec_rails_status_code_check_by_subject.rb)
54
55
 
data/config/default.yml CHANGED
@@ -142,6 +142,12 @@ Sevencop/RSpecMemoizedHelperBlockDelimiter:
142
142
  Include:
143
143
  - "**/spec/**/*.rb"
144
144
 
145
+ Sevencop/RSpecPendingOnlyExampleGroup:
146
+ Description: Remove pending-only test files.
147
+ Enabled: false
148
+ Include:
149
+ - "**/spec/**/*.rb"
150
+
145
151
  Sevencop/RSpecRailsHaveHttpStatus:
146
152
  Description: |
147
153
  Always check status code with `have_http_status`.
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Sevencop
6
+ # Remove pending-only test files.
7
+ #
8
+ # @example
9
+ # # bad
10
+ # RSpec.describe Post do
11
+ # pending "add some examples to (or delete) #{__FILE__}"
12
+ # end
13
+ class RSpecPendingOnlyExampleGroup < ::RuboCop::Cop::Base
14
+ MSG = 'Remove pending-only test files.'
15
+
16
+ RESTRICT_ON_SEND = %i[
17
+ describe
18
+ ].freeze
19
+
20
+ def on_send(node)
21
+ block_node = node.parent
22
+ return unless pending_only_example_group?(block_node)
23
+
24
+ add_offense(block_node)
25
+ end
26
+
27
+ private
28
+
29
+ # @!method pending_only_example_group?(node)
30
+ def_node_matcher :pending_only_example_group?, <<~PATTERN
31
+ (block
32
+ (send (const nil? :RSpec) :describe ...)
33
+ (args)
34
+ (send nil? :pending ...)
35
+ )
36
+ PATTERN
37
+ end
38
+ end
39
+ end
40
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sevencop
4
- VERSION = '0.43.1'
4
+ VERSION = '0.45.0'
5
5
  end
data/lib/sevencop.rb CHANGED
@@ -25,5 +25,6 @@ require_relative 'rubocop/cop/sevencop/rspec_empty_line_after_let'
25
25
  require_relative 'rubocop/cop/sevencop/rspec_examples_in_same_group'
26
26
  require_relative 'rubocop/cop/sevencop/rspec_matcher_consistent_parentheses'
27
27
  require_relative 'rubocop/cop/sevencop/rspec_memoized_helper_block_delimiter'
28
+ require_relative 'rubocop/cop/sevencop/rspec_pending_only_example_group'
28
29
  require_relative 'rubocop/cop/sevencop/rspec_rails_have_http_status'
29
30
  require_relative 'rubocop/cop/sevencop/rspec_rails_status_code_check_by_subject'
data/sevencop.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = 'Opinionated custom cops for RuboCop.'
12
12
  spec.homepage = 'https://github.com/r7kamura/sevencop'
13
13
  spec.license = 'MIT'
14
- spec.required_ruby_version = '>= 2.6.0'
14
+ spec.required_ruby_version = '>= 2.7'
15
15
 
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
  spec.metadata['source_code_uri'] = spec.homepage
@@ -28,6 +28,6 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ['lib']
30
30
 
31
- spec.add_runtime_dependency 'activesupport'
32
- spec.add_runtime_dependency 'rubocop'
31
+ spec.add_dependency 'activesupport'
32
+ spec.add_dependency 'rubocop'
33
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sevencop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.43.1
4
+ version: 0.45.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-29 00:00:00.000000000 Z
11
+ date: 2024-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -77,6 +77,7 @@ files:
77
77
  - lib/rubocop/cop/sevencop/rspec_examples_in_same_group.rb
78
78
  - lib/rubocop/cop/sevencop/rspec_matcher_consistent_parentheses.rb
79
79
  - lib/rubocop/cop/sevencop/rspec_memoized_helper_block_delimiter.rb
80
+ - lib/rubocop/cop/sevencop/rspec_pending_only_example_group.rb
80
81
  - lib/rubocop/cop/sevencop/rspec_rails_have_http_status.rb
81
82
  - lib/rubocop/cop/sevencop/rspec_rails_status_code_check_by_subject.rb
82
83
  - lib/sevencop.rb
@@ -101,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
102
  requirements:
102
103
  - - ">="
103
104
  - !ruby/object:Gem::Version
104
- version: 2.6.0
105
+ version: '2.7'
105
106
  required_rubygems_version: !ruby/object:Gem::Requirement
106
107
  requirements:
107
108
  - - ">="