unifacop 0.66.0.0 → 0.82.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 +4 -4
- data/config/performance.yml +10 -0
- data/config/rails.yml +2 -0
- data/config/rubocop.yml +49 -32
- data/lib/unifacop/cli.rb +2 -2
- data/lib/unifacop/version.rb +1 -1
- data/templates/.rubocop.yml +3 -2
- data/unifacop.gemspec +6 -3
- metadata +36 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dca54e6b4e298b1d08aaa6f9d58cf63190f13fa268711c5ae4571b184aa4b339
|
4
|
+
data.tar.gz: faae672828ccd280f3a34495876a1ca05654fd8afbe519fdeda000ef8a7b01fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8da3a4c78e7e385bf7072ae77fa9ec41f2a8f6d1741eb636a1e50e9c1fbfd962fce3389ae01c108df29f5577dcb2b5e8c567d22c9f424015f480920130aac261
|
7
|
+
data.tar.gz: 5b28d2f65126b4075932c0546264326529f97f95e69fb4c1bce3c3443efd5c022eec5e86dc73b45b63d8919dd4c7a1be456e7d93c1d7938f0a36c8e2a7b498d8
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require: 'rubocop-performance'
|
2
|
+
|
3
|
+
## Performance
|
4
|
+
# https://github.com/rubocop-hq/rubocop-performance/blob/master/manual/cops_performance.md
|
5
|
+
|
6
|
+
# onkcop参照
|
7
|
+
# > downcase or upcase しての比較はイディオムの域なので、多少の
|
8
|
+
# > パフォーマンスの違いがあろうが casecmp に変える意義を感じない
|
9
|
+
Performance/Casecmp:
|
10
|
+
Enabled: false
|
data/config/rails.yml
CHANGED
data/config/rubocop.yml
CHANGED
@@ -19,12 +19,6 @@ AllCops:
|
|
19
19
|
## Layout cops
|
20
20
|
# https://rubocop.readthedocs.io/en/latest/cops_layout/
|
21
21
|
|
22
|
-
# Does not allow both table and key alignment
|
23
|
-
# From v0.70.0 there are more configuration
|
24
|
-
# options it so could be used
|
25
|
-
Layout/AlignHash:
|
26
|
-
Enabled: false
|
27
|
-
|
28
22
|
# ユニファの既存コードを見ると「leading」が多いため、こちらに統一する。
|
29
23
|
Layout/DotPosition:
|
30
24
|
Enabled: true
|
@@ -38,15 +32,31 @@ Layout/EmptyLinesAroundArguments:
|
|
38
32
|
# > special_inside_parentheses (default) と比べて
|
39
33
|
# > * 横に長くなりづらい
|
40
34
|
# > * メソッド名の長さが変わったときに diff が少ない
|
41
|
-
Layout/
|
35
|
+
Layout/FirstArrayElementIndentation:
|
42
36
|
EnforcedStyle: consistent
|
43
37
|
|
44
38
|
# onkcop参照
|
45
39
|
# > ({ と hash を開始した場合に ( の位置にインデントさせる
|
46
40
|
# > そもそも {} が必要ない可能性が高いが Style/BracesAroundHashParameters はチェックしないことにしたので
|
47
|
-
Layout/
|
41
|
+
Layout/FirstHashElementIndentation:
|
48
42
|
EnforcedStyle: consistent
|
49
43
|
|
44
|
+
# Allow both table and key hash alignment
|
45
|
+
Layout/HashAlignment:
|
46
|
+
EnforcedColonStyle:
|
47
|
+
- key
|
48
|
+
- table
|
49
|
+
EnforcedHashRocketStyle:
|
50
|
+
- key
|
51
|
+
- table
|
52
|
+
|
53
|
+
# 多くのRubyコーディング規約では「80」か「100」が主流な値であった。
|
54
|
+
# 「80」だと厳しすぎるので、「100」に設定する。
|
55
|
+
Layout/LineLength:
|
56
|
+
Max: 100
|
57
|
+
Exclude:
|
58
|
+
- 'db/migrate/*.rb'
|
59
|
+
|
50
60
|
# onkcop参照
|
51
61
|
# > メソッドチェーン感がより感じられるインデントにする
|
52
62
|
# 個人的にもこの形式の方が、上の行とのつながりを感じられるのでいいと思う。
|
@@ -58,6 +68,9 @@ Layout/MultilineMethodCallIndentation:
|
|
58
68
|
Layout/RescueEnsureAlignment:
|
59
69
|
Enabled: false
|
60
70
|
|
71
|
+
Layout/SpaceAroundMethodCallOperator:
|
72
|
+
Enabled: true
|
73
|
+
|
61
74
|
## Lint cops
|
62
75
|
# https://rubocop.readthedocs.io/en/latest/cops_lint/
|
63
76
|
|
@@ -95,6 +108,12 @@ Lint/EmptyWhen:
|
|
95
108
|
Lint/InheritException:
|
96
109
|
EnforcedStyle: standard_error
|
97
110
|
|
111
|
+
Lint/RaiseException:
|
112
|
+
Enabled: true
|
113
|
+
|
114
|
+
Lint/StructNewOverride:
|
115
|
+
Enabled: true
|
116
|
+
|
98
117
|
# キーワード引数の先頭に「_」をつけてしまうと、呼び出し側で「_」をつけて呼ばないとキーが存在せずエラーになってしまうため。
|
99
118
|
Lint/UnusedMethodArgument:
|
100
119
|
AllowUnusedKeywordArguments: true
|
@@ -137,13 +156,6 @@ Metrics/ClassLength:
|
|
137
156
|
Metrics/CyclomaticComplexity:
|
138
157
|
Max: 10
|
139
158
|
|
140
|
-
# 多くのRubyコーディング規約では「80」か「100」が主流な値であった。
|
141
|
-
# 「80」だと厳しすぎるので、「100」に設定する。
|
142
|
-
Metrics/LineLength:
|
143
|
-
Max: 100
|
144
|
-
Exclude:
|
145
|
-
- 'db/migrate/*.rb'
|
146
|
-
|
147
159
|
# onkcop参照
|
148
160
|
# > 20 行超えるのは migration ファイル以外滅多に無い
|
149
161
|
Metrics/MethodLength:
|
@@ -167,27 +179,23 @@ Metrics/PerceivedComplexity:
|
|
167
179
|
## Naming
|
168
180
|
# http://rubocop.readthedocs.io/en/latest/cops_naming/
|
169
181
|
|
182
|
+
# Allow short method param names like e or _
|
183
|
+
Naming/MethodParameterName:
|
184
|
+
Enabled: false
|
185
|
+
|
170
186
|
# onkcop参照
|
171
187
|
# > has_ から始まるメソッドは許可する
|
172
188
|
Naming/PredicateName:
|
173
|
-
|
189
|
+
ForbiddenPrefixes:
|
174
190
|
- 'is_'
|
175
191
|
- 'have_'
|
176
192
|
NamePrefix:
|
177
193
|
- 'is_'
|
178
194
|
- 'have_'
|
179
195
|
|
180
|
-
#
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
## Performance
|
185
|
-
# https://rubocop.readthedocs.io/en/latest/cops_performance/
|
186
|
-
|
187
|
-
# onkcop参照
|
188
|
-
# > downcase or upcase しての比較はイディオムの域なので、多少の
|
189
|
-
# > パフォーマンスの違いがあろうが casecmp に変える意義を感じない
|
190
|
-
Performance/Casecmp:
|
196
|
+
# This limits variable name exceptions
|
197
|
+
# Can be set on a per project basis if needed
|
198
|
+
Naming/RescuedExceptionsVariableName:
|
191
199
|
Enabled: false
|
192
200
|
|
193
201
|
## Security
|
@@ -221,11 +229,6 @@ Style/BlockDelimiters:
|
|
221
229
|
Exclude:
|
222
230
|
- 'spec/**/*'
|
223
231
|
|
224
|
-
# onkcop参照
|
225
|
-
# > option 等、明示的にハッシュにした方が分かりやすい場合もある
|
226
|
-
Style/BracesAroundHashParameters:
|
227
|
-
Enabled: false
|
228
|
-
|
229
232
|
# onkcop参照
|
230
233
|
# > scope が違うとか親 module の存在確認が必要とかデメリットはあるが、
|
231
234
|
# > namespace 付きのクラスはかなり頻繁に作るので簡単に書きたい。
|
@@ -278,6 +281,9 @@ Style/EmptyMethod:
|
|
278
281
|
Style/Encoding:
|
279
282
|
Enabled: true
|
280
283
|
|
284
|
+
Style/ExponentialNotation:
|
285
|
+
Enabled: true
|
286
|
+
|
281
287
|
# onkcop参照
|
282
288
|
# > strftime("%Y%m%d") の %d で引っかかる false positive がある。
|
283
289
|
# > また、url escape でも引っかかるらしい。
|
@@ -293,6 +299,17 @@ Style/FormatStringToken:
|
|
293
299
|
Style/GuardClause:
|
294
300
|
MinBodyLength: 5
|
295
301
|
|
302
|
+
# Both .each_key and .keys.each are readable
|
303
|
+
# and have different return values
|
304
|
+
Style/HashEachMethods:
|
305
|
+
Enabled: false
|
306
|
+
|
307
|
+
Style/HashTransformKeys:
|
308
|
+
Enabled: true
|
309
|
+
|
310
|
+
Style/HashTransformValues:
|
311
|
+
Enabled: true
|
312
|
+
|
296
313
|
# onkcop参照
|
297
314
|
# > rake タスクの順序の hash は rocket を許可する。
|
298
315
|
Style/HashSyntax:
|
data/lib/unifacop/cli.rb
CHANGED
@@ -27,7 +27,7 @@ module UniFaCop
|
|
27
27
|
return nil if args.empty?
|
28
28
|
|
29
29
|
meth = args.first.to_s
|
30
|
-
args.shift
|
30
|
+
args.shift unless /^\-/.match?(meth)
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.print_help
|
@@ -35,7 +35,7 @@ module UniFaCop
|
|
35
35
|
puts ' init - Setup .rubocop.yml'
|
36
36
|
end
|
37
37
|
|
38
|
-
CONFIG_FILE_NAME = '.rubocop.yml'
|
38
|
+
CONFIG_FILE_NAME = '.rubocop.yml'
|
39
39
|
|
40
40
|
def init(args)
|
41
41
|
raise 'usage: unifacop init' unless args.empty?
|
data/lib/unifacop/version.rb
CHANGED
data/templates/.rubocop.yml
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
inherit_gem:
|
2
2
|
unifacop:
|
3
3
|
- 'config/rubocop.yml'
|
4
|
+
- 'config/performance.yml'
|
4
5
|
# Uncomment if your project uses rails. Do not forget to specify TargetRailsVersion.
|
5
6
|
#- 'config/rails.yml'
|
6
|
-
# Uncomment
|
7
|
+
# Uncomment to use rspec cops
|
7
8
|
#- 'config/rspec.yml'
|
8
9
|
|
9
10
|
inherit_from:
|
@@ -12,7 +13,7 @@ inherit_from:
|
|
12
13
|
AllCops:
|
13
14
|
# Please specify your Ruby version
|
14
15
|
TargetRubyVersion: 2.4
|
15
|
-
#
|
16
|
+
# Uncomment if using rails cops
|
16
17
|
#TargetRailsVersion: 5.0
|
17
18
|
|
18
19
|
# Add your project specific configurations here.
|
data/unifacop.gemspec
CHANGED
@@ -21,10 +21,13 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.required_ruby_version = '>= 2.
|
24
|
+
spec.required_ruby_version = '>= 2.4.0'
|
25
|
+
|
26
|
+
spec.add_runtime_dependency 'rubocop', '~> 0.82.0'
|
27
|
+
spec.add_runtime_dependency 'rubocop-performance', '~> 1.5.2'
|
28
|
+
spec.add_runtime_dependency 'rubocop-rails', '~> 2.5.2'
|
29
|
+
spec.add_runtime_dependency 'rubocop-rspec', '>= 1.39.0'
|
25
30
|
|
26
|
-
spec.add_runtime_dependency 'rubocop', '~> 0.66.0'
|
27
|
-
spec.add_runtime_dependency 'rubocop-rspec', '>= 1.35.0'
|
28
31
|
spec.add_development_dependency 'bundler'
|
29
32
|
spec.add_development_dependency 'rake'
|
30
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unifacop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.82.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UniFa Co. Ltd.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,28 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.82.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.
|
26
|
+
version: 0.82.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop-performance
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.5.2
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.5.2
|
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.5.2
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.5.2
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
56
|
name: rubocop-rspec
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
30
58
|
requirements:
|
31
59
|
- - ">="
|
32
60
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
61
|
+
version: 1.39.0
|
34
62
|
type: :runtime
|
35
63
|
prerelease: false
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
37
65
|
requirements:
|
38
66
|
- - ">="
|
39
67
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
68
|
+
version: 1.39.0
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: bundler
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,6 +103,7 @@ extensions: []
|
|
75
103
|
extra_rdoc_files: []
|
76
104
|
files:
|
77
105
|
- Gemfile
|
106
|
+
- config/performance.yml
|
78
107
|
- config/rails.yml
|
79
108
|
- config/rspec.yml
|
80
109
|
- config/rubocop.yml
|
@@ -95,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
95
124
|
requirements:
|
96
125
|
- - ">="
|
97
126
|
- !ruby/object:Gem::Version
|
98
|
-
version: 2.
|
127
|
+
version: 2.4.0
|
99
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
129
|
requirements:
|
101
130
|
- - ">="
|