makandra-rubocop 12.0.0 → 12.1.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: 79beba1f37780c5fdd06ca858be609a0fdb334082583c5010c6c13fda823d182
4
- data.tar.gz: 29a8b15c82b85bee38a43b3463543f21b42097f260500958174cbe20e60ca6dd
3
+ metadata.gz: 0255ba88ffcf79e1a7383278a6b7eddd7611f89b6cde0de5097162bf3a28b487
4
+ data.tar.gz: 462fe3bfbcb8167c93bd455069d964b11e7fe33e9886d2ff40b78dccd823b1c1
5
5
  SHA512:
6
- metadata.gz: 27cc802a7880b20c4939365555330011650d5a08a5f2930916d488b6ce38dd1d50a5bf6ac11e0cdd590774a048b25ec4c859af47a331a99d30623461dec72c26
7
- data.tar.gz: 2ed94b16a50c26fea91cb16aa55182a7f4f983ab1eaf0826f97e8cbdf6524292492138f61789f4c2bf01c6ff202c290f20d745533601112c455aef197f8c2001
6
+ metadata.gz: c6f0ea4c886d783d30a04fad764ebb55528b1a1e44c1499b2df4a312b50ef1430dbea241dc087c9ef037087748bac10906e3a7cdbe089b3c2c590765f4b8d9d5
7
+ data.tar.gz: 27b9a1a5ccc212a645714f1631d8f62f957de7d955aa6a8c9e46fd2599335488fbfb16e7ae9c955f4714ff3ab4051bc5e03293bd696a3f15b14b4b5402dd3b02
data/CHANGELOG.md CHANGED
@@ -9,8 +9,19 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
9
9
  ### Compatible changes
10
10
 
11
11
 
12
+ ## 12.1.0 - 2024-01-07
13
+
14
+ ### Compatible changes
15
+
16
+ - Add default configuration for `rubocop-capybara` and `rubocop-factory_bot`
17
+
18
+
12
19
  ## 12.0.0 - 2024-01-17
13
20
 
21
+ ### Compatible changes
22
+
23
+ - Supports Ruby 3.3 and Rails 7.1.
24
+
14
25
  ### Breaking changes
15
26
 
16
27
  - Upgrade to `rubocop` 1.60.0 (was 1.39.0)
data/Gemfile.lock CHANGED
@@ -1,38 +1,50 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- makandra-rubocop (12.0.0)
4
+ makandra-rubocop (12.1.0)
5
5
  rubocop (~> 1.60.0)
6
+ rubocop-capybara (~> 2.20.0)
7
+ rubocop-factory_bot (~> 2.25.1)
6
8
  rubocop-rails (~> 2.23.1)
7
9
  rubocop-rspec (~> 2.13.2)
8
10
 
9
11
  GEM
10
12
  remote: https://rubygems.org/
11
13
  specs:
12
- activesupport (6.1.7.3)
14
+ activesupport (7.1.3)
15
+ base64
16
+ bigdecimal
13
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
+ connection_pool (>= 2.2.5)
19
+ drb
14
20
  i18n (>= 1.6, < 2)
15
21
  minitest (>= 5.1)
22
+ mutex_m
16
23
  tzinfo (~> 2.0)
17
- zeitwerk (~> 2.3)
18
24
  ast (2.4.2)
19
- concurrent-ruby (1.2.2)
20
- i18n (1.12.0)
25
+ base64 (0.2.0)
26
+ bigdecimal (3.1.6)
27
+ concurrent-ruby (1.2.3)
28
+ connection_pool (2.4.1)
29
+ drb (2.2.0)
30
+ ruby2_keywords
31
+ i18n (1.14.1)
21
32
  concurrent-ruby (~> 1.0)
22
- json (2.6.3)
33
+ json (2.7.1)
23
34
  language_server-protocol (3.17.0.3)
24
- minitest (5.18.0)
25
- parallel (1.22.1)
26
- parser (3.3.0.4)
35
+ minitest (5.21.2)
36
+ mutex_m (0.2.0)
37
+ parallel (1.24.0)
38
+ parser (3.3.0.5)
27
39
  ast (~> 2.4.1)
28
40
  racc
29
41
  racc (1.7.3)
30
- rack (3.0.7)
42
+ rack (3.0.9)
31
43
  rainbow (3.1.1)
32
44
  rake (12.3.2)
33
- regexp_parser (2.7.0)
34
- rexml (3.2.5)
35
- rubocop (1.60.0)
45
+ regexp_parser (2.9.0)
46
+ rexml (3.2.6)
47
+ rubocop (1.60.2)
36
48
  json (~> 2.3)
37
49
  language_server-protocol (>= 3.17.0)
38
50
  parallel (~> 1.10)
@@ -45,6 +57,10 @@ GEM
45
57
  unicode-display_width (>= 2.4.0, < 3.0)
46
58
  rubocop-ast (1.30.0)
47
59
  parser (>= 3.2.1.0)
60
+ rubocop-capybara (2.20.0)
61
+ rubocop (~> 1.41)
62
+ rubocop-factory_bot (2.25.1)
63
+ rubocop (~> 1.41)
48
64
  rubocop-rails (2.23.1)
49
65
  activesupport (>= 4.2.0)
50
66
  rack (>= 1.1)
@@ -53,10 +69,10 @@ GEM
53
69
  rubocop-rspec (2.13.2)
54
70
  rubocop (~> 1.33)
55
71
  ruby-progressbar (1.13.0)
72
+ ruby2_keywords (0.0.5)
56
73
  tzinfo (2.0.6)
57
74
  concurrent-ruby (~> 1.0)
58
- unicode-display_width (2.4.2)
59
- zeitwerk (2.6.7)
75
+ unicode-display_width (2.5.0)
60
76
 
61
77
  PLATFORMS
62
78
  ruby
data/README.md CHANGED
@@ -54,6 +54,24 @@ inherit_gem:
54
54
  - config/ext/rspec.yml
55
55
  ```
56
56
 
57
+ **For Capybara**
58
+
59
+ ```yaml
60
+ inherit_gem:
61
+ makandra-rubocop:
62
+ - config/default.yml
63
+ - config/ext/capybara.yml
64
+ ```
65
+
66
+ **For Factory Bot**
67
+
68
+ ```yaml
69
+ inherit_gem:
70
+ makandra-rubocop:
71
+ - config/default.yml
72
+ - config/ext/factory_bot.yml
73
+ ```
74
+
57
75
  Any per-project rules can then be defined in the `.rubocop.yml`:
58
76
 
59
77
  ```yaml
@@ -0,0 +1,105 @@
1
+ require:
2
+ - rubocop-capybara
3
+
4
+ inherit_mode:
5
+ merge:
6
+ - Exclude
7
+
8
+ Capybara:
9
+ Enabled: true
10
+ DocumentationBaseURL: https://docs.rubocop.org/rubocop-capybara
11
+ Include: &1
12
+ - "**/*_spec.rb"
13
+ - "**/spec/**/*"
14
+ - "**/test/**/*"
15
+ - "**/*_steps.rb"
16
+ - "**/features/step_definitions/**/*"
17
+
18
+ Capybara/ClickLinkOrButtonStyle:
19
+ Description: Checks for methods of button or link clicks.
20
+ Enabled: pending
21
+ VersionAdded: '2.19'
22
+ VersionChanged: '2.20'
23
+ EnforcedStyle: link_or_button
24
+ SupportedStyles:
25
+ - link_or_button
26
+ - strict
27
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/ClickLinkOrButtonStyle
28
+
29
+ Capybara/CurrentPathExpectation:
30
+ Description: Checks that no expectations are set on Capybara's `current_path`.
31
+ Enabled: true
32
+ VersionAdded: '1.18'
33
+ VersionChanged: '2.0'
34
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/CurrentPathExpectation
35
+
36
+ Capybara/MatchStyle:
37
+ Description: Checks for usage of deprecated style methods.
38
+ Enabled: pending
39
+ VersionAdded: '2.17'
40
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/MatchStyle
41
+
42
+ Capybara/NegationMatcher:
43
+ Description: Enforces use of `have_no_*` or `not_to` for negated expectations.
44
+ Enabled: pending
45
+ VersionAdded: '2.14'
46
+ VersionChanged: '2.20'
47
+ EnforcedStyle: have_no
48
+ SupportedStyles:
49
+ - have_no
50
+ - not_to
51
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/NegationMatcher
52
+
53
+ Capybara/RedundantWithinFind:
54
+ Description: Checks for redundant `within find(...)` calls.
55
+ Enabled: pending
56
+ VersionAdded: '2.20'
57
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/RedundantWithinFind
58
+
59
+ Capybara/SpecificActions:
60
+ Description: Checks for there is a more specific actions offered by Capybara.
61
+ Enabled: pending
62
+ VersionAdded: '2.14'
63
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/SpecificActions
64
+
65
+ Capybara/SpecificFinders:
66
+ Description: Checks if there is a more specific finder offered by Capybara.
67
+ Enabled: pending
68
+ VersionAdded: '2.13'
69
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/SpecificFinders
70
+
71
+ Capybara/SpecificMatcher:
72
+ Description: Checks for there is a more specific matcher offered by Capybara.
73
+ Enabled: pending
74
+ VersionAdded: '2.12'
75
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/SpecificMatcher
76
+
77
+ Capybara/VisibilityMatcher:
78
+ Description: Checks for boolean visibility in Capybara finders.
79
+ Enabled: true
80
+ VersionAdded: '1.39'
81
+ VersionChanged: '2.0'
82
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/VisibilityMatcher
83
+
84
+ Capybara/RSpec:
85
+ Enabled: true
86
+ Include: *1
87
+
88
+ Capybara/RSpec/HaveSelector:
89
+ Description: Use `have_css` or `have_xpath` instead of `have_selector`.
90
+ Enabled: pending
91
+ DefaultSelector: css
92
+ VersionAdded: '2.19'
93
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/RSpec/HaveSelector
94
+
95
+ Capybara/RSpec/PredicateMatcher:
96
+ Description: Prefer using predicate matcher over using predicate method directly.
97
+ Enabled: pending
98
+ Strict: true
99
+ EnforcedStyle: inflected
100
+ AllowedExplicitMatchers: []
101
+ SupportedStyles:
102
+ - inflected
103
+ - explicit
104
+ VersionAdded: '2.19'
105
+ Reference: https://www.rubydoc.info/gems/rubocop-capybara/RuboCop/Cop/Capybara/RSpec/PredicateMatcher
@@ -0,0 +1,148 @@
1
+ require:
2
+ - rubocop-factory_bot
3
+
4
+ inherit_mode:
5
+ merge:
6
+ - Exclude
7
+
8
+ FactoryBot:
9
+ Enabled: true
10
+ Include:
11
+ - "**/spec/factories.rb"
12
+ - "**/spec/factories/**/*.rb"
13
+ - "**/test/factories.rb"
14
+ - "**/test/factories/**/*.rb"
15
+ - "**/features/support/factories/**/*.rb"
16
+ DocumentationBaseURL: https://docs.rubocop.org/rubocop-factory_bot
17
+
18
+ FactoryBot/AssociationStyle:
19
+ Description: Use a consistent style to define associations.
20
+ Enabled: pending
21
+ Safe: false
22
+ VersionAdded: '2.23'
23
+ VersionChanged: '2.24'
24
+ EnforcedStyle: implicit
25
+ SupportedStyles:
26
+ - explicit
27
+ - implicit
28
+ NonImplicitAssociationMethodNames: ~
29
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/AssociationStyle
30
+
31
+ FactoryBot/AttributeDefinedStatically:
32
+ Description: Always declare attribute values as blocks.
33
+ Enabled: true
34
+ VersionAdded: '1.28'
35
+ VersionChanged: '2.24'
36
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/AttributeDefinedStatically
37
+
38
+ FactoryBot/ConsistentParenthesesStyle:
39
+ Description: Use a consistent style for parentheses in factory_bot calls.
40
+ Enabled: pending
41
+ Include:
42
+ - "**/*_spec.rb"
43
+ - "**/spec/**/*"
44
+ - "**/test/**/*"
45
+ - "**/features/support/factories/**/*.rb"
46
+ EnforcedStyle: require_parentheses
47
+ SupportedStyles:
48
+ - require_parentheses
49
+ - omit_parentheses
50
+ ExplicitOnly: false
51
+ VersionAdded: '2.14'
52
+ VersionChanged: '2.23'
53
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/ConsistentParenthesesStyle
54
+
55
+ FactoryBot/CreateList:
56
+ Description: Checks for create_list usage.
57
+ Enabled: true
58
+ Include:
59
+ - "**/*_spec.rb"
60
+ - "**/spec/**/*"
61
+ - "**/test/**/*"
62
+ - "**/features/support/factories/**/*.rb"
63
+ EnforcedStyle: create_list
64
+ SupportedStyles:
65
+ - create_list
66
+ - n_times
67
+ ExplicitOnly: false
68
+ SafeAutoCorrect: false
69
+ VersionAdded: '1.25'
70
+ VersionChanged: '2.24'
71
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/CreateList
72
+
73
+ FactoryBot/ExcessiveCreateList:
74
+ Description: Check for excessive model creation in a list.
75
+ Enabled: pending
76
+ Include:
77
+ - "**/*_spec.rb"
78
+ - "**/spec/**/*"
79
+ - "**/test/**/*"
80
+ - "**/features/support/factories/**/*.rb"
81
+ MaxAmount: 10
82
+ VersionAdded: '2.25'
83
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/ExcessiveCreateList
84
+
85
+ FactoryBot/FactoryAssociationWithStrategy:
86
+ Description: Use definition in factory association instead of hard coding a strategy.
87
+ Enabled: pending
88
+ Include:
89
+ - "**/*_spec.rb"
90
+ - "**/spec/**/*"
91
+ - "**/test/**/*"
92
+ - "**/features/support/factories/**/*.rb"
93
+ VersionAdded: '2.23'
94
+ VersionChanged: '2.23'
95
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/FactoryAssociationWithStrategy
96
+
97
+ FactoryBot/FactoryClassName:
98
+ Description: Use string value when setting the class attribute explicitly.
99
+ Enabled: true
100
+ VersionAdded: '1.37'
101
+ VersionChanged: '2.24'
102
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/FactoryClassName
103
+
104
+ FactoryBot/FactoryNameStyle:
105
+ Description: Checks for name style for argument of FactoryBot::Syntax::Methods.
106
+ Enabled: pending
107
+ Include:
108
+ - "**/*_spec.rb"
109
+ - "**/spec/**/*"
110
+ - "**/test/**/*"
111
+ - "**/features/support/factories/**/*.rb"
112
+ EnforcedStyle: symbol
113
+ SupportedStyles:
114
+ - symbol
115
+ - string
116
+ ExplicitOnly: false
117
+ VersionAdded: '2.16'
118
+ VersionChanged: '2.23'
119
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/FactoryNameStyle
120
+
121
+ FactoryBot/IdSequence:
122
+ Description: Do not create a FactoryBot sequence for an id column.
123
+ Enabled: pending
124
+ VersionAdded: '2.24'
125
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/IdSequence
126
+
127
+ FactoryBot/RedundantFactoryOption:
128
+ Description: Checks for redundant `factory` option.
129
+ Enabled: pending
130
+ Include:
131
+ - "**/*_spec.rb"
132
+ - "**/spec/**/*"
133
+ - "**/test/**/*"
134
+ - "**/features/support/factories/**/*.rb"
135
+ VersionAdded: '2.23'
136
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/RedundantFactoryOption
137
+
138
+ FactoryBot/SyntaxMethods:
139
+ Description: Use shorthands from `FactoryBot::Syntax::Methods` in your specs.
140
+ Enabled: pending
141
+ Include:
142
+ - "**/*_spec.rb"
143
+ - "**/spec/**/*"
144
+ - "**/test/**/*"
145
+ - "**/features/support/factories/**/*.rb"
146
+ SafeAutoCorrect: false
147
+ VersionAdded: '2.7'
148
+ Reference: https://www.rubydoc.info/gems/rubocop-factory_bot/RuboCop/Cop/FactoryBot/SyntaxMethods
@@ -1,3 +1,3 @@
1
1
  module MakandraRubocop
2
- VERSION = '12.0.0'.freeze
2
+ VERSION = '12.1.0'.freeze
3
3
  end
@@ -27,6 +27,8 @@ Gem::Specification.new do |spec|
27
27
  spec.add_dependency 'rubocop', '~> 1.60.0'
28
28
  spec.add_dependency 'rubocop-rails', '~> 2.23.1'
29
29
  spec.add_dependency 'rubocop-rspec', '~> 2.13.2'
30
+ spec.add_dependency 'rubocop-capybara', '~> 2.20.0'
31
+ spec.add_dependency 'rubocop-factory_bot', '~> 2.25.1'
30
32
 
31
33
  spec.add_development_dependency 'bundler', '~> 2.0'
32
34
  spec.add_development_dependency 'rake', '~> 12.3'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: makandra-rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.0.0
4
+ version: 12.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Hartherz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-01-17 00:00:00.000000000 Z
12
+ date: 2024-02-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubocop
@@ -53,6 +53,34 @@ dependencies:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
55
  version: 2.13.2
56
+ - !ruby/object:Gem::Dependency
57
+ name: rubocop-capybara
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: 2.20.0
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: 2.20.0
70
+ - !ruby/object:Gem::Dependency
71
+ name: rubocop-factory_bot
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 2.25.1
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 2.25.1
56
84
  - !ruby/object:Gem::Dependency
57
85
  name: bundler
58
86
  requirement: !ruby/object:Gem::Requirement
@@ -101,6 +129,8 @@ files:
101
129
  - bin/console
102
130
  - bin/setup
103
131
  - config/default.yml
132
+ - config/ext/capybara.yml
133
+ - config/ext/factory_bot.yml
104
134
  - config/ext/rails.yml
105
135
  - config/ext/rspec.yml
106
136
  - lib/makandra_rubocop.rb