onkcop 0.47.1.2 → 0.48.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
  SHA1:
3
- metadata.gz: 842bb27a00cbeab57f69808103045d43b603f5a7
4
- data.tar.gz: 2ba0ef8f31bc53fd70a7f23565606f3d34f6d3ce
3
+ metadata.gz: fd88a1e7c280b9906ee97779d4ab30ededc487c7
4
+ data.tar.gz: 40667f4dccfe647bf057ca1d9ae47761fee83e40
5
5
  SHA512:
6
- metadata.gz: bdb0eb4be5b8754c8412a4f9e17e62465d2b84750295b7e976362f1b44b18e380adfaef09f993a639cf6b0d015c9380d10fd4c7d3cc0371352e07f8d9d1b3c4f
7
- data.tar.gz: 6f29e9370610ee8ca5609951b5408032ab3172ecc5f9ff5b509ec5b2c24173ed5ee36dfe68ad3f097f0f1209f7de32d353b32d2e4bd42530358428b453b8dd11
6
+ metadata.gz: 5022365b6f6c2c676255435abe44815ad9f2b0d92700432849c58c2344ad4020ba8c37217f6eb699fbb984061c35b4dab07f0e0bd54aeea611f3453fedb150c2
7
+ data.tar.gz: 5cd30da46be0569c8e6b1e2d9f083fbc543c86942ba566372292d908a68d2bdd15b603eaf424a4504bb0cb1bd5cf619c28bf179229304095ad605b89e6ec25cc
@@ -1,5 +1,19 @@
1
1
  # onkcop
2
2
 
3
+ ## v0.48.0.0 (2017-03-29)
4
+
5
+ [full changelog](https://github.com/onk/onkcop/compare/v0.47.1.2...v0.48.0.0)
6
+
7
+ * Update `rubocop` v0.48.0.
8
+ * Disable new `Lint/AmbiguousBlockAssociation` cop.
9
+ * Disable new `Rails/Blank` cop.
10
+ * Disable `Style/SymbolArray`, `StyleWordArray` cop.
11
+ * Change `Style/MultilineMethodCallIndentation` to `indented_relative_to_receiver` style.
12
+ * Exclude RSpec directory from new `Style/MixinGrouping` cop.
13
+ * Ignore `node_modules` dir.
14
+ * Add `TargetRailsVersion` to README and template
15
+
16
+
3
17
  ## v0.47.1.2 (2017-03-01)
4
18
 
5
19
  [full changelog](https://github.com/onk/onkcop/compare/v0.47.1.1...v0.47.1.2)
data/README.md CHANGED
@@ -26,6 +26,8 @@ inherit_gem:
26
26
 
27
27
  AllCops:
28
28
  TargetRubyVersion: 2.4
29
+ # uncomment if use rails cops
30
+ # TargetRailsVersion: 5.0
29
31
  ```
30
32
 
31
33
  ```sh
@@ -1,6 +1,10 @@
1
1
  Rails:
2
2
  Enabled: true
3
3
 
4
+ # v0.48.0 に `||` でエラーになるバグがあるため。 pull/4175
5
+ Rails/Blank:
6
+ Enabled: false
7
+
4
8
  # slug とか created_by とか、NOT NULL だが create_table 時に
5
9
  # default 値を定義できないカラムは存在する。
6
10
  Rails/NotNullColumn:
@@ -21,7 +21,6 @@ RSpec/InstanceVariable:
21
21
  Enabled: false
22
22
 
23
23
  # 強く 1 example 1 assertion の立場は取らないが、多すぎてもツラいので。
24
- # aggregate_failures で囲われていたら無視する的なオプション欲しい。
25
24
  RSpec/MultipleExpectations:
26
25
  Max: 3
27
26
 
@@ -1,14 +1,12 @@
1
- # target_version:
2
- # rubocop v0.47.1
3
-
4
1
  # 自動生成されるものはチェック対象から除外する
5
2
  AllCops:
6
3
  Exclude:
7
4
  - "vendor/**/*" # rubocop config/default.yml
8
5
  - "db/schema.rb"
6
+ - "node_modules/**/*"
9
7
  DisplayCopNames: true
10
8
 
11
- ##################### Style ##################################
9
+ #################### Style #################################
12
10
 
13
11
  # レキシカルスコープの扱いが alias_method の方が自然。
14
12
  # https://ernie.io/2014/10/23/in-defense-of-alias/ のように
@@ -147,9 +145,23 @@ Style/Lambda:
147
145
  Style/MethodCalledOnDoEndBlock:
148
146
  Enabled: true
149
147
 
148
+ # RSpec の matcher を誤検知するため
149
+ # expect(array).to include("a", "b")
150
+ Style/MixinGrouping:
151
+ Exclude:
152
+ - "spec/**/*"
153
+
154
+ # メソッドチェーン感がより感じられるインデントにする
155
+ Style/MultilineMethodCallIndentation:
156
+ EnforcedStyle: indented_relative_to_receiver
157
+
150
158
  # 1_000_000 と区切り文字が 2 個以上必要になる場合のみ _ 区切りを必須にする
159
+ # 10_000_00 は許可しない。(これは例えば 10000 ドルをセント単位にする時に便利だが
160
+ # 頻出しないので foolproof に振る
161
+ # TODO: Strict パラメータは warning が出るので一旦無効に。 pull/4180
151
162
  Style/NumericLiterals:
152
163
  MinDigits: 7
164
+ # Strict: true
153
165
 
154
166
  # foo.positive? は foo > 0 に比べて意味が曖昧になる
155
167
  # foo.zero? は許可したいけどメソッドごとに指定できないので一括で disable に
@@ -206,6 +218,11 @@ Style/StringLiteralsInInterpolation:
206
218
  Style/StringMethods:
207
219
  Enabled: true
208
220
 
221
+ # %w() と %i() が見分けづらいので Style/WordArray と合わせて無効に。
222
+ # 書き手に委ねるという意味で、Enabled: false にしています。使っても良い。
223
+ Style/SymbolArray:
224
+ Enabled: false
225
+
209
226
  # 三項演算子は分かりやすく使いたい。
210
227
  # () を外さない方が条件式が何なのか読み取りやすいと感じる。
211
228
  Style/TernaryParentheses:
@@ -215,6 +232,11 @@ Style/TernaryParentheses:
215
232
  Style/TrailingCommaInLiteral:
216
233
  EnforcedStyleForMultiline: comma
217
234
 
235
+ # %w() と %i() が見分けづらいので Style/SymbolArray と合わせて無効に。
236
+ # 書き手に委ねるという意味で、Enabled: false にしています。使っても良い。
237
+ Style/WordArray:
238
+ Enabled: false
239
+
218
240
  # 条件式で arr.size > 0 が使われた時に
219
241
  # if !arr.empty?
220
242
  # else
@@ -224,7 +246,18 @@ Style/TrailingCommaInLiteral:
224
246
  Style/ZeroLengthPredicate:
225
247
  Enabled: false
226
248
 
227
- ##################### Lint ##################################
249
+ #################### Lint ##################################
250
+
251
+ # メソッドの引数に lambda を渡すパターンが検出されるため。
252
+ # この場合は単一引数だし Ambiguous ではない (と思う) ので誤検知っぽい。
253
+ # some_method ->(a) { a }
254
+ # pull/4191 で修正済み
255
+ #
256
+ # assignment(`=`) が OK で `==`, `!=` が NG なのも考慮漏れっぽく見える。
257
+ # if [a, b] != array.sort_by { |e| e["id"] }
258
+ # は右から評価されるのを意図しているし違和感無い。
259
+ Lint/AmbiguousBlockAssociation:
260
+ Enabled: false
228
261
 
229
262
  # Style/EmptyCaseCondition と同じく網羅の表現力が empty when を認めた方が高いし、
230
263
  # 頻出する対象を最初の when で撥ねるのはパフォーマンス向上で頻出する。
@@ -255,7 +288,7 @@ Lint/UnderscorePrefixedVariableName:
255
288
  Lint/UnusedMethodArgument:
256
289
  Enabled: false
257
290
 
258
- ##################### Metrics ##################################
291
+ #################### Metrics ###############################
259
292
 
260
293
  # 30 まではギリギリ許せる範囲だったけど
261
294
  # リリースごとに 3 ずつぐらい下げていきます。20 まで下げたい。
@@ -298,7 +331,7 @@ Metrics/MethodLength:
298
331
  Metrics/PerceivedComplexity:
299
332
  Max: 8
300
333
 
301
- ##################### Security ##################################
334
+ #################### Security ##############################
302
335
 
303
336
  # 毎回 YAML.safe_load(yaml_str, [Date, Time]) するのは面倒で。。
304
337
  Security/YAMLLoad:
@@ -1,3 +1,3 @@
1
1
  module Onkcop
2
- VERSION = "0.47.1.2"
2
+ VERSION = "0.48.0.0"
3
3
  end
@@ -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.47.1"
23
- spec.add_dependency "rubocop-rspec", ">= 1.12.0"
22
+ spec.add_dependency "rubocop", "~> 0.48.0"
23
+ spec.add_dependency "rubocop-rspec", ">= 1.15.0"
24
24
  spec.add_development_dependency "bundler"
25
25
  spec.add_development_dependency "rake"
26
26
  end
@@ -8,3 +8,5 @@ inherit_gem:
8
8
 
9
9
  AllCops:
10
10
  TargetRubyVersion: 2.4
11
+ # uncomment if use rails cops
12
+ # TargetRailsVersion: 5.0
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.47.1.2
4
+ version: 0.48.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-03-01 00:00:00.000000000 Z
11
+ date: 2017-03-29 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.47.1
19
+ version: 0.48.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.47.1
26
+ version: 0.48.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.12.0
33
+ version: 1.15.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.12.0
40
+ version: 1.15.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement