rubocop-hint 0.4.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ac6ededcf9c4e11b08c04689eb682ec4cfcbcaba55b6ce485aab1eb5f11ca79d
4
+ data.tar.gz: a1b47764485e94d242fe1f77887dd156591470113b91687fd32c241b04d2088b
5
+ SHA512:
6
+ metadata.gz: be06b2cffd42e15e175c576ed40fc216c7a6da5a6c7d9c0aa87a1ae2066cd49158bca740e5475884ef0cea21d0994129a5ae73548bd879ccec12f96a1e842312
7
+ data.tar.gz: 153f8a65826ccd6f435adf0078a237f1b8fdabafec584b9e7916d18be800d0c2011df72bc4686227f71e3ec70da48db8853e731123ff5e4f7a0a974a4823067b
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rubocop.yml ADDED
@@ -0,0 +1 @@
1
+ inherit_from: default.yml
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rubocop-hint.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,72 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rubocop-hint (0.4.0)
5
+ rubocop (>= 1.14.0)
6
+ rubocop-performance (>= 1.11.0)
7
+ rubocop-rails (>= 2.10.0)
8
+ rubocop-rspec (>= 2.3.0)
9
+ standard (>= 1.1.0)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ activesupport (6.1.3.2)
15
+ concurrent-ruby (~> 1.0, >= 1.0.2)
16
+ i18n (>= 1.6, < 2)
17
+ minitest (>= 5.1)
18
+ tzinfo (~> 2.0)
19
+ zeitwerk (~> 2.3)
20
+ ast (2.4.2)
21
+ concurrent-ruby (1.1.8)
22
+ i18n (1.8.10)
23
+ concurrent-ruby (~> 1.0)
24
+ minitest (5.14.4)
25
+ parallel (1.20.1)
26
+ parser (3.0.1.1)
27
+ ast (~> 2.4.1)
28
+ rack (2.2.3)
29
+ rainbow (3.0.0)
30
+ rake (13.0.3)
31
+ regexp_parser (2.1.1)
32
+ rexml (3.2.5)
33
+ rubocop (1.14.0)
34
+ parallel (~> 1.10)
35
+ parser (>= 3.0.0.0)
36
+ rainbow (>= 2.2.2, < 4.0)
37
+ regexp_parser (>= 1.8, < 3.0)
38
+ rexml
39
+ rubocop-ast (>= 1.5.0, < 2.0)
40
+ ruby-progressbar (~> 1.7)
41
+ unicode-display_width (>= 1.4.0, < 3.0)
42
+ rubocop-ast (1.5.0)
43
+ parser (>= 3.0.1.1)
44
+ rubocop-performance (1.11.2)
45
+ rubocop (>= 1.7.0, < 2.0)
46
+ rubocop-ast (>= 0.4.0)
47
+ rubocop-rails (2.10.1)
48
+ activesupport (>= 4.2.0)
49
+ rack (>= 1.1)
50
+ rubocop (>= 1.7.0, < 2.0)
51
+ rubocop-rspec (2.3.0)
52
+ rubocop (~> 1.0)
53
+ rubocop-ast (>= 1.1.0)
54
+ ruby-progressbar (1.11.0)
55
+ standard (1.1.1)
56
+ rubocop (= 1.14.0)
57
+ rubocop-performance (= 1.11.2)
58
+ tzinfo (2.0.4)
59
+ concurrent-ruby (~> 1.0)
60
+ unicode-display_width (2.0.0)
61
+ zeitwerk (2.4.2)
62
+
63
+ PLATFORMS
64
+ ruby
65
+
66
+ DEPENDENCIES
67
+ bundler
68
+ rake
69
+ rubocop-hint!
70
+
71
+ BUNDLED WITH
72
+ 2.1.4
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Hint Media, Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # Hint Ruby/Rails/RSpec Style
2
+
3
+ Shared Hint Rubocop style config
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ group :development, :test do
11
+ gem 'rubocop-hint'
12
+ end
13
+ ```
14
+ _This gem includes Rubocop, RubocopRspec, RubocopRails, RubocopPerformance, and Standard as dependencies._
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install rubocop-hint
23
+
24
+ ## Usage
25
+
26
+ Either create or update the `.rubocop.yml` with the following:
27
+
28
+ ```yaml
29
+ inherit_gem:
30
+ rubocop-hint:
31
+ - default.yml
32
+
33
+ AllCops:
34
+ TargetRubyVersion: PROJECT_RUBY_VERSION
35
+ TargetRailsVersion: PROJECT_RAILS_VERSION
36
+ DisplayCopNames: true
37
+ Exclude:
38
+ - 'bin/**/*'
39
+ - 'config/**/*'
40
+ - 'db/**/*'
41
+ - 'script/**/*'
42
+ - 'test/**/*'
43
+ - 'vendor/**/*'
44
+ ```
45
+
46
+ If there are project specific styles you can override the Hint gem by adding them to `.rubocop.yml`
47
+
48
+ Rubocop's inheritance trail is:
49
+
50
+ `inherit_gem` -> `inherit_from` -> `.rubocop.yml`
51
+
52
+ ## Contributing
53
+
54
+ Pull requests are welcome on GitHub at https://github.com/hintmedia/rubocop-hint.
55
+
56
+
57
+ ## License
58
+
59
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
60
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
data/default.yml ADDED
@@ -0,0 +1,244 @@
1
+ # adding Rubocop to a project run rubocop --auto-gen-config then uncomment line below
2
+ # inherit_from: .rubocop_todo.yml
3
+ require:
4
+ - rubocop-rspec
5
+ - rubocop-rails
6
+ - rubocop-performance
7
+ - standard/cop/block_single_line_braces
8
+
9
+ inherit_mode:
10
+ merge:
11
+ - Exclude
12
+ - Include
13
+
14
+ inherit_gem:
15
+ standard: config/base.yml
16
+
17
+ ## RSPEC CONFIG
18
+
19
+ RSpec/ExampleLength:
20
+ Max: 19
21
+
22
+ RSpec/MultipleExpectations:
23
+ Max: 10
24
+
25
+ RSpec/NamedSubject:
26
+ Enabled: false
27
+
28
+ RSpec/MessageExpectation:
29
+ Enabled: false
30
+
31
+ RSpec/LetSetup:
32
+ Enabled: false
33
+
34
+ RSpec/NestedGroups:
35
+ Enabled: false
36
+
37
+ RSpec/ImplicitBlockExpectation:
38
+ Enabled: false
39
+
40
+ RSpec/MessageChain:
41
+ Enabled: false
42
+
43
+ RSpec/MessageSpies:
44
+ Enabled: false
45
+
46
+ RSpec/AnyInstance:
47
+ Enabled: false
48
+
49
+ ## RAILS CONFIG
50
+ # Based on removed standard configuration:
51
+ # https://github.com/testdouble/standard/commit/94d133f477a5694084ac974d5ee01e8a66ce777e#diff-65478e10d5b2ef41c7293a110c0e6b7c
52
+
53
+ Rails/ActionFilter:
54
+ Enabled: true
55
+ EnforcedStyle: action
56
+ Include:
57
+ - app/controllers/**/*.rb
58
+
59
+ Rails/ActiveRecordAliases:
60
+ Enabled: true
61
+
62
+ Rails/ActiveSupportAliases:
63
+ Enabled: true
64
+
65
+ Rails/ApplicationJob:
66
+ Enabled: true
67
+
68
+ Rails/ApplicationRecord:
69
+ Enabled: true
70
+
71
+ Rails/AssertNot:
72
+ Enabled: true
73
+ Include:
74
+ - '**/test/**/*'
75
+
76
+ Rails/Blank:
77
+ Enabled: true
78
+ # Convert usages of `nil? || empty?` to `blank?`
79
+ NilOrEmpty: true
80
+ # Convert usages of `!present?` to `blank?`
81
+ NotPresent: true
82
+ # Convert usages of `unless present?` to `if blank?`
83
+ UnlessPresent: true
84
+
85
+ Rails/BulkChangeTable:
86
+ Enabled: true
87
+ Database: null
88
+ Include:
89
+ - db/migrate/*.rb
90
+
91
+ Rails/CreateTableWithTimestamps:
92
+ Enabled: true
93
+ Include:
94
+ - db/migrate/*.rb
95
+
96
+ Rails/Date:
97
+ Enabled: true
98
+ EnforcedStyle: flexible
99
+
100
+ Rails/Delegate:
101
+ Enabled: true
102
+ EnforceForPrefixed: true
103
+
104
+ Rails/DelegateAllowBlank:
105
+ Enabled: true
106
+
107
+ Rails/DynamicFindBy:
108
+ Enabled: true
109
+ Whitelist:
110
+ - find_by_sql
111
+
112
+ Rails/EnumUniqueness:
113
+ Enabled: true
114
+ Include:
115
+ - app/models/**/*.rb
116
+
117
+ Rails/EnvironmentComparison:
118
+ Enabled: true
119
+
120
+ Rails/Exit:
121
+ Enabled: true
122
+ Include:
123
+ - app/**/*.rb
124
+ - config/**/*.rb
125
+ - lib/**/*.rb
126
+ Exclude:
127
+ - lib/**/*.rake
128
+
129
+ Rails/FilePath:
130
+ Enabled: true
131
+ EnforcedStyle: arguments
132
+
133
+ Rails/FindBy:
134
+ Enabled: true
135
+ Include:
136
+ - app/models/**/*.rb
137
+
138
+ Rails/FindEach:
139
+ Enabled: true
140
+ Include:
141
+ - app/models/**/*.rb
142
+
143
+ Rails/HasAndBelongsToMany:
144
+ Enabled: true
145
+ Include:
146
+ - app/models/**/*.rb
147
+
148
+ Rails/HttpPositionalArguments:
149
+ Enabled: true
150
+ Include:
151
+ - 'spec/**/*'
152
+ - 'test/**/*'
153
+
154
+ Rails/HttpStatus:
155
+ Enabled: true
156
+ EnforcedStyle: symbolic
157
+
158
+ Rails/InverseOf:
159
+ Enabled: true
160
+ Include:
161
+ - app/models/**/*.rb
162
+
163
+ Rails/LexicallyScopedActionFilter:
164
+ Enabled: true
165
+ Safe: false
166
+ Include:
167
+ - app/controllers/**/*.rb
168
+
169
+ Rails/NotNullColumn:
170
+ Enabled: true
171
+ Include:
172
+ - db/migrate/*.rb
173
+
174
+ Rails/Output:
175
+ Enabled: true
176
+ Include:
177
+ - app/**/*.rb
178
+ - config/**/*.rb
179
+ - db/**/*.rb
180
+ - lib/**/*.rb
181
+
182
+ Rails/OutputSafety:
183
+ Enabled: true
184
+
185
+ Rails/PluralizationGrammar:
186
+ Enabled: true
187
+
188
+ Rails/Presence:
189
+ Enabled: true
190
+
191
+ Rails/Present:
192
+ Enabled: true
193
+ NotNilAndNotEmpty: true
194
+ NotBlank: true
195
+ UnlessBlank: true
196
+
197
+ Rails/ReadWriteAttribute:
198
+ Enabled: true
199
+ Include:
200
+ - app/models/**/*.rb
201
+
202
+ Rails/RedundantReceiverInWithOptions:
203
+ Enabled: true
204
+
205
+ Rails/RefuteMethods:
206
+ Enabled: true
207
+ Include:
208
+ - '**/test/**/*'
209
+
210
+ Rails/RelativeDateConstant:
211
+ Enabled: true
212
+ AutoCorrect: false
213
+
214
+ Rails/RequestReferer:
215
+ Enabled: true
216
+ EnforcedStyle: referer
217
+
218
+ Rails/ReversibleMigration:
219
+ Enabled: true
220
+ Include:
221
+ - db/migrate/*.rb
222
+
223
+ Rails/SafeNavigation:
224
+ Enabled: true
225
+ ConvertTry: false
226
+
227
+ Rails/ScopeArgs:
228
+ Enabled: true
229
+ Include:
230
+ - app/models/**/*.rb
231
+
232
+ Rails/TimeZone:
233
+ Enabled: true
234
+ EnforcedStyle: flexible
235
+
236
+ Rails/UniqBeforePluck:
237
+ Enabled: true
238
+ EnforcedStyle: conservative
239
+ AutoCorrect: false
240
+
241
+ Rails/Validation:
242
+ Enabled: true
243
+ Include:
244
+ - app/models/**/*.rb
@@ -0,0 +1,32 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = 'rubocop-hint'
3
+ spec.version = "0.4.0"
4
+ spec.required_ruby_version = '>= 2.3.0'
5
+ spec.authors = ['Hint']
6
+ spec.email = ['tech@hint.io']
7
+
8
+ spec.summary = "Hint's shared Rubocop style guide"
9
+ spec.homepage = 'https://github.com/hintmedia/hint-rubocop_style'
10
+ spec.license = 'MIT'
11
+
12
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
13
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
14
+ if spec.respond_to?(:metadata)
15
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
16
+ else
17
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
18
+ 'public gem pushes.'
19
+ end
20
+
21
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
22
+ f.match(%r{^(test|spec|features)/})
23
+ end
24
+
25
+ spec.add_dependency 'rubocop', '>= 1.14.0'
26
+ spec.add_dependency 'rubocop-rspec', '>= 2.3.0'
27
+ spec.add_dependency 'rubocop-rails', '>= 2.10.0'
28
+ spec.add_dependency 'rubocop-performance', '>= 1.11.0'
29
+ spec.add_dependency 'standard', '>= 1.1.0'
30
+ spec.add_development_dependency 'bundler'
31
+ spec.add_development_dependency 'rake'
32
+ end
metadata ADDED
@@ -0,0 +1,151 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubocop-hint
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.0
5
+ platform: ruby
6
+ authors:
7
+ - Hint
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-05-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.14.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.14.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.3.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.3.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 2.10.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 2.10.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-performance
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 1.11.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 1.11.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: standard
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 1.1.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 1.1.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description:
112
+ email:
113
+ - tech@hint.io
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - ".gitignore"
119
+ - ".rubocop.yml"
120
+ - Gemfile
121
+ - Gemfile.lock
122
+ - LICENSE.txt
123
+ - README.md
124
+ - Rakefile
125
+ - default.yml
126
+ - rubocop-hint.gemspec
127
+ homepage: https://github.com/hintmedia/hint-rubocop_style
128
+ licenses:
129
+ - MIT
130
+ metadata:
131
+ allowed_push_host: https://rubygems.org
132
+ post_install_message:
133
+ rdoc_options: []
134
+ require_paths:
135
+ - lib
136
+ required_ruby_version: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: 2.3.0
141
+ required_rubygems_version: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ requirements: []
147
+ rubygems_version: 3.1.3
148
+ signing_key:
149
+ specification_version: 4
150
+ summary: Hint's shared Rubocop style guide
151
+ test_files: []