onkcop 0.46.0.0 → 0.46.0.1
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/CHANGELOG.md +19 -1
- data/README.md +8 -2
- data/config/rspec.yml +0 -8
- data/exe/onkcop +10 -0
- data/lib/onkcop/cli.rb +43 -0
- data/lib/onkcop/version.rb +1 -1
- data/lib/onkcop.rb +1 -0
- data/onkcop.gemspec +1 -1
- data/templates/.rubocop.yml +10 -0
- metadata +9 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f83267878bb72574be70f0738e90277de55c45f6
|
4
|
+
data.tar.gz: 6e51ecd9a4c2f65ec68d460decc73f92672ae175
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 174e751b5ece43776d88f8514439f1e7254254d171bc25fb43cfc6b3daa135ef150e57bfae0ca35b17a3969db357ef7bfd9b28a8ffa4b181beb4710900809d5d
|
7
|
+
data.tar.gz: 43f729b1a5e0662d02519f3e9fe63270da0de5b5a53f2ea8c8e290bec26d0b05c02f4f2f296c56356461dd4f1cc544a8d337e152630b32a4e2ba013b1152bf9d
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,24 @@
|
|
1
1
|
# onkcop
|
2
2
|
|
3
|
-
## v0.
|
3
|
+
## v0.46.0.1 (2017-01-07)
|
4
|
+
|
5
|
+
[full changelog](https://github.com/onk/onkcop/compare/v0.46.0.0...v0.46.0.1)
|
6
|
+
|
7
|
+
* Update to `rubocop-rspec` v1.9.1.
|
8
|
+
* Disable `RSpec/MessageExpectation` cop that is replaced with a new cop: `RSpec/MessageSpies`.
|
9
|
+
* Add CLI for setup `.rubocop.yml`.
|
10
|
+
|
11
|
+
|
12
|
+
## v0.46.0.0 (2016-11-30)
|
13
|
+
|
14
|
+
[full changelog](https://github.com/onk/onkcop/compare/v0.45.0.0...v0.46.0.0)
|
15
|
+
|
16
|
+
* Update to `rubocop` v0.46.0.
|
17
|
+
* Use new `Style/EmptyMethod` cop with `expanded` style.
|
18
|
+
* Use `Style/TernaryParentheses` cop `require_parentheses_when_complex` style.
|
19
|
+
|
20
|
+
|
21
|
+
## v0.45.0.0 (2016-11-02)
|
4
22
|
[full changelog](https://github.com/onk/onkcop/compare/v0.44.1.1...v0.45.0.0)
|
5
23
|
|
6
24
|
* Update to `rubocop` v0.45.0 and `rubocop-rspec` v1.8.0.
|
data/README.md
CHANGED
@@ -7,7 +7,13 @@ OnkCop is a RuboCop configration gem.
|
|
7
7
|
|
8
8
|
## Usage
|
9
9
|
|
10
|
-
|
10
|
+
Setup .rubocop.yml
|
11
|
+
|
12
|
+
```sh
|
13
|
+
bundle exec onkcop init
|
14
|
+
```
|
15
|
+
|
16
|
+
`init` generate the following directive to your `.rubocop.yml`:
|
11
17
|
|
12
18
|
```yaml
|
13
19
|
inherit_gem:
|
@@ -19,7 +25,7 @@ inherit_gem:
|
|
19
25
|
# - "config/rspec.yml"
|
20
26
|
|
21
27
|
AllCops:
|
22
|
-
TargetRubyVersion: 2.
|
28
|
+
TargetRubyVersion: 2.4
|
23
29
|
```
|
24
30
|
|
25
31
|
```sh
|
data/config/rspec.yml
CHANGED
@@ -20,14 +20,6 @@ RSpec/ImplicitExpect:
|
|
20
20
|
RSpec/InstanceVariable:
|
21
21
|
Enabled: false
|
22
22
|
|
23
|
-
# mock ではなく spy を使うのを推奨したい。
|
24
|
-
# ただメッセージが悪く、「mock ではなく stub を使え」と言っているように読み取れる
|
25
|
-
# (そのため Enabled: false になった) ので
|
26
|
-
# https://github.com/backus/rubocop-rspec/pull/224
|
27
|
-
# が cop 名も分かりやすくなって良さそう。
|
28
|
-
RSpec/MessageExpectation:
|
29
|
-
Enabled: true
|
30
|
-
|
31
23
|
# 強く 1 example 1 assertion の立場は取らないが、多すぎてもツラいので。
|
32
24
|
# aggregate_failures で囲われていたら無視する的なオプション欲しい。
|
33
25
|
RSpec/MultipleExpectations:
|
data/exe/onkcop
ADDED
data/lib/onkcop/cli.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require "fileutils"
|
2
|
+
module Onkcop
|
3
|
+
class CLI
|
4
|
+
def self.start(args)
|
5
|
+
action_name = retrieve_command_name(args)
|
6
|
+
unless action_name
|
7
|
+
print_help
|
8
|
+
exit
|
9
|
+
end
|
10
|
+
|
11
|
+
instance = self.new
|
12
|
+
if instance.public_methods(false).include?(action_name.to_sym)
|
13
|
+
instance.__send__(action_name, args)
|
14
|
+
exit
|
15
|
+
end
|
16
|
+
|
17
|
+
puts "Could not find command #{action_name}."
|
18
|
+
print_help
|
19
|
+
exit(1)
|
20
|
+
rescue => e
|
21
|
+
puts e.message
|
22
|
+
exit(1)
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.retrieve_command_name(args)
|
26
|
+
meth = args.first.to_s unless args.empty?
|
27
|
+
args.shift if meth && (meth !~ /^\-/)
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.print_help
|
31
|
+
puts "onkcop commands:"
|
32
|
+
puts " init - Setup .rubocop.yml"
|
33
|
+
end
|
34
|
+
|
35
|
+
CONFIG_FILE_NAME = ".rubocop.yml"
|
36
|
+
def init(args)
|
37
|
+
raise "usage: onkcop init" unless args.empty?
|
38
|
+
template_path = File.expand_path("../../templates", __dir__)
|
39
|
+
puts "#{File.exist?(CONFIG_FILE_NAME) ? "overwrite" : "create"} #{CONFIG_FILE_NAME}"
|
40
|
+
FileUtils.copy_file(File.join(template_path, CONFIG_FILE_NAME), CONFIG_FILE_NAME)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/onkcop/version.rb
CHANGED
data/lib/onkcop.rb
CHANGED
data/onkcop.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_dependency "rubocop", "~> 0.46.0"
|
23
|
-
spec.add_dependency "rubocop-rspec", ">= 1.
|
23
|
+
spec.add_dependency "rubocop-rspec", ">= 1.9.1"
|
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.46.0.
|
4
|
+
version: 0.46.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takafumi ONAKA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.9.1
|
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.
|
40
|
+
version: 1.9.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,7 +69,8 @@ dependencies:
|
|
69
69
|
description: OnkCop is a RuboCop configration gem.
|
70
70
|
email:
|
71
71
|
- takafumi.onaka@gmail.com
|
72
|
-
executables:
|
72
|
+
executables:
|
73
|
+
- onkcop
|
73
74
|
extensions: []
|
74
75
|
extra_rdoc_files: []
|
75
76
|
files:
|
@@ -85,9 +86,12 @@ files:
|
|
85
86
|
- config/rails.yml
|
86
87
|
- config/rspec.yml
|
87
88
|
- config/rubocop.yml
|
89
|
+
- exe/onkcop
|
88
90
|
- lib/onkcop.rb
|
91
|
+
- lib/onkcop/cli.rb
|
89
92
|
- lib/onkcop/version.rb
|
90
93
|
- onkcop.gemspec
|
94
|
+
- templates/.rubocop.yml
|
91
95
|
homepage: https://github.com/onk/onkcop
|
92
96
|
licenses:
|
93
97
|
- MIT
|