onkcop 0.52.1.1 → 0.53.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
2
  SHA256:
3
- metadata.gz: f2829a1ab9edf1262b0dedc9e9cd2a39e2243ac7e2b5b00a483924963705822e
4
- data.tar.gz: cdd0e610daafc9cafad70cc0e20004891e18b7081a0f8d999fc133eb39921738
3
+ metadata.gz: c970deb16bf2194384e45644f5e4502bf65745da4fddc87ab90b10d97daa2a04
4
+ data.tar.gz: 8f8b981b913402ca8b5f440494054f0ac33e4adfd48b7db7ece9658a5c2c0317
5
5
  SHA512:
6
- metadata.gz: ab357b4c69996f6b795f0f7fe672f9ad308e13ac7fd249c1b69a166cfbb6fa0d34ca89368069123581521044b46c53735c2bc139406dc5b5d46e7bab39a0fd31
7
- data.tar.gz: 23381aafd40181296850e952c23a5243af5ef2a909ff303400a609521ce4f6fb4cef804145c964596a1f100e9779804fdeb85ff0fb5d5df1c1fee844b66e3a87
6
+ metadata.gz: 114714c7b6dbb9cfd205025c641084f578cc20108e5680554a679f34bbd738446665e8c314369ad78d446b9c941cb7e1387e7d2187002b85095f78bed4a9f447
7
+ data.tar.gz: 239638bc2b71115480fc09a92c63bf87eacac43fd4b686bbf65a5f6eb1f1104d6caa335a612ebac71e0b6c8e4f151436d526ed5f3baee9c6f81baeee1194de19
@@ -1,8 +1,5 @@
1
1
  language: ruby
2
- cache: bundler
2
+ # NOTE: travis build fails when `install.bunler` with cache.
3
+ # cache: bundler
3
4
  rvm:
4
5
  - ruby-head
5
- # NOTE: travis build fails on bundler v1.16.1 && rubygems v2.7.3.
6
- # Update travis's rubygems to v2.7.4.
7
- before_install:
8
- - gem update --system
@@ -1,5 +1,17 @@
1
1
  # onkcop
2
2
 
3
+ ## v0.53.0.0 (2018-03-09)
4
+
5
+ * Update `rubocop` v0.53.0 and `rubocop-rspec` v1.24.0
6
+ * `Style/TrailingCommaInLiteral` cop is separated to `Style/TrailingCommaInArrayLiteral` and `Style/TrailingCommaInHashLiteral`
7
+ * `Performance/HashEachMethods` cop is removed
8
+ * Disable new `Naming/UncommunicativeMethodParamName` cop
9
+ * Enable `Style/FormatStringToken` cop
10
+ * Enable new `Style/EmptyLineAfterGuardClause` cop
11
+ * Enable `Lint/Void` cop's mutating methods check
12
+ * Remove `TargetRailsVersion` from template
13
+ * Change `Layout/SpaceInsideBlockBraces` cop option
14
+
3
15
  ## v0.52.1.1 (2018-01-11)
4
16
 
5
17
  * Update `rubocop-rspec` to v1.22.0
data/README.md CHANGED
@@ -27,8 +27,6 @@ inherit_gem:
27
27
 
28
28
  AllCops:
29
29
  TargetRubyVersion: 2.5
30
- # uncomment if use rails cops
31
- # TargetRailsVersion: 5.1
32
30
  ```
33
31
 
34
32
  ```sh
@@ -45,6 +45,11 @@ Layout/IndentationConsistency:
45
45
  Layout/MultilineMethodCallIndentation:
46
46
  EnforcedStyle: indented_relative_to_receiver
47
47
 
48
+ # {} は 1 行で書くときに主に使われるので、スペースよりも
49
+ # 横に長くならない方が嬉しさが多い。
50
+ # そもそも {| のスタイルの方が一般的だったと認識している。
51
+ Layout/SpaceInsideBlockBraces:
52
+ SpaceBeforeBlockParameters: false
48
53
 
49
54
  #################### Lint ##################################
50
55
 
@@ -88,6 +93,12 @@ Lint/UnderscorePrefixedVariableName:
88
93
  Lint/UnusedMethodArgument:
89
94
  Enabled: false
90
95
 
96
+ # select 以外では引っかからないと思うので
97
+ # mutating_methods のチェックを有効に。
98
+ # TODO: select は引数が無い (ブロックのみ) の場合にだけチェックする
99
+ # ようにすると誤検知がほぼ無くなる?
100
+ Lint/Void:
101
+ CheckForMethodsWithNoSideEffects: true
91
102
 
92
103
  #################### Metrics ###############################
93
104
 
@@ -145,6 +156,12 @@ Naming/PredicateName:
145
156
  - "is_"
146
157
  - "have_"
147
158
 
159
+ # 3 文字未満だと指摘されるが、未使用を示す _ や e(rror), b(lock),
160
+ # n(umber) といった 1 文字変数は頻出するし、前置詞(by, to, ...)や
161
+ # よく知られた省略語 (op: operator とか pk: primary key とか) も妥当。
162
+ # 変数 s にどんな文字列かを形容したい場合と、不要な場合とがある=無効
163
+ Naming/UncommunicativeMethodParamName:
164
+ Enabled: false
148
165
 
149
166
  #################### Performance ###########################
150
167
 
@@ -153,11 +170,6 @@ Naming/PredicateName:
153
170
  Performance/Casecmp:
154
171
  Enabled: false
155
172
 
156
- # 2.4 以降では each_key でも特にパフォーマンスに差が無いので
157
- # 読みやすさはほとんど変わらないし、書きやすさを取る。
158
- Performance/HashEachMethods:
159
- Enabled: false
160
-
161
173
 
162
174
  #################### Security ##############################
163
175
 
@@ -237,6 +249,10 @@ Style/EmptyCaseCondition:
237
249
  Style/EmptyElse:
238
250
  EnforcedStyle: empty
239
251
 
252
+ # ガード句と本質を分けるのは良いコードスタイルなので有効化
253
+ Style/EmptyLineAfterGuardClause:
254
+ Enabled: true
255
+
240
256
  # 空メソッドの場合だけ1行で書かなければいけない理由が無い
241
257
  # 「セミコロンは使わない」に寄せた方がルールがシンプル
242
258
  Style/EmptyMethod:
@@ -246,13 +262,6 @@ Style/EmptyMethod:
246
262
  Style/FormatString:
247
263
  EnforcedStyle: percent
248
264
 
249
- # strftime("%Y%m%d") の %d で引っかかる false positive がある。
250
- # また、url escape でも引っかかるらしい。
251
- # see: pull/5230, issues/5242
252
- # 上記 PR はマージされたが、まだダメっぽいので引き続き disable にする
253
- Style/FormatStringToken:
254
- Enabled: false
255
-
256
265
  # まだ対応するには早い
257
266
  Style/FrozenStringLiteralComment:
258
267
  Enabled: false
@@ -385,12 +394,16 @@ Style/TernaryParentheses:
385
394
  Style/TrailingCommaInArguments:
386
395
  EnforcedStyleForMultiline: comma
387
396
 
388
- # 複数行の場合はケツカンマを入れる(リテラル)
397
+ # 複数行の場合はケツカンマを入れる(Arrayリテラル)
389
398
  # JSON がケツカンマを許していないという反対意見もあるが、
390
399
  # 古い JScript の仕様に縛られる必要は無い。
391
400
  # IE9 以降はリテラルでケツカンマ OK なので正しい差分行の検出に寄せる。
392
401
  # 2 insertions(+), 1 deletion(-) ではなく、1 insertions
393
- Style/TrailingCommaInLiteral:
402
+ Style/TrailingCommaInArrayLiteral:
403
+ EnforcedStyleForMultiline: comma
404
+
405
+ # 複数行の場合はケツカンマを入れる(Hashリテラル)
406
+ Style/TrailingCommaInHashLiteral:
394
407
  EnforcedStyleForMultiline: comma
395
408
 
396
409
  # %w() と %i() が見分けづらいので Style/SymbolArray と合わせて無効に。
@@ -1,3 +1,3 @@
1
1
  module Onkcop
2
- VERSION = "0.52.1.1"
2
+ VERSION = "0.53.0.0"
3
3
  end
@@ -1,5 +1,4 @@
1
- # coding: utf-8
2
- lib = File.expand_path("../lib", __FILE__)
1
+ lib = File.expand_path("lib", __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require "onkcop/version"
5
4
 
@@ -14,13 +13,13 @@ Gem::Specification.new do |spec|
14
13
  spec.homepage = "https://github.com/onk/onkcop"
15
14
  spec.license = "MIT"
16
15
 
17
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
+ spec.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
18
17
  spec.bindir = "exe"
19
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
+ spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
20
19
  spec.require_paths = ["lib"]
21
20
 
22
- spec.add_dependency "rubocop", "~> 0.52.1"
23
- spec.add_dependency "rubocop-rspec", ">= 1.22.0"
21
+ spec.add_dependency "rubocop", "~> 0.53.0"
22
+ spec.add_dependency "rubocop-rspec", ">= 1.24.0"
24
23
  spec.add_development_dependency "bundler"
25
24
  spec.add_development_dependency "rake"
26
25
  spec.add_development_dependency "rspec"
@@ -8,5 +8,3 @@ inherit_gem:
8
8
 
9
9
  AllCops:
10
10
  TargetRubyVersion: 2.5
11
- # uncomment if use rails cops
12
- # TargetRailsVersion: 5.1
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.52.1.1
4
+ version: 0.53.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: 2018-01-11 00:00:00.000000000 Z
11
+ date: 2018-03-08 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.52.1
19
+ version: 0.53.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.52.1
26
+ version: 0.53.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.22.0
33
+ version: 1.24.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.22.0
40
+ version: 1.24.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.7.3
131
+ rubygems_version: 2.7.6
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: OnkCop is a RuboCop configration gem.