rubocop-sensible 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/Gemfile.lock +8 -8
- data/README.md +30 -0
- data/Rakefile +5 -3
- data/bin/console +4 -3
- data/config/rubocop.yml +4 -4
- data/lib/rubocop/sensible.rb +3 -1
- data/lib/rubocop/sensible/version.rb +3 -1
- data/rubocop-sensible.gemspec +17 -16
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d19bb41e5121b46ae55382d2742f2b7f7ae82dd64081e0cd37fd319ba02d2948
|
4
|
+
data.tar.gz: bb1f9acce57c7e3e63d417951580d6de0697dacd7dcf990538379686629463c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 964524154b24fa3f9395acda9c3b33fe36a8e0b7e0cf7b1d5ebe499678e12585dd157896d40d522ca76a426ca57b29f52a96131046324f2319b016c9707aedb0
|
7
|
+
data.tar.gz: 0dc8672964cb71236d3a0a327b603301c494388912a79da1caf06df5c9b087e2188b24f86f0ef3219d0f99277fef0ae01075d189fbd7d1439ec85e6b0148edc1
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rubocop-sensible (0.
|
4
|
+
rubocop-sensible (0.3.0)
|
5
5
|
rubocop (>= 0.60.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -9,9 +9,9 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
ast (2.4.0)
|
11
11
|
diff-lcs (1.3)
|
12
|
-
jaro_winkler (1.5.
|
13
|
-
parallel (1.
|
14
|
-
parser (2.
|
12
|
+
jaro_winkler (1.5.4)
|
13
|
+
parallel (1.19.1)
|
14
|
+
parser (2.7.0.2)
|
15
15
|
ast (~> 2.4.0)
|
16
16
|
rainbow (3.0.0)
|
17
17
|
rake (10.5.0)
|
@@ -28,15 +28,15 @@ GEM
|
|
28
28
|
diff-lcs (>= 1.2.0, < 2.0)
|
29
29
|
rspec-support (~> 3.8.0)
|
30
30
|
rspec-support (3.8.0)
|
31
|
-
rubocop (0.
|
31
|
+
rubocop (0.79.0)
|
32
32
|
jaro_winkler (~> 1.5.1)
|
33
33
|
parallel (~> 1.10)
|
34
|
-
parser (>= 2.
|
34
|
+
parser (>= 2.7.0.1)
|
35
35
|
rainbow (>= 2.2.2, < 4.0)
|
36
36
|
ruby-progressbar (~> 1.7)
|
37
37
|
unicode-display_width (>= 1.4.0, < 1.7)
|
38
38
|
ruby-progressbar (1.10.1)
|
39
|
-
unicode-display_width (1.6.
|
39
|
+
unicode-display_width (1.6.1)
|
40
40
|
|
41
41
|
PLATFORMS
|
42
42
|
ruby
|
@@ -48,4 +48,4 @@ DEPENDENCIES
|
|
48
48
|
rubocop-sensible!
|
49
49
|
|
50
50
|
BUNDLED WITH
|
51
|
-
2.
|
51
|
+
2.1.4
|
data/README.md
CHANGED
@@ -2,6 +2,36 @@
|
|
2
2
|
|
3
3
|
Sensible default for RuboCop.
|
4
4
|
|
5
|
+
## Purpose
|
6
|
+
|
7
|
+
The purpose of this tiny gem is to be useless at all.
|
8
|
+
|
9
|
+
No, seriously. This gem adds serveral congigurations for RuboCop that I think are sensible and that's it. If RuboCop's default will be changed in the future, it's useless anymore.
|
10
|
+
|
11
|
+
## What it does
|
12
|
+
|
13
|
+
It overrides the following configurations.
|
14
|
+
|
15
|
+
### Metrics/AbcSize
|
16
|
+
|
17
|
+
It increases the default value to `20`. It can be lower, but 20 seems pretty reasonable from my experience. Send a Pull Request if you have a different opinion.
|
18
|
+
|
19
|
+
### Metrics/LineLength
|
20
|
+
|
21
|
+
It can be disabled at all, but for now it's `160`. `160` comes from my experience that code which is longer than 160 characters tends to have some problem.
|
22
|
+
|
23
|
+
### Style/AsciiComments
|
24
|
+
|
25
|
+
When the team is not international, we'd like to write comments in our own language.
|
26
|
+
|
27
|
+
### Style/DoubleNegation
|
28
|
+
|
29
|
+
Double negation is used so widely that it doesn't make sense to disable it by default.
|
30
|
+
|
31
|
+
### Style/SymbolArray, Style/WordArray
|
32
|
+
|
33
|
+
This is a little controversial but using styles like `[:create, :edit]` makes sense.
|
34
|
+
|
5
35
|
## Installation
|
6
36
|
|
7
37
|
Add this line to your application's Gemfile:
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'rubocop/sensible'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "rubocop/sensible"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
data/config/rubocop.yml
CHANGED
@@ -5,15 +5,15 @@ AllCops:
|
|
5
5
|
- 'node_modules/**/*'
|
6
6
|
- 'vendor/bundle/**/*'
|
7
7
|
|
8
|
+
# LineLength 80 comes from restrictions in good old days.
|
9
|
+
Layout/LineLength:
|
10
|
+
Max: 160
|
11
|
+
|
8
12
|
# ABC size 20 is pretty well-done actually.
|
9
13
|
# For a reference, RuboCop itself configures this value as 17.
|
10
14
|
Metrics/AbcSize:
|
11
15
|
Max: 20
|
12
16
|
|
13
|
-
# LineLength 80 comes from restrictions in good old days.
|
14
|
-
Metrics/LineLength:
|
15
|
-
Max: 160
|
16
|
-
|
17
17
|
# If all member of the team is Japanese, writing comments in Japanese
|
18
18
|
# makes sense.
|
19
19
|
Style/AsciiComments:
|
data/lib/rubocop/sensible.rb
CHANGED
data/rubocop-sensible.gemspec
CHANGED
@@ -1,30 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
|
-
lib = File.expand_path(
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
5
|
+
require 'rubocop/sensible/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
8
|
+
spec.name = 'rubocop-sensible'
|
8
9
|
spec.version = Rubocop::Sensible::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
10
|
+
spec.authors = ['OKURA Masafumi']
|
11
|
+
spec.email = ['masafumi.o1988@gmail.com']
|
11
12
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
13
|
+
spec.summary = 'Sensible configuration for RuboCop'
|
14
|
+
spec.description = 'Sensible configuration for RuboCop'
|
15
|
+
spec.homepage = 'https://github.com/okuramasafumi/rubocop-sensible'
|
16
|
+
spec.license = 'MIT'
|
16
17
|
|
17
18
|
# Specify which files should be added to the gem when it is released.
|
18
19
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
19
|
-
spec.files = Dir.chdir(File.expand_path(
|
20
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
20
21
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
22
|
end
|
22
|
-
spec.bindir =
|
23
|
+
spec.bindir = 'exe'
|
23
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
-
spec.require_paths = [
|
25
|
+
spec.require_paths = ['lib']
|
25
26
|
|
26
|
-
spec.add_dependency
|
27
|
-
spec.add_development_dependency
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
27
|
+
spec.add_dependency 'rubocop', '>= 0.60.0'
|
28
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
29
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
30
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
30
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-sensible
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OKURA Masafumi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.
|
110
|
+
rubygems_version: 3.1.2
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Sensible configuration for RuboCop
|