onkcop 0.49.1.1 → 0.50.0.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
- SHA1:
3
- metadata.gz: fdb37d6c801687405ca031a85f0a7becbf4beeb0
4
- data.tar.gz: 16759f03e1651e13263c324ede37bd5e480f7fa4
2
+ SHA256:
3
+ metadata.gz: ea0e6f1ee700df43e3b42b05de75ffb8518163704fa42021f9c74c3fadd6e499
4
+ data.tar.gz: a9743904e7f371cfe3d14602a50b187031ccc4033bb02e46392511aff46ae960
5
5
  SHA512:
6
- metadata.gz: 26a1f18ad9d6a1bc38f8bbedd24a90804ec65dd1a85f26a234f45a074e774f1512f1ee6479f6ec4726e66b066bcd4b98e68da1e4082541ed900d918445d30a36
7
- data.tar.gz: 291d56ab68641568f03c166192a866b09509140af9c36c31eab31552c1afd4683c2df878ad61b5caf6b213988079422733c96426bd4d871b80a825809f279918
6
+ metadata.gz: b9aaa2d2d3c18f1dd407e68fdce3a7cbcbe038f3498fc3874eff8035a5d0bc537ef43750483c982fdaeadaac9b92925904e2f8a04112f2f8f969b7e410db9830
7
+ data.tar.gz: cb920dd1f004222fc5e31d0bb2a877b140bfdf6120a252d8b813efc06e7b2c597bbd4c677aa03cde0a6d64fe1537fd35d4b45454e2acb38b222f876f90499747
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # onkcop
2
2
 
3
+ ## v0.50.0.0 (2017-10-12)
4
+
5
+ * Update `rubocop` v0.50.0 and `rubocop-rspec` v1.18.0
6
+ * Disable `Performance/HashEachMethods` cop
7
+ * Disable new `Style/OrAssignment` cop
8
+ * Change cop's department from `Style` to `Naming`
9
+ * Disable new `Lint/RescueWithoutErrorClass` cop
10
+ * `node_modules` directory is now excluded by rubocop as default
11
+ * Enable `Style/YodaCondition` cop with `equality_operators_only` style
12
+
13
+
3
14
  ## v0.49.1.1 (2017-09-11)
4
15
 
5
16
  [full changelog](https://github.com/onk/onkcop/compare/v0.49.1.0...v0.49.1.1)
data/config/rubocop.yml CHANGED
@@ -1,9 +1,9 @@
1
1
  # 自動生成されるものはチェック対象から除外する
2
2
  AllCops:
3
3
  Exclude:
4
- - "vendor/**/*" # rubocop config/default.yml
4
+ - "node_modules/**/*" # rubocop config/default.yml
5
+ - "vendor/**/*" # rubocop config/default.yml
5
6
  - "db/schema.rb"
6
- - "node_modules/**/*"
7
7
  DisplayCopNames: true
8
8
 
9
9
  #################### Layout ################################
@@ -164,20 +164,16 @@ Style/NumericLiterals:
164
164
  Style/NumericPredicate:
165
165
  Enabled: false
166
166
 
167
+ # falsy な場合という条件式の方を意識させたい場合がある。
168
+ # Style/IfUnlessModifier と同じ雰囲気。
169
+ Style/OrAssignment:
170
+ Enabled: false
171
+
167
172
  # 正規表現にマッチさせた時の特殊変数の置き換えは Regex.last_match ではなく
168
173
  # 名前付きキャプチャを使って参照したいので auto-correct しない
169
174
  Style/PerlBackrefs:
170
175
  AutoCorrect: false
171
176
 
172
- # has_ から始まるメソッドは許可する
173
- Style/PredicateName:
174
- NamePrefixBlacklist:
175
- - "is_"
176
- - "have_"
177
- NamePrefix:
178
- - "is_"
179
- - "have_"
180
-
181
177
  # Hash#has_key? の方が key? よりも意味が通る
182
178
  Style/PreferredHashMethods:
183
179
  EnforcedStyle: verbose
@@ -243,10 +239,9 @@ Style/TrailingCommaInLiteral:
243
239
  EnforcedStyleForMultiline: comma
244
240
 
245
241
  # 0 <= foo && foo < 5 のように数直線上に並べるのは
246
- # コードを読みやすくするテクニック。
247
- # また、self == other, __FILE__ == $0 はイディオムなので許可。
242
+ # コードを読みやすくするテクニックなので equality_operators_only に。
248
243
  Style/YodaCondition:
249
- Enabled: false
244
+ EnforcedStyle: equality_operators_only
250
245
 
251
246
  # %w() と %i() が見分けづらいので Style/SymbolArray と合わせて無効に。
252
247
  # 書き手に委ねるという意味で、Enabled: false にしています。使っても良い。
@@ -262,6 +257,17 @@ Style/WordArray:
262
257
  Style/ZeroLengthPredicate:
263
258
  Enabled: false
264
259
 
260
+ #################### Naming ################################
261
+
262
+ # has_ から始まるメソッドは許可する
263
+ Naming/PredicateName:
264
+ NamePrefixBlacklist:
265
+ - "is_"
266
+ - "have_"
267
+ NamePrefix:
268
+ - "is_"
269
+ - "have_"
270
+
265
271
  #################### Lint ##################################
266
272
 
267
273
  # spec 内では
@@ -291,6 +297,13 @@ Lint/EmptyWhen:
291
297
  Lint/InheritException:
292
298
  EnforcedStyle: standard_error
293
299
 
300
+ # 無指定だと StandardError を rescue するのは常識の範疇なので。
301
+ # https://github.com/bbatsov/rubocop/issues/2943#issuecomment-330498533
302
+ # rescue 後に何をするかは Lint/HandleExceptions でチェックするので
303
+ # ココで想起させる必要は無さそう。
304
+ Lint/RescueWithoutErrorClass:
305
+ Enabled: false
306
+
294
307
  # * 同名のメソッドがある場合にローカル変数に `_` を付ける
295
308
  # * 一時変数として `_` を付ける
296
309
  # というテクニックは頻出する
@@ -352,6 +365,11 @@ Metrics/PerceivedComplexity:
352
365
  Performance/Casecmp:
353
366
  Enabled: false
354
367
 
368
+ # 2.4 以降では each_key でも特にパフォーマンスに差が無いので
369
+ # 読みやすさはほとんど変わらないし、書きやすさを取る。
370
+ Performance/HashEachMethods:
371
+ Enabled: false
372
+
355
373
  #################### Security ##############################
356
374
 
357
375
  # 毎回 YAML.safe_load(yaml_str, [Date, Time]) するのは面倒で。。
@@ -1,3 +1,3 @@
1
1
  module Onkcop
2
- VERSION = "0.49.1.1"
2
+ VERSION = "0.50.0.0"
3
3
  end
data/onkcop.gemspec CHANGED
@@ -19,8 +19,8 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_dependency "rubocop", "~> 0.49.1"
23
- spec.add_dependency "rubocop-rspec", ">= 1.16.0"
22
+ spec.add_dependency "rubocop", "~> 0.50.0"
23
+ spec.add_dependency "rubocop-rspec", ">= 1.18.0"
24
24
  spec.add_development_dependency "bundler"
25
25
  spec.add_development_dependency "rake"
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onkcop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.1.1
4
+ version: 0.50.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takafumi ONAKA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-11 00:00:00.000000000 Z
11
+ date: 2017-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.49.1
19
+ version: 0.50.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.49.1
26
+ version: 0.50.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rubocop-rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.16.0
33
+ version: 1.18.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.16.0
40
+ version: 1.18.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.6.13
115
+ rubygems_version: 2.6.14
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: OnkCop is a RuboCop configration gem.