rubocop-config-captive 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5db06e7a52b7907e189fecdc71175cfe6104549157407176742a9a88823ce089
4
- data.tar.gz: 4d58098dec20640412ae545175374d52beab914b6f2f9951c30bc9c84bd1eedd
3
+ metadata.gz: 35d02218cee724fa93a32f80e654db067e2009706748d88863a09280398d2a79
4
+ data.tar.gz: 1eb89c57a0a20fae019e0431d002b60097be12822bf9191827364d52c48d8c02
5
5
  SHA512:
6
- metadata.gz: 72f86d66b9754c40049530fd3acef65883c642f4a3f30f352a1fa42f49edd283c00f5115a0a037e4492984ae42119af01adc1f744b4c22c0dd01695372140503
7
- data.tar.gz: 04e0c1a8742603cdb2096072523ac9f5a286631ade79e2e1c978aa24504cbea89f641b3a600786c1622337553a2f38f62a5472fbb8cdc0cc50894301136c8ef3
6
+ metadata.gz: 9fb77596cecdebf4e6a4b89f49b03c50d9876d676b3f201e53da14f8a35890660b40685007e3694ce199dc957b36f6dce426ba479fef56178b730642302fd804
7
+ data.tar.gz: 5b8069af3175f7c484028867a652ec7b2de31e0af9f75d4b3630ef39fd5c358cd467deaa52272343b9ad89c9fbafbe46736409fde1bb2e694f916b313e09004f
data/README.md CHANGED
@@ -34,21 +34,66 @@ inherit_gem:
34
34
 
35
35
  ## Common Errors
36
36
 
37
- ### My project has too many errors
37
+ <details>
38
+ <summary>
39
+ <strong>😩 My project has too many errors</strong>
40
+ </summary>
41
+
42
+ ## Explanation
38
43
 
39
- Firstly, you can use `bundle exec rubocop -a` to auto-correct your project
44
+ the configuration is very strict, it is normal to have many errors
40
45
 
41
- Then if you have too many warnings, you can use the command line :
46
+ ## Solution
42
47
 
43
- `bundle exec rubocop --auto-gen-config` to create `.rubocop_todo.yml` file that ignore these errors
48
+ ### Solution 1 : Auto-correct all errors
44
49
 
45
- ### `Gemfile` has lots of `Bundler/GemVersion` errors
50
+ ```shell
51
+ bundle exec rubocop -a
52
+ ```
53
+
54
+ ### Solution 2 : Ignore errors and progressively fix them
55
+
56
+ ```shell
57
+ bundle exec rubocop --auto-gen-config
58
+ ```
59
+
60
+ Will create `.rubocop_todo.yml` will all non passing rules. It is advised to fix them later, rule by rule.
61
+ </details>
62
+
63
+ <details>
64
+ <summary>
65
+ <strong>📍 <code>Gemfile</code> has lots of <code>Bundler/GemVersion</code> errors </strong>
66
+ </summary>
67
+
68
+ ## Explanation
69
+
70
+ Each dependency should be explicitly set in the `Gemfile` and `bundle update` is strongly discouraged.
71
+
72
+ ## Solution
73
+
74
+ ### Solution 1 : Use bundle-locker
75
+
76
+ 1. Install bundle-locker globally
77
+
78
+ ```shell
79
+ gem install bundle-locker
80
+ ```
81
+
82
+ 2. Pin Gemfile using `Gemfile.lock`
83
+
84
+ ```shell
85
+ bundle-locker ./Gemfile
86
+ ```
87
+
88
+ 3. Manually edit `Gemfile` and adjust constraints `"x.x.x"`, `"~> x.x.x"`, etc
89
+
90
+ 4. Update `Gemfile.lock`
46
91
 
47
- Explanation : Each dependency should be explicitly set in the `Gemfile` and `bundle update` is strongly discouraged.
48
- Workaround :
92
+ ```shell
93
+ bundle install
94
+ ```
49
95
 
50
- 1. Install gem bundle-locker : `gem install bundle-locker`
51
- 1. Pin Gemfile using Gemfile.lock : `bundle-locker ./Gemfile`
96
+ </details>
52
97
 
53
98
  ## Contributing
54
99
 
@@ -246,9 +246,3 @@ RSpec/VerifiedDoubles:
246
246
  RSpec/VoidExpect:
247
247
  Description: This cop checks void `expect()`.
248
248
  Enabled: false
249
- RSpec/FactoryBot/AttributeDefinedStatically:
250
- Description: Always declare attribute values as blocks.
251
- Enabled: false
252
- RSpec/FactoryBot/CreateList:
253
- Description: Checks for create_list usage.
254
- Enabled: true
data/config/default.yml CHANGED
@@ -41,6 +41,7 @@ inherit_from:
41
41
  - './rubocop-bundler.yml'
42
42
  - './rubocop-capybara.yml'
43
43
  - './rubocop-captive.yml'
44
+ - './rubocop-factory_bot.yml'
44
45
  - './rubocop-gemspec.yml'
45
46
  - './rubocop-layout.yml'
46
47
  - './rubocop-lint.yml'
@@ -0,0 +1,2 @@
1
+ require:
2
+ - rubocop-factory_bot
@@ -1,3 +1,156 @@
1
1
  inherit_from:
2
2
  # @see https://github.com/airbnb/ruby/blob/main/rubocop-airbnb/config/rubocop-rails.yml
3
3
  - ./__private__/rubocop-rails.yml
4
+
5
+ Rails/ActionControllerFlashBeforeRender:
6
+ Enabled: true
7
+
8
+ Rails/ActionControllerTestCase:
9
+ Enabled: false
10
+
11
+ Rails/ActionOrder:
12
+ Enabled: true
13
+
14
+ Rails/ActiveRecordCallbacksOrder:
15
+ Enabled: true
16
+
17
+ Rails/ActiveSupportOnLoad:
18
+ Enabled: true
19
+
20
+ Rails/AddColumnIndex:
21
+ Enabled: true
22
+
23
+ Rails/AfterCommitOverride:
24
+ Enabled: true
25
+
26
+ Rails/AttributeDefaultBlockValue:
27
+ Enabled: true
28
+
29
+ Rails/CompactBlank:
30
+ Enabled: true
31
+
32
+ Rails/DeprecatedActiveModelErrorsMethods:
33
+ Enabled: true
34
+
35
+ Rails/DotSeparatedKeys:
36
+ Enabled: true
37
+
38
+ Rails/DuplicateAssociation:
39
+ Enabled: true
40
+
41
+ Rails/DuplicateScope:
42
+ Enabled: true
43
+
44
+ Rails/EagerEvaluationLogMessage:
45
+ Enabled: false
46
+
47
+ Rails/ExpandedDateRange:
48
+ Enabled: true
49
+
50
+ Rails/FindById:
51
+ Enabled: true
52
+
53
+ Rails/DurationArithmetic:
54
+ Enabled: true
55
+
56
+ Rails/FreezeTime:
57
+ Enabled: true
58
+
59
+ Rails/I18nLazyLookup:
60
+ Enabled: false
61
+
62
+ Rails/I18nLocaleAssignment:
63
+ Enabled: true
64
+
65
+ Rails/I18nLocaleTexts:
66
+ Enabled: true
67
+
68
+ Rails/IgnoredColumnsAssignment:
69
+ Enabled: false
70
+
71
+ Rails/Inquiry:
72
+ Enabled: true
73
+
74
+ Rails/MailerName:
75
+ Enabled: true
76
+
77
+ Rails/MatchRoute:
78
+ Enabled: false
79
+
80
+ Rails/MigrationClassName:
81
+ Enabled: true
82
+
83
+ Rails/NegateInclude:
84
+ Enabled: false
85
+
86
+ Rails/Pluck:
87
+ Enabled: true
88
+
89
+ Rails/PluckInWhere:
90
+ Enabled: true
91
+
92
+ Rails/RedundantPresenceValidationOnBelongsTo:
93
+ Enabled: false
94
+
95
+ Rails/RedundantTravelBack:
96
+ Enabled: true
97
+
98
+ Rails/RenderInline:
99
+ Enabled: false
100
+
101
+ Rails/RenderPlainText:
102
+ Enabled: true
103
+
104
+ Rails/ResponseParsedBody:
105
+ Enabled: true
106
+
107
+ Rails/RootJoinChain:
108
+ Enabled: true
109
+
110
+ Rails/RootPathnameMethods:
111
+ Enabled: true
112
+
113
+ Rails/RootPublicPath:
114
+ Enabled: true
115
+
116
+ Rails/ShortI18n:
117
+ Enabled: true
118
+
119
+ Rails/SquishedSQLHeredocs:
120
+ Enabled: true
121
+
122
+ Rails/StripHeredoc:
123
+ Enabled: true
124
+
125
+ Rails/TimeZoneAssignment:
126
+ Enabled: true
127
+
128
+ Rails/ToFormattedS:
129
+ Enabled: true
130
+
131
+ Rails/ToSWithArgument:
132
+ Enabled: true
133
+
134
+ Rails/TopLevelHashWithIndifferentAccess:
135
+ Enabled: true
136
+
137
+ Rails/TransactionExitStatement:
138
+ Enabled: true
139
+
140
+ Rails/UnusedIgnoredColumns:
141
+ Enabled: true
142
+
143
+ Rails/WhereEquals:
144
+ Enabled: true
145
+
146
+ Rails/WhereExists:
147
+ Enabled: true
148
+
149
+ Rails/WhereMissing:
150
+ Enabled: true
151
+
152
+ Rails/WhereNot:
153
+ Enabled: true
154
+
155
+ Rails/WhereNotWithMultipleConditions:
156
+ Enabled: true
@@ -3,4 +3,13 @@ inherit_from:
3
3
  - ./__private__/rubocop-rspec.yml
4
4
 
5
5
  RSpec/Focus:
6
- Enabled: true
6
+ Enabled: true
7
+
8
+ # exclue certains fichiers pour simplifier l'utilisation de rswag
9
+ RSpec/ScatteredSetup:
10
+ Exclude:
11
+ - 'spec/requests/**/*'
12
+
13
+ Rspec/RepeatedExample:
14
+ Exclude:
15
+ - 'spec/requests/**/*'
@@ -3,6 +3,6 @@
3
3
  module RuboCop
4
4
  module Captive
5
5
  # Version information for the the Airbnb RuboCop plugin.
6
- VERSION = '1.3.0'
6
+ VERSION = '1.4.0'
7
7
  end
8
8
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
12
12
  gem.email = ['julien.polo@captive.fr']
13
13
  gem.homepage = 'https://github.com/Captive-Studio/rubocop-config'
14
14
  gem.license = 'MIT'
15
- gem.required_ruby_version = '>= 2.5'
15
+ gem.required_ruby_version = '>= 2.6'
16
16
 
17
17
  gem.files = Dir[
18
18
  '{config,lib}/**/*',
@@ -25,12 +25,13 @@ Gem::Specification.new do |gem|
25
25
  # ⚠️ Instead of depending on rubocop-airbnb we copy sources
26
26
  #
27
27
  # gem.add_dependency('rubocop-airbnb', '~> 4.0.0')
28
- gem.add_dependency('rubocop', '~> 1.49.0')
29
- gem.add_dependency('rubocop-performance', '~> 1.16.0 ')
28
+ gem.add_dependency('rubocop', '~> 1.51.0')
29
+ gem.add_dependency('rubocop-performance', '~> 1.17.1 ')
30
30
  gem.add_dependency('rubocop-rake', '~> 0.6.0')
31
31
  gem.add_dependency('rubocop-rails', '~> 2.18.0')
32
- gem.add_dependency('rubocop-rspec', '~> 2.19.0')
32
+ gem.add_dependency('rubocop-rspec', '~> 2.22.0')
33
33
  gem.add_dependency('rubocop-capybara', '~> 2.18.0')
34
+ gem.add_dependency('rubocop-factory_bot', '~> 2.23.1')
34
35
  gem.add_development_dependency('rspec', '~> 3.12')
35
36
  # gem.metadata['rubygems_mfa_required'] = 'true'
36
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-config-captive
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Captive
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-05-17 00:00:00.000000000 Z
13
+ date: 2023-05-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubocop
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: 1.49.0
21
+ version: 1.51.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: 1.49.0
28
+ version: 1.51.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rubocop-performance
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: 1.16.0
35
+ version: 1.17.1
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 1.16.0
42
+ version: 1.17.1
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rubocop-rake
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -74,14 +74,14 @@ dependencies:
74
74
  requirements:
75
75
  - - "~>"
76
76
  - !ruby/object:Gem::Version
77
- version: 2.19.0
77
+ version: 2.22.0
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - "~>"
83
83
  - !ruby/object:Gem::Version
84
- version: 2.19.0
84
+ version: 2.22.0
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: rubocop-capybara
87
87
  requirement: !ruby/object:Gem::Requirement
@@ -96,6 +96,20 @@ dependencies:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
98
  version: 2.18.0
99
+ - !ruby/object:Gem::Dependency
100
+ name: rubocop-factory_bot
101
+ requirement: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - "~>"
104
+ - !ruby/object:Gem::Version
105
+ version: 2.23.1
106
+ type: :runtime
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - "~>"
111
+ - !ruby/object:Gem::Version
112
+ version: 2.23.1
99
113
  - !ruby/object:Gem::Dependency
100
114
  name: rspec
101
115
  requirement: !ruby/object:Gem::Requirement
@@ -137,6 +151,7 @@ files:
137
151
  - config/rubocop-bundler.yml
138
152
  - config/rubocop-captive.yml
139
153
  - config/rubocop-capybara.yml
154
+ - config/rubocop-factory_bot.yml
140
155
  - config/rubocop-gemspec.yml
141
156
  - config/rubocop-layout.yml
142
157
  - config/rubocop-lint.yml
@@ -171,7 +186,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
171
186
  requirements:
172
187
  - - ">="
173
188
  - !ruby/object:Gem::Version
174
- version: '2.5'
189
+ version: '2.6'
175
190
  required_rubygems_version: !ruby/object:Gem::Requirement
176
191
  requirements:
177
192
  - - ">="