sevencop 0.47.0 → 0.48.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 (28) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -4
  3. data/Gemfile.lock +45 -35
  4. data/README.md +2 -2
  5. data/lib/rubocop/cop/sevencop/autoload_ordered.rb +1 -0
  6. data/lib/rubocop/cop/sevencop/bundler_gem_group_name_ordered.rb +1 -0
  7. data/lib/rubocop/cop/sevencop/bundler_gem_group_ordered.rb +1 -0
  8. data/lib/rubocop/cop/sevencop/map_method_chain.rb +1 -0
  9. data/lib/rubocop/cop/sevencop/method_definition_in_included.rb +1 -1
  10. data/lib/rubocop/cop/sevencop/rails_belongs_to_optional.rb +1 -0
  11. data/lib/rubocop/cop/sevencop/rails_date_and_time_calculation.rb +1 -0
  12. data/lib/rubocop/cop/sevencop/rails_order_field_arel_sql.rb +1 -0
  13. data/lib/rubocop/cop/sevencop/rails_order_field_in_order_of.rb +1 -0
  14. data/lib/rubocop/cop/sevencop/rails_route_as.rb +1 -0
  15. data/lib/rubocop/cop/sevencop/rails_route_ordered.rb +1 -0
  16. data/lib/rubocop/cop/sevencop/rails_uniqueness_validator_explicit_case_sensitivity.rb +1 -0
  17. data/lib/rubocop/cop/sevencop/rails_where_not.rb +1 -0
  18. data/lib/rubocop/cop/sevencop/rspec_describe_http_endpoint.rb +1 -0
  19. data/lib/rubocop/cop/sevencop/rspec_examples_in_same_group.rb +1 -0
  20. data/lib/rubocop/cop/sevencop/rspec_matcher_consistent_parentheses.rb +1 -0
  21. data/lib/rubocop/cop/sevencop/rspec_pending_only_example_group.rb +1 -0
  22. data/lib/rubocop/cop/sevencop/rspec_rails_status_code_check_by_subject.rb +1 -0
  23. data/lib/sevencop/plugin.rb +28 -0
  24. data/lib/sevencop/version.rb +1 -1
  25. data/lib/sevencop.rb +1 -1
  26. data/sevencop.gemspec +3 -1
  27. metadata +20 -5
  28. data/lib/sevencop/rubocop_extension.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db46ba38fdc0d8ef6df4fb827b79f7220c892eec33ff114f5e677111823f1efc
4
- data.tar.gz: 4d46e8333f113a6470c2d36b3860ee343a8926d5f8653b9943c85eb317f6e61d
3
+ metadata.gz: c030a278dafeed8771940f8697c6d720961c4cd4c56971e9b160efdeaaec5c48
4
+ data.tar.gz: 1f8e34a388af236e0e507908b32c8415734ebacd56da6077a2bc8ec24d3cb9d9
5
5
  SHA512:
6
- metadata.gz: 5c3542c01fbfc87e90e46f99b69f51375ec2ba0190c1c4050d0c5648bb667a48e7be59fd776f682c92a2e6f4c113685b7c6c766495f5620c05f6de16b8ed0fd8
7
- data.tar.gz: 86fd40ac5d566774269fd2a96d93ee62ced6c0df556b8cc76879e04e68ed3919070787092930ed897e133fd7c6680d8a56d429d370ad27f8d9c6be1fcfe89ad8
6
+ metadata.gz: b1183c9c92492194bb05064d598181a839f6ecce9a20db75275a3ab02c730fd03f9f1d44975089650e02be6fb2a828f75fc678bef94ce57f2dd92f14e67273be
7
+ data.tar.gz: 9aca03eab64515ed5605d252900d6e12fed67ef0a46dca03a193125442acafcac137a7cbb96cf8d933b663d1aff806abf68b701ad7cf1a341f2c0a6c3dda9f29
data/.rubocop.yml CHANGED
@@ -1,9 +1,9 @@
1
- require:
2
- - rubocop/cop/internal_affairs
1
+ plugins:
2
+ - rubocop-internal_affairs
3
+ - rubocop-rspec
3
4
  - rubocop-performance
4
5
  - rubocop-rake
5
- - rubocop-rspec
6
- - ./lib/sevencop
6
+ - sevencop
7
7
 
8
8
  AllCops:
9
9
  NewCops: enable
data/Gemfile.lock CHANGED
@@ -1,14 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sevencop (0.47.0)
4
+ sevencop (0.48.0)
5
5
  activesupport
6
- rubocop
6
+ lint_roller (>= 1.1)
7
+ rubocop (>= 1.72.1)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
- activesupport (7.2.2)
12
+ activesupport (7.2.2.1)
12
13
  base64
13
14
  benchmark (>= 0.3)
14
15
  bigdecimal
@@ -20,65 +21,74 @@ GEM
20
21
  minitest (>= 5.1)
21
22
  securerandom (>= 0.3)
22
23
  tzinfo (~> 2.0, >= 2.0.5)
23
- ast (2.4.2)
24
+ ast (2.4.3)
24
25
  base64 (0.2.0)
25
26
  benchmark (0.4.0)
26
- bigdecimal (3.1.8)
27
- concurrent-ruby (1.3.4)
28
- connection_pool (2.4.1)
29
- diff-lcs (1.5.1)
27
+ bigdecimal (3.1.9)
28
+ concurrent-ruby (1.3.5)
29
+ connection_pool (2.5.0)
30
+ diff-lcs (1.6.1)
30
31
  drb (2.2.1)
31
- i18n (1.14.6)
32
+ i18n (1.14.7)
32
33
  concurrent-ruby (~> 1.0)
33
- json (2.7.2)
34
- language_server-protocol (3.17.0.3)
35
- logger (1.6.2)
36
- minitest (5.25.4)
34
+ json (2.10.2)
35
+ language_server-protocol (3.17.0.4)
36
+ lint_roller (1.1.0)
37
+ logger (1.7.0)
38
+ minitest (5.25.5)
37
39
  parallel (1.26.3)
38
- parser (3.3.5.0)
40
+ parser (3.3.7.4)
39
41
  ast (~> 2.4.1)
40
42
  racc
43
+ prism (1.4.0)
41
44
  racc (1.8.1)
42
45
  rainbow (3.1.1)
43
46
  rake (13.2.1)
44
- regexp_parser (2.9.2)
47
+ regexp_parser (2.10.0)
45
48
  rspec (3.13.0)
46
49
  rspec-core (~> 3.13.0)
47
50
  rspec-expectations (~> 3.13.0)
48
51
  rspec-mocks (~> 3.13.0)
49
- rspec-core (3.13.1)
52
+ rspec-core (3.13.3)
50
53
  rspec-support (~> 3.13.0)
51
- rspec-expectations (3.13.2)
54
+ rspec-expectations (3.13.3)
52
55
  diff-lcs (>= 1.2.0, < 2.0)
53
56
  rspec-support (~> 3.13.0)
54
- rspec-mocks (3.13.1)
57
+ rspec-mocks (3.13.2)
55
58
  diff-lcs (>= 1.2.0, < 2.0)
56
59
  rspec-support (~> 3.13.0)
57
- rspec-support (3.13.1)
58
- rubocop (1.66.1)
60
+ rspec-support (3.13.2)
61
+ rubocop (1.75.2)
59
62
  json (~> 2.3)
60
- language_server-protocol (>= 3.17.0)
63
+ language_server-protocol (~> 3.17.0.2)
64
+ lint_roller (~> 1.1.0)
61
65
  parallel (~> 1.10)
62
66
  parser (>= 3.3.0.2)
63
67
  rainbow (>= 2.2.2, < 4.0)
64
- regexp_parser (>= 2.4, < 3.0)
65
- rubocop-ast (>= 1.32.2, < 2.0)
68
+ regexp_parser (>= 2.9.3, < 3.0)
69
+ rubocop-ast (>= 1.44.0, < 2.0)
66
70
  ruby-progressbar (~> 1.7)
67
- unicode-display_width (>= 2.4.0, < 3.0)
68
- rubocop-ast (1.32.3)
69
- parser (>= 3.3.1.0)
70
- rubocop-performance (1.21.1)
71
- rubocop (>= 1.48.1, < 2.0)
72
- rubocop-ast (>= 1.31.1, < 2.0)
73
- rubocop-rake (0.6.0)
74
- rubocop (~> 1.0)
75
- rubocop-rspec (3.0.4)
76
- rubocop (~> 1.61)
71
+ unicode-display_width (>= 2.4.0, < 4.0)
72
+ rubocop-ast (1.44.0)
73
+ parser (>= 3.3.7.2)
74
+ prism (~> 1.4)
75
+ rubocop-performance (1.25.0)
76
+ lint_roller (~> 1.1)
77
+ rubocop (>= 1.75.0, < 2.0)
78
+ rubocop-ast (>= 1.38.0, < 2.0)
79
+ rubocop-rake (0.7.1)
80
+ lint_roller (~> 1.1)
81
+ rubocop (>= 1.72.1)
82
+ rubocop-rspec (3.5.0)
83
+ lint_roller (~> 1.1)
84
+ rubocop (~> 1.72, >= 1.72.1)
77
85
  ruby-progressbar (1.13.0)
78
- securerandom (0.4.0)
86
+ securerandom (0.4.1)
79
87
  tzinfo (2.0.6)
80
88
  concurrent-ruby (~> 1.0)
81
- unicode-display_width (2.5.0)
89
+ unicode-display_width (3.1.4)
90
+ unicode-emoji (~> 4.0, >= 4.0.4)
91
+ unicode-emoji (4.0.4)
82
92
 
83
93
  PLATFORMS
84
94
  ruby
data/README.md CHANGED
@@ -13,11 +13,11 @@ Install `sevencop` gem:
13
13
  gem 'sevencop', require: false
14
14
  ```
15
15
 
16
- then require `sevencop` and enable the cops you want to use on .rubocop.yml:
16
+ then add `sevencop` and enable the cops you want to use on .rubocop.yml:
17
17
 
18
18
  ```yaml
19
19
  # .rubocop.yml
20
- require:
20
+ plugins:
21
21
  - sevencop
22
22
 
23
23
  Sevencop/MethodDefinitionOrdered:
@@ -47,6 +47,7 @@ module RuboCop
47
47
  )
48
48
  end
49
49
  end
50
+ alias on_csend on_send
50
51
 
51
52
  private
52
53
 
@@ -40,6 +40,7 @@ module RuboCop
40
40
  end
41
41
  end
42
42
  end
43
+ alias on_csend on_send
43
44
 
44
45
  private
45
46
 
@@ -55,6 +55,7 @@ module RuboCop
55
55
  )
56
56
  end
57
57
  end
58
+ alias on_csend on_send
58
59
 
59
60
  private
60
61
 
@@ -49,6 +49,7 @@ module RuboCop
49
49
 
50
50
  ignore_node(node)
51
51
  end
52
+ alias on_csend on_send
52
53
 
53
54
  private
54
55
 
@@ -71,7 +71,7 @@ module RuboCop
71
71
  if node.parent&.block_type?
72
72
  node.parent if node.parent.method?(:included)
73
73
  elsif node.parent&.begin_type?
74
- node.parent.parent if node.parent.parent&.block_type? && node.parent.parent&.method?(:included)
74
+ node.parent.parent if node.parent.parent&.block_type? && node.parent.parent.method?(:included)
75
75
  end
76
76
  end
77
77
 
@@ -51,6 +51,7 @@ module RuboCop
51
51
  corrector.insert_after(node.last_argument, ', optional: true')
52
52
  end
53
53
  end
54
+ alias on_csend on_send
54
55
  end
55
56
  end
56
57
  end
@@ -178,6 +178,7 @@ module RuboCop
178
178
  check_yesterday(node)
179
179
  end
180
180
  end
181
+ alias on_csend on_send
181
182
 
182
183
  private
183
184
 
@@ -56,6 +56,7 @@ module RuboCop
56
56
  )
57
57
  end
58
58
  end
59
+ alias on_csend on_send
59
60
  end
60
61
  end
61
62
  end
@@ -109,6 +109,7 @@ module RuboCop
109
109
  autocorrect(corrector, node)
110
110
  end
111
111
  end
112
+ alias on_csend on_send
112
113
 
113
114
  private
114
115
 
@@ -34,6 +34,7 @@ module RuboCop
34
34
 
35
35
  add_offense(node)
36
36
  end
37
+ alias on_csend on_send
37
38
  end
38
39
  end
39
40
  end
@@ -51,6 +51,7 @@ module RuboCop
51
51
  )
52
52
  end
53
53
  end
54
+ alias on_csend on_send
54
55
 
55
56
  private
56
57
 
@@ -52,6 +52,7 @@ module RuboCop
52
52
  end
53
53
  end
54
54
  end
55
+ alias on_csend on_send
55
56
 
56
57
  private
57
58
 
@@ -40,6 +40,7 @@ module RuboCop
40
40
  end
41
41
  end
42
42
  end
43
+ alias on_csend on_send
43
44
  end
44
45
  end
45
46
  end
@@ -42,6 +42,7 @@ module RuboCop
42
42
 
43
43
  add_offense(node.first_argument)
44
44
  end
45
+ alias on_csend on_send
45
46
 
46
47
  private
47
48
 
@@ -69,6 +69,7 @@ module RuboCop
69
69
 
70
70
  add_offense(node)
71
71
  end
72
+ alias on_csend on_send
72
73
 
73
74
  private
74
75
 
@@ -30,6 +30,7 @@ module RuboCop
30
30
  add_parentheses(first_argument, corrector)
31
31
  end
32
32
  end
33
+ alias on_csend on_send
33
34
 
34
35
  private
35
36
 
@@ -23,6 +23,7 @@ module RuboCop
23
23
 
24
24
  add_offense(block_node)
25
25
  end
26
+ alias on_csend on_send
26
27
 
27
28
  private
28
29
 
@@ -37,6 +37,7 @@ module RuboCop
37
37
  corrector.replace(node.first_argument.location.selector, 'have_http_status')
38
38
  end
39
39
  end
40
+ alias on_csend on_send
40
41
 
41
42
  private
42
43
 
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lint_roller'
4
+
5
+ module Sevencop
6
+ class Plugin < ::LintRoller::Plugin
7
+ def about
8
+ ::LintRoller::About.new(
9
+ description: 'Opinionated custom cops for RuboCop.',
10
+ homepage: 'https://github.com/r7kamura/sevencop',
11
+ name: 'sevencop',
12
+ version: VERSION
13
+ )
14
+ end
15
+
16
+ def rules(_context)
17
+ ::LintRoller::Rules.new(
18
+ config_format: :rubocop,
19
+ type: :path,
20
+ value: "#{__dir__}/../../config/default.yml"
21
+ )
22
+ end
23
+
24
+ def supported?(context)
25
+ context.engine == :rubocop
26
+ end
27
+ end
28
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sevencop
4
- VERSION = '0.47.0'
4
+ VERSION = '0.48.0'
5
5
  end
data/lib/sevencop.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'sevencop/cop_concerns'
4
- require_relative 'sevencop/rubocop_extension'
4
+ require_relative 'sevencop/plugin'
5
5
  require_relative 'sevencop/version'
6
6
 
7
7
  require_relative 'rubocop/cop/sevencop/autoload_ordered'
data/sevencop.gemspec CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
  spec.metadata['source_code_uri'] = spec.homepage
18
18
  spec.metadata['changelog_uri'] = "#{spec.homepage}/releases"
19
+ spec.metadata['default_lint_roller_plugin'] = 'Sevencop::Plugin'
19
20
 
20
21
  # Specify which files should be added to the gem when it is released.
21
22
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -29,5 +30,6 @@ Gem::Specification.new do |spec|
29
30
  spec.require_paths = ['lib']
30
31
 
31
32
  spec.add_dependency 'activesupport'
32
- spec.add_dependency 'rubocop'
33
+ spec.add_dependency 'lint_roller', '>= 1.1'
34
+ spec.add_dependency 'rubocop', '>= 1.72.1'
33
35
  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.47.0
4
+ version: 0.48.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-12-05 00:00:00.000000000 Z
11
+ date: 2025-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -24,20 +24,34 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: lint_roller
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rubocop
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - ">="
32
46
  - !ruby/object:Gem::Version
33
- version: '0'
47
+ version: 1.72.1
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - ">="
39
53
  - !ruby/object:Gem::Version
40
- version: '0'
54
+ version: 1.72.1
41
55
  description:
42
56
  email:
43
57
  - r7kamura@gmail.com
@@ -85,7 +99,7 @@ files:
85
99
  - lib/sevencop/config_loader.rb
86
100
  - lib/sevencop/cop_concerns.rb
87
101
  - lib/sevencop/cop_concerns/ordered.rb
88
- - lib/sevencop/rubocop_extension.rb
102
+ - lib/sevencop/plugin.rb
89
103
  - lib/sevencop/version.rb
90
104
  - sevencop.gemspec
91
105
  homepage: https://github.com/r7kamura/sevencop
@@ -95,6 +109,7 @@ metadata:
95
109
  homepage_uri: https://github.com/r7kamura/sevencop
96
110
  source_code_uri: https://github.com/r7kamura/sevencop
97
111
  changelog_uri: https://github.com/r7kamura/sevencop/releases
112
+ default_lint_roller_plugin: Sevencop::Plugin
98
113
  post_install_message:
99
114
  rdoc_options: []
100
115
  require_paths:
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rubocop'
4
-
5
- require_relative 'config_loader'
6
-
7
- RuboCop::ConfigLoader.instance_variable_set(
8
- :@default_configuration,
9
- Sevencop::ConfigLoader.call(
10
- path: File.expand_path(
11
- '../../config/default.yml',
12
- __dir__
13
- )
14
- )
15
- )