sevencop 0.48.1 → 0.49.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: d49c949fbef546c840c5dcb4c0559c1f233843df4e3b932480c5df63d518c040
4
- data.tar.gz: 55dcd154e3640c7b00f7348d9236d3c97797495a2a10b0d50888501ea7806dee
3
+ metadata.gz: 0f37a21f5f3200e1a3b4dbebeef0ddc2a33b2068b83d6a494c4d1ff7e13ed6db
4
+ data.tar.gz: 8c321fd4ca9ba2d71c8f52d0746fec923eb028071713a198cbf59490f6ea4d09
5
5
  SHA512:
6
- metadata.gz: 21c617d19a5045202ba55a71b4753298d2a7c92e0edc9578acc0d69ab358a25df82af35c77575eef28f287ce29710b1108f63caf4e90a74efcfed85c696768b9
7
- data.tar.gz: 117e3d42e7dab55ba37427b4a93ac4e577c37444af4024644f9c93b153d230b5dd2e18e0c556e45b7c8244442a7d1a124b1f36a36a77bbddb585696c72e090ab
6
+ metadata.gz: c7d780c4973e2ce0889ae259c71d43cb6ea21f7d3b973ef3d5a2c0c506243e2e5f52593d29b5e8175729729ebc14b21f70a88cf236c8898abee3d3be6a1813b3
7
+ data.tar.gz: 72be4f5db61232463c25d7c4ada1b691463ae27d489e6068fb131116849cb8f4f568f91d6e350b8c9c206ecdf7791e7dbcf4396eab4bf77a295edceb8107c90f
data/.rubocop.yml CHANGED
@@ -7,7 +7,7 @@ plugins:
7
7
 
8
8
  AllCops:
9
9
  NewCops: enable
10
- TargetRubyVersion: 2.7
10
+ TargetRubyVersion: 3.3
11
11
 
12
12
  Gemspec/RequireMFA:
13
13
  Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sevencop (0.48.1)
4
+ sevencop (0.49.1)
5
5
  activesupport
6
6
  lint_roller (>= 1.1)
7
7
  rubocop (>= 1.72.1)
@@ -9,38 +9,40 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (7.2.2.2)
12
+ activesupport (8.1.4)
13
13
  base64
14
- benchmark (>= 0.3)
15
14
  bigdecimal
16
15
  concurrent-ruby (~> 1.0, >= 1.3.1)
17
16
  connection_pool (>= 2.2.5)
18
17
  drb
19
18
  i18n (>= 1.6, < 2)
19
+ json
20
20
  logger (>= 1.4.2)
21
21
  minitest (>= 5.1)
22
22
  securerandom (>= 0.3)
23
23
  tzinfo (~> 2.0, >= 2.0.5)
24
+ uri (>= 0.13.1)
24
25
  ast (2.4.3)
25
26
  base64 (0.3.0)
26
- benchmark (0.4.1)
27
- bigdecimal (3.2.3)
28
- concurrent-ruby (1.3.5)
29
- connection_pool (2.5.4)
27
+ bigdecimal (4.1.3)
28
+ concurrent-ruby (1.3.8)
29
+ connection_pool (3.0.2)
30
30
  diff-lcs (1.6.1)
31
31
  drb (2.2.3)
32
- i18n (1.14.7)
32
+ i18n (1.15.2)
33
33
  concurrent-ruby (~> 1.0)
34
34
  json (2.10.2)
35
35
  language_server-protocol (3.17.0.4)
36
36
  lint_roller (1.1.0)
37
37
  logger (1.7.0)
38
- minitest (5.25.5)
38
+ minitest (6.0.6)
39
+ drb (~> 2.0)
40
+ prism (~> 1.5)
39
41
  parallel (1.26.3)
40
42
  parser (3.3.7.4)
41
43
  ast (~> 2.4.1)
42
44
  racc
43
- prism (1.4.0)
45
+ prism (1.9.0)
44
46
  racc (1.8.1)
45
47
  rainbow (3.1.1)
46
48
  rake (13.2.1)
@@ -86,9 +88,10 @@ GEM
86
88
  securerandom (0.4.1)
87
89
  tzinfo (2.0.6)
88
90
  concurrent-ruby (~> 1.0)
89
- unicode-display_width (3.1.4)
90
- unicode-emoji (~> 4.0, >= 4.0.4)
91
- unicode-emoji (4.0.4)
91
+ unicode-display_width (3.3.0)
92
+ unicode-emoji (~> 4.3)
93
+ unicode-emoji (4.3.0)
94
+ uri (1.1.2)
92
95
 
93
96
  PLATFORMS
94
97
  ruby
@@ -103,4 +106,4 @@ DEPENDENCIES
103
106
  sevencop!
104
107
 
105
108
  BUNDLED WITH
106
- 2.3.17
109
+ 4.0.20
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # sevencop
2
2
 
3
- [![CI](https://github.com/r7kamura/sevencop/actions/workflows/ci.yml/badge.svg)](https://github.com/r7kamura/sevencop/actions/workflows/ci.yml)
4
-
5
3
  Opinionated custom cops for [RuboCop](https://github.com/rubocop/rubocop).
6
4
 
7
5
  ## Usage
@@ -59,7 +59,7 @@ module RuboCop
59
59
  (?<column_name>[^,]+)
60
60
  ,\s*
61
61
  \z
62
- /ix.freeze
62
+ /ix
63
63
 
64
64
  REGEXP_FIELD_DSTR_TAIL = /
65
65
  \A
@@ -71,7 +71,7 @@ module RuboCop
71
71
  (?<order>asc|desc)
72
72
  )?
73
73
  \z
74
- /ix.freeze
74
+ /ix
75
75
 
76
76
  REGEXP_FIELD_STR = /
77
77
  \A
@@ -89,7 +89,7 @@ module RuboCop
89
89
  )?
90
90
  \s*
91
91
  \z
92
- /ix.freeze
92
+ /ix
93
93
 
94
94
  MSG = 'Prefer `in_order_of` to MySQL `FIELD` function if possible.'
95
95
 
@@ -20,6 +20,22 @@ module RuboCop
20
20
  # def index
21
21
  # end
22
22
  # end
23
+ #
24
+ # # good
25
+ # module UsersConcern
26
+ # class_methods do
27
+ # def articles
28
+ # end
29
+ # end
30
+ # end
31
+ #
32
+ # # good
33
+ # class UsersController < ApplicationController
34
+ # class << self
35
+ # def articles
36
+ # end
37
+ # end
38
+ # end
23
39
  class RailsSpecificActionName < Base
24
40
  include VisibilityHelp
25
41
 
@@ -44,7 +60,7 @@ module RuboCop
44
60
  # @param node [RuboCop::AST::DefNode]
45
61
  # @return [Boolean]
46
62
  def action?(node)
47
- node_visibility(node) == :public
63
+ node_visibility(node) == :public && !class_method?(node)
48
64
  end
49
65
 
50
66
  # @param node [RuboCop::AST::DefNode]
@@ -54,6 +70,23 @@ module RuboCop
54
70
  !configured_action_name?(node)
55
71
  end
56
72
 
73
+ # @param node [RuboCop::AST::DefNode]
74
+ # @return [Boolean]
75
+ def class_method?(node)
76
+ node.each_ancestor do |ancestor|
77
+ return true if class_methods_block?(ancestor) || ancestor.sclass_type?
78
+ return false if ancestor.type?(:class, :module)
79
+ end
80
+
81
+ false
82
+ end
83
+
84
+ # @param node [RuboCop::AST::Node]
85
+ # @return [Boolean]
86
+ def class_methods_block?(node)
87
+ node.type?(:block, :numblock) && node.method?(:class_methods)
88
+ end
89
+
57
90
  # @param node [RuboCop::AST::DefNode]
58
91
  # @return [Boolean]
59
92
  def configured_action_name?(node)
@@ -33,7 +33,7 @@ module RuboCop
33
33
  PUT
34
34
  ].freeze
35
35
 
36
- DESCRIPTION_PATTERN = %r{\A#{::Regexp.union(SUPPORTED_HTTP_METHODS)} /}.freeze
36
+ DESCRIPTION_PATTERN = %r{\A#{::Regexp.union(SUPPORTED_HTTP_METHODS)} /}
37
37
 
38
38
  # @param node [RuboCop::AST::SendNode]
39
39
  # @return [void]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sevencop
4
- VERSION = '0.48.1'
4
+ VERSION = '0.49.1'
5
5
  end
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.7'
14
+ spec.required_ruby_version = '>= 3.3'
15
15
 
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
  spec.metadata['source_code_uri'] = spec.homepage
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sevencop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.48.1
4
+ version: 0.49.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-09-28 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: activesupport
@@ -52,7 +51,6 @@ dependencies:
52
51
  - - ">="
53
52
  - !ruby/object:Gem::Version
54
53
  version: 1.72.1
55
- description:
56
54
  email:
57
55
  - r7kamura@gmail.com
58
56
  executables: []
@@ -110,7 +108,6 @@ metadata:
110
108
  source_code_uri: https://github.com/r7kamura/sevencop
111
109
  changelog_uri: https://github.com/r7kamura/sevencop/releases
112
110
  default_lint_roller_plugin: Sevencop::Plugin
113
- post_install_message:
114
111
  rdoc_options: []
115
112
  require_paths:
116
113
  - lib
@@ -118,15 +115,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
115
  requirements:
119
116
  - - ">="
120
117
  - !ruby/object:Gem::Version
121
- version: '2.7'
118
+ version: '3.3'
122
119
  required_rubygems_version: !ruby/object:Gem::Requirement
123
120
  requirements:
124
121
  - - ">="
125
122
  - !ruby/object:Gem::Version
126
123
  version: '0'
127
124
  requirements: []
128
- rubygems_version: 3.3.27
129
- signing_key:
125
+ rubygems_version: 4.0.20
130
126
  specification_version: 4
131
127
  summary: Opinionated custom cops for RuboCop.
132
128
  test_files: []