rubocop 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rubocop might be problematic. Click here for more details.
- data/.rubocop.yml +59 -1
- data/CHANGELOG.md +38 -0
- data/Gemfile +1 -10
- data/README.md +28 -1
- data/Rakefile +1 -15
- data/lib/rubocop.rb +14 -0
- data/lib/rubocop/cli.rb +70 -7
- data/lib/rubocop/cop/alias.rb +5 -8
- data/lib/rubocop/cop/array_literal.rb +22 -0
- data/lib/rubocop/cop/ascii_identifiers_and_comments.rb +18 -0
- data/lib/rubocop/cop/avoid_perlisms.rb +19 -28
- data/lib/rubocop/cop/brace_after_percent.rb +28 -0
- data/lib/rubocop/cop/cop.rb +15 -3
- data/lib/rubocop/cop/encoding.rb +1 -1
- data/lib/rubocop/cop/ensure_return.rb +36 -0
- data/lib/rubocop/cop/favor_percent_r.rb +19 -0
- data/lib/rubocop/cop/favor_sprintf.rb +2 -10
- data/lib/rubocop/cop/grammar.rb +6 -3
- data/lib/rubocop/cop/handle_exceptions.rb +21 -0
- data/lib/rubocop/cop/hash_literal.rb +22 -0
- data/lib/rubocop/cop/method_length.rb +66 -0
- data/lib/rubocop/cop/op_method.rb +23 -0
- data/lib/rubocop/cop/percent_literals.rb +25 -0
- data/lib/rubocop/cop/percent_r.rb +19 -0
- data/lib/rubocop/cop/reduce_arguments.rb +67 -0
- data/lib/rubocop/cop/rescue_exception.rb +39 -0
- data/lib/rubocop/cop/rescue_modifier.rb +20 -0
- data/lib/rubocop/cop/symbol_snake_case.rb +5 -5
- data/lib/rubocop/cop/syntax.rb +13 -2
- data/lib/rubocop/version.rb +3 -1
- data/rubocop.gemspec +36 -169
- data/spec/rubocop/cli_spec.rb +146 -15
- data/spec/rubocop/cops/alias_spec.rb +10 -1
- data/spec/rubocop/cops/array_literal_spec.rb +29 -0
- data/spec/rubocop/cops/ascii_identifiers_and_comments_spec.rb +38 -0
- data/spec/rubocop/cops/avoid_perlisms_spec.rb +12 -0
- data/spec/rubocop/cops/brace_after_percent_spec.rb +27 -0
- data/spec/rubocop/cops/encoding_spec.rb +2 -2
- data/spec/rubocop/cops/ensure_return_spec.rb +37 -0
- data/spec/rubocop/cops/favor_percent_r.rb +29 -0
- data/spec/rubocop/cops/favor_sprintf_spec.rb +8 -1
- data/spec/rubocop/cops/grammar_spec.rb +54 -40
- data/spec/rubocop/cops/handle_exceptions_spec.rb +36 -0
- data/spec/rubocop/cops/hash_literal_spec.rb +29 -0
- data/spec/rubocop/cops/method_length_spec.rb +150 -0
- data/spec/rubocop/cops/op_method_spec.rb +58 -0
- data/spec/rubocop/cops/percent_literals_spec.rb +47 -0
- data/spec/rubocop/cops/percent_r_spec.rb +29 -0
- data/spec/rubocop/cops/reduce_arguments_spec.rb +57 -0
- data/spec/rubocop/cops/rescue_exception_spec.rb +73 -0
- data/spec/rubocop/cops/rescue_modifier.rb +40 -0
- data/spec/rubocop/cops/space_around_operators_spec.rb +7 -0
- data/spec/rubocop/cops/symbol_snake_case_spec.rb +19 -7
- data/spec/rubocop/cops/tab_spec.rb +1 -1
- metadata +131 -50
- data/Gemfile.lock +0 -41
- data/VERSION +0 -1
@@ -0,0 +1,58 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
module Rubocop
|
6
|
+
module Cop
|
7
|
+
describe OpMethod do
|
8
|
+
let(:om) { OpMethod.new }
|
9
|
+
|
10
|
+
it 'registers an offence for arg not named other' do
|
11
|
+
inspect_source(om,
|
12
|
+
'file.rb',
|
13
|
+
['def +(another)',
|
14
|
+
' another',
|
15
|
+
'end'])
|
16
|
+
expect(om.offences.size).to eq(1)
|
17
|
+
expect(om.offences.map(&:message))
|
18
|
+
.to eq([sprintf(OpMethod::ERROR_MESSAGE, '+')])
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'does not register an offence for arg named other' do
|
22
|
+
inspect_source(om,
|
23
|
+
'file.rb',
|
24
|
+
['def +(other)',
|
25
|
+
' other',
|
26
|
+
'end'])
|
27
|
+
expect(om.offences).to be_empty
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'does not register an offence for []' do
|
31
|
+
inspect_source(om,
|
32
|
+
'file.rb',
|
33
|
+
['def [](index)',
|
34
|
+
' other',
|
35
|
+
'end'])
|
36
|
+
expect(om.offences).to be_empty
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'does not register an offence for []=' do
|
40
|
+
inspect_source(om,
|
41
|
+
'file.rb',
|
42
|
+
['def []=(index, value)',
|
43
|
+
' other',
|
44
|
+
'end'])
|
45
|
+
expect(om.offences).to be_empty
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'does not register an offence for <<' do
|
49
|
+
inspect_source(om,
|
50
|
+
'file.rb',
|
51
|
+
['def <<(cop)',
|
52
|
+
' other',
|
53
|
+
'end'])
|
54
|
+
expect(om.offences).to be_empty
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
module Rubocop
|
6
|
+
module Cop
|
7
|
+
describe PercentLiterals do
|
8
|
+
let(:pl) { PercentLiterals.new }
|
9
|
+
|
10
|
+
it 'registers an offence for %q' do
|
11
|
+
inspect_source(pl,
|
12
|
+
'file.rb',
|
13
|
+
['puts %q(test)'])
|
14
|
+
expect(pl.offences.size).to eq(1)
|
15
|
+
expect(pl.offences.map(&:message))
|
16
|
+
.to eq(['The use of %q is discouraged.'])
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'registers an offence for %Q' do
|
20
|
+
inspect_source(pl,
|
21
|
+
'file.rb',
|
22
|
+
['puts %Q(test)'])
|
23
|
+
expect(pl.offences.size).to eq(1)
|
24
|
+
expect(pl.offences.map(&:message))
|
25
|
+
.to eq(['The use of %Q is discouraged.'])
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'registers an offence for %x' do
|
29
|
+
inspect_source(pl,
|
30
|
+
'file.rb',
|
31
|
+
['puts %x(test)'])
|
32
|
+
expect(pl.offences.size).to eq(1)
|
33
|
+
expect(pl.offences.map(&:message))
|
34
|
+
.to eq(['The use of %x is discouraged.'])
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'registers an offence for %s' do
|
38
|
+
inspect_source(pl,
|
39
|
+
'file.rb',
|
40
|
+
['puts %s(test)'])
|
41
|
+
expect(pl.offences.size).to eq(1)
|
42
|
+
expect(pl.offences.map(&:message))
|
43
|
+
.to eq(['The use of %s is discouraged.'])
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
module Rubocop
|
6
|
+
module Cop
|
7
|
+
describe PercentR do
|
8
|
+
let(:apr) { PercentR.new }
|
9
|
+
|
10
|
+
it 'registers an offence for %r with zero or one slash in regexp' do
|
11
|
+
inspect_source(apr, 'file.rb', ['x =~ %r(/home)',
|
12
|
+
'y =~ %r(etc)'])
|
13
|
+
expect(apr.offences.map(&:message))
|
14
|
+
.to eq([PercentR::ERROR_MESSAGE] * 2)
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'accepts %r with at least two slashes in regexp' do
|
18
|
+
inspect_source(apr, 'file.rb', ['x =~ %r(/home/)',
|
19
|
+
'y =~ %r(/////)'])
|
20
|
+
expect(apr.offences.map(&:message)).to be_empty
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'accepts slash delimiters for regexp' do
|
24
|
+
inspect_source(apr, 'file.rb', ['x =~ /\/home/'])
|
25
|
+
expect(apr.offences.map(&:message)).to be_empty
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
module Rubocop
|
6
|
+
module Cop
|
7
|
+
describe ReduceArguments do
|
8
|
+
let(:reduce_arguments) { ReduceArguments.new }
|
9
|
+
|
10
|
+
it 'find wrong argument names in calls with different syntax' do
|
11
|
+
inspect_source(reduce_arguments, '',
|
12
|
+
['def m',
|
13
|
+
' [0, 1].reduce { |c, d| c + d }',
|
14
|
+
' [0, 1].reduce{ |c, d| c + d }',
|
15
|
+
' [0, 1].reduce(5) { |c, d| c + d }',
|
16
|
+
' [0, 1].reduce(5){ |c, d| c + d }',
|
17
|
+
' [0, 1].reduce (5) { |c, d| c + d }',
|
18
|
+
' [0, 1].reduce(5) { |c, d| c + d }',
|
19
|
+
'end'])
|
20
|
+
expect(reduce_arguments.offences.size).to eq(6)
|
21
|
+
expect(reduce_arguments.offences
|
22
|
+
.map(&:line_number).sort).to eq((2..7).to_a)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'allows calls with proper argument names' do
|
26
|
+
inspect_source(reduce_arguments, '',
|
27
|
+
['def m',
|
28
|
+
' [0, 1].reduce { |a, e| a + e }',
|
29
|
+
' [0, 1].reduce{ |a, e| a + e }',
|
30
|
+
' [0, 1].reduce(5) { |a, e| a + e }',
|
31
|
+
' [0, 1].reduce(5){ |a, e| a + e }',
|
32
|
+
' [0, 1].reduce (5) { |a, e| a + e }',
|
33
|
+
' [0, 1].reduce(5) { |a, e| a + e }',
|
34
|
+
'end'])
|
35
|
+
expect(reduce_arguments.offences).to be_empty
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'ignores do..end blocks' do
|
39
|
+
inspect_source(reduce_arguments, '',
|
40
|
+
['def m',
|
41
|
+
' [0, 1].reduce do |c, d|',
|
42
|
+
' c + d',
|
43
|
+
' end',
|
44
|
+
'end'])
|
45
|
+
expect(reduce_arguments.offences).to be_empty
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'ignores :reduce symbols' do
|
49
|
+
inspect_source(reduce_arguments, '',
|
50
|
+
['def m',
|
51
|
+
' call_method(:reduce) { |a, b| a + b}',
|
52
|
+
'end'])
|
53
|
+
expect(reduce_arguments.offences).to be_empty
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
module Rubocop
|
6
|
+
module Cop
|
7
|
+
describe RescueException do
|
8
|
+
let(:re) { RescueException.new }
|
9
|
+
|
10
|
+
it 'registers an offence for rescue from Exception' do
|
11
|
+
inspect_source(re,
|
12
|
+
'file.rb',
|
13
|
+
['begin',
|
14
|
+
' something',
|
15
|
+
'rescue Exception',
|
16
|
+
' #do nothing',
|
17
|
+
'end'])
|
18
|
+
expect(re.offences.size).to eq(1)
|
19
|
+
expect(re.offences.map(&:message))
|
20
|
+
.to eq([RescueException::ERROR_MESSAGE])
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'registers an offence for rescue with Exception => e' do
|
24
|
+
inspect_source(re,
|
25
|
+
'file.rb',
|
26
|
+
['begin',
|
27
|
+
' something',
|
28
|
+
'rescue Exception => e',
|
29
|
+
' #do nothing',
|
30
|
+
'end'])
|
31
|
+
expect(re.offences.size).to eq(1)
|
32
|
+
expect(re.offences.map(&:message))
|
33
|
+
.to eq([RescueException::ERROR_MESSAGE])
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'does not register an offence for rescue with other class' do
|
37
|
+
inspect_source(re,
|
38
|
+
'file.rb',
|
39
|
+
['begin',
|
40
|
+
' something',
|
41
|
+
' return',
|
42
|
+
'rescue ArgumentError => e',
|
43
|
+
' file.close',
|
44
|
+
'end'])
|
45
|
+
expect(re.offences).to be_empty
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'does not register an offence for rescue with other classes' do
|
49
|
+
inspect_source(re,
|
50
|
+
'file.rb',
|
51
|
+
['begin',
|
52
|
+
' something',
|
53
|
+
' return',
|
54
|
+
'rescue EOFError, ArgumentError => e',
|
55
|
+
' file.close',
|
56
|
+
'end'])
|
57
|
+
expect(re.offences).to be_empty
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'does not register an offence for rescue with a module prefix' do
|
61
|
+
inspect_source(re,
|
62
|
+
'file.rb',
|
63
|
+
['begin',
|
64
|
+
' something',
|
65
|
+
' return',
|
66
|
+
'rescue Test::Exception => e',
|
67
|
+
' file.close',
|
68
|
+
'end'])
|
69
|
+
expect(re.offences).to be_empty
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
module Rubocop
|
6
|
+
module Cop
|
7
|
+
describe RescueModifier do
|
8
|
+
let(:rm) { RescueModifier.new }
|
9
|
+
|
10
|
+
it 'registers an offence for modifier rescue' do
|
11
|
+
inspect_source(rm,
|
12
|
+
'file.rb',
|
13
|
+
['method rescue handle'])
|
14
|
+
expect(rm.offences.size).to eq(1)
|
15
|
+
expect(rm.offences.map(&:message))
|
16
|
+
.to eq([RescueModifier::ERROR_MESSAGE])
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'handles more complex expression with modifier rescue' do
|
20
|
+
inspect_source(rm,
|
21
|
+
'file.rb',
|
22
|
+
['method1 or method2 rescue handle'])
|
23
|
+
expect(rm.offences.size).to eq(1)
|
24
|
+
expect(rm.offences.map(&:message))
|
25
|
+
.to eq([RescueModifier::ERROR_MESSAGE])
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'does not register an offence for normal rescue' do
|
29
|
+
inspect_source(rm,
|
30
|
+
'file.rb',
|
31
|
+
['begin',
|
32
|
+
'test',
|
33
|
+
'rescue',
|
34
|
+
'handle',
|
35
|
+
'end'])
|
36
|
+
expect(rm.offences).to be_empty
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -13,6 +13,13 @@ module Rubocop
|
|
13
13
|
["Surrounding space missing for operator '='."] * 3)
|
14
14
|
end
|
15
15
|
|
16
|
+
it 'registers an offence for ternary operator without space' do
|
17
|
+
inspect_source(space, 'file.rb', ['x == 0?1:2'])
|
18
|
+
expect(space.offences.map(&:message)).to eq(
|
19
|
+
["Surrounding space missing for operator '?'.",
|
20
|
+
"Surrounding space missing for operator ':'."])
|
21
|
+
end
|
22
|
+
|
16
23
|
it 'registers an offence in presence of modifier if statement' do
|
17
24
|
check_modifier('if')
|
18
25
|
end
|
@@ -17,39 +17,51 @@ module Rubocop
|
|
17
17
|
it 'accepts snake case in names' do
|
18
18
|
inspect_source(snake_case, 'file.rb',
|
19
19
|
['test = :good_idea'])
|
20
|
-
expect(snake_case.offences
|
20
|
+
expect(snake_case.offences).to be_empty
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'accepts snake case with a prefix @ in names' do
|
24
24
|
inspect_source(snake_case, 'file.rb',
|
25
25
|
['test = :@good_idea'])
|
26
|
-
expect(snake_case.offences
|
26
|
+
expect(snake_case.offences).to be_empty
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'accepts snake case with ? suffix' do
|
30
30
|
inspect_source(snake_case, 'file.rb',
|
31
31
|
['test = :good_idea?'])
|
32
|
-
expect(snake_case.offences
|
32
|
+
expect(snake_case.offences).to be_empty
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'accepts snake case with ! suffix' do
|
36
36
|
inspect_source(snake_case, 'file.rb',
|
37
37
|
['test = :good_idea!'])
|
38
|
-
expect(snake_case.offences
|
38
|
+
expect(snake_case.offences).to be_empty
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'accepts snake case with = suffix' do
|
42
42
|
inspect_source(snake_case, 'file.rb',
|
43
43
|
['test = :good_idea='])
|
44
|
-
expect(snake_case.offences
|
44
|
+
expect(snake_case.offences).to be_empty
|
45
45
|
end
|
46
46
|
|
47
47
|
it 'accepts special cases - !, [] and **' do
|
48
48
|
inspect_source(snake_case, 'file.rb',
|
49
49
|
['test = :**',
|
50
50
|
'test = :!',
|
51
|
-
'test = :[]'
|
52
|
-
|
51
|
+
'test = :[]',
|
52
|
+
'test = :[]='])
|
53
|
+
expect(snake_case.offences).to be_empty
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'accepts special cases - ==, <=>, >, <, >=, <=' do
|
57
|
+
inspect_source(snake_case, 'file.rb',
|
58
|
+
['test = :==',
|
59
|
+
'test = :<=>',
|
60
|
+
'test = :>',
|
61
|
+
'test = :<',
|
62
|
+
'test = :>=',
|
63
|
+
'test = :<='])
|
64
|
+
expect(snake_case.offences).to be_empty
|
53
65
|
end
|
54
66
|
|
55
67
|
it 'registers an offence for SCREAMING_SNAKE_CASE' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -16,113 +16,97 @@ dependencies:
|
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '1.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '1.1'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: rake
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
37
|
+
version: '10.0'
|
38
38
|
type: :development
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
45
|
+
version: '10.0'
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: rspec
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
none: false
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '2.13'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '2.13'
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: yard
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
69
|
+
version: '0.8'
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: '0'
|
77
|
+
version: '0.8'
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
79
|
name: bundler
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
81
81
|
none: false
|
82
82
|
requirements:
|
83
|
-
- -
|
83
|
+
- - ~>
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: '
|
85
|
+
version: '1.3'
|
86
86
|
type: :development
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
89
|
none: false
|
90
90
|
requirements:
|
91
|
-
- -
|
91
|
+
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: jeweler
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
102
|
-
type: :development
|
103
|
-
prerelease: false
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0'
|
93
|
+
version: '1.3'
|
110
94
|
- !ruby/object:Gem::Dependency
|
111
95
|
name: simplecov
|
112
96
|
requirement: !ruby/object:Gem::Requirement
|
113
97
|
none: false
|
114
98
|
requirements:
|
115
|
-
- -
|
99
|
+
- - ~>
|
116
100
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
101
|
+
version: '0.7'
|
118
102
|
type: :development
|
119
103
|
prerelease: false
|
120
104
|
version_requirements: !ruby/object:Gem::Requirement
|
121
105
|
none: false
|
122
106
|
requirements:
|
123
|
-
- -
|
107
|
+
- - ~>
|
124
108
|
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
109
|
+
version: '0.7'
|
126
110
|
description: Automatic Ruby code style checking tool. Aims to enforce the community-driven
|
127
111
|
Ruby Style Guide.
|
128
112
|
email: bozhidar@batsov.com
|
@@ -140,22 +124,23 @@ files:
|
|
140
124
|
- CHANGELOG.md
|
141
125
|
- CONTRIBUTING.md
|
142
126
|
- Gemfile
|
143
|
-
- Gemfile.lock
|
144
127
|
- LICENSE.txt
|
145
128
|
- README.md
|
146
129
|
- Rakefile
|
147
|
-
- VERSION
|
148
130
|
- bin/rubocop
|
149
|
-
-
|
131
|
+
- rubocop.gemspec
|
150
132
|
- lib/rubocop/cli.rb
|
151
133
|
- lib/rubocop/cop/alias.rb
|
152
134
|
- lib/rubocop/cop/align_parameters.rb
|
153
135
|
- lib/rubocop/cop/ampersands_pipes_vs_and_or.rb
|
136
|
+
- lib/rubocop/cop/array_literal.rb
|
137
|
+
- lib/rubocop/cop/ascii_identifiers_and_comments.rb
|
154
138
|
- lib/rubocop/cop/avoid_class_vars.rb
|
155
139
|
- lib/rubocop/cop/avoid_for.rb
|
156
140
|
- lib/rubocop/cop/avoid_perl_backrefs.rb
|
157
141
|
- lib/rubocop/cop/avoid_perlisms.rb
|
158
142
|
- lib/rubocop/cop/blocks.rb
|
143
|
+
- lib/rubocop/cop/brace_after_percent.rb
|
159
144
|
- lib/rubocop/cop/class_and_module_camel_case.rb
|
160
145
|
- lib/rubocop/cop/collection_methods.rb
|
161
146
|
- lib/rubocop/cop/cop.rb
|
@@ -163,20 +148,31 @@ files:
|
|
163
148
|
- lib/rubocop/cop/empty_lines.rb
|
164
149
|
- lib/rubocop/cop/encoding.rb
|
165
150
|
- lib/rubocop/cop/end_of_line.rb
|
151
|
+
- lib/rubocop/cop/ensure_return.rb
|
166
152
|
- lib/rubocop/cop/favor_modifier.rb
|
153
|
+
- lib/rubocop/cop/favor_percent_r.rb
|
167
154
|
- lib/rubocop/cop/favor_sprintf.rb
|
168
155
|
- lib/rubocop/cop/favor_unless_over_negated_if.rb
|
169
156
|
- lib/rubocop/cop/grammar.rb
|
157
|
+
- lib/rubocop/cop/handle_exceptions.rb
|
158
|
+
- lib/rubocop/cop/hash_literal.rb
|
170
159
|
- lib/rubocop/cop/hash_syntax.rb
|
171
160
|
- lib/rubocop/cop/if_then_else.rb
|
172
161
|
- lib/rubocop/cop/indentation.rb
|
173
162
|
- lib/rubocop/cop/line_length.rb
|
174
163
|
- lib/rubocop/cop/method_and_variable_snake_case.rb
|
164
|
+
- lib/rubocop/cop/method_length.rb
|
175
165
|
- lib/rubocop/cop/new_lambda_literal.rb
|
176
166
|
- lib/rubocop/cop/numeric_literals.rb
|
177
167
|
- lib/rubocop/cop/offence.rb
|
168
|
+
- lib/rubocop/cop/op_method.rb
|
178
169
|
- lib/rubocop/cop/parameter_lists.rb
|
179
170
|
- lib/rubocop/cop/parentheses_around_condition.rb
|
171
|
+
- lib/rubocop/cop/percent_literals.rb
|
172
|
+
- lib/rubocop/cop/percent_r.rb
|
173
|
+
- lib/rubocop/cop/reduce_arguments.rb
|
174
|
+
- lib/rubocop/cop/rescue_exception.rb
|
175
|
+
- lib/rubocop/cop/rescue_modifier.rb
|
180
176
|
- lib/rubocop/cop/semicolon.rb
|
181
177
|
- lib/rubocop/cop/space_after_comma_etc.rb
|
182
178
|
- lib/rubocop/cop/string_literals.rb
|
@@ -193,15 +189,18 @@ files:
|
|
193
189
|
- lib/rubocop/report/plain_text.rb
|
194
190
|
- lib/rubocop/report/report.rb
|
195
191
|
- lib/rubocop/version.rb
|
196
|
-
- rubocop.
|
192
|
+
- lib/rubocop.rb
|
197
193
|
- spec/rubocop/cli_spec.rb
|
198
194
|
- spec/rubocop/cops/alias_spec.rb
|
199
195
|
- spec/rubocop/cops/align_parameters_spec.rb
|
200
196
|
- spec/rubocop/cops/ampersands_pipes_vs_and_or_spec.rb
|
197
|
+
- spec/rubocop/cops/array_literal_spec.rb
|
198
|
+
- spec/rubocop/cops/ascii_identifiers_and_comments_spec.rb
|
201
199
|
- spec/rubocop/cops/avoid_class_vars_spec.rb
|
202
200
|
- spec/rubocop/cops/avoid_for_spec.rb
|
203
201
|
- spec/rubocop/cops/avoid_perl_backrefs_spec.rb
|
204
202
|
- spec/rubocop/cops/avoid_perlisms_spec.rb
|
203
|
+
- spec/rubocop/cops/brace_after_percent_spec.rb
|
205
204
|
- spec/rubocop/cops/class_and_module_camel_case_spec.rb
|
206
205
|
- spec/rubocop/cops/collection_methods_spec.rb
|
207
206
|
- spec/rubocop/cops/cop_spec.rb
|
@@ -210,24 +209,35 @@ files:
|
|
210
209
|
- spec/rubocop/cops/empty_lines_spec.rb
|
211
210
|
- spec/rubocop/cops/encoding_spec.rb
|
212
211
|
- spec/rubocop/cops/end_of_line_spec.rb
|
212
|
+
- spec/rubocop/cops/ensure_return_spec.rb
|
213
213
|
- spec/rubocop/cops/favor_modifier_spec.rb
|
214
|
+
- spec/rubocop/cops/favor_percent_r.rb
|
214
215
|
- spec/rubocop/cops/favor_sprintf_spec.rb
|
215
216
|
- spec/rubocop/cops/favor_unless_over_negated_if_spec.rb
|
216
217
|
- spec/rubocop/cops/favor_until_over_negated_while_spec.rb
|
217
218
|
- spec/rubocop/cops/grammar_spec.rb
|
219
|
+
- spec/rubocop/cops/handle_exceptions_spec.rb
|
220
|
+
- spec/rubocop/cops/hash_literal_spec.rb
|
218
221
|
- spec/rubocop/cops/hash_syntax_spec.rb
|
219
222
|
- spec/rubocop/cops/if_with_semicolon_spec.rb
|
220
223
|
- spec/rubocop/cops/indentation_spec.rb
|
221
224
|
- spec/rubocop/cops/line_length_spec.rb
|
222
225
|
- spec/rubocop/cops/method_and_variable_snake_case_spec.rb
|
226
|
+
- spec/rubocop/cops/method_length_spec.rb
|
223
227
|
- spec/rubocop/cops/multiline_blocks_spec.rb
|
224
228
|
- spec/rubocop/cops/multiline_if_then_spec.rb
|
225
229
|
- spec/rubocop/cops/new_lambda_literal_spec.rb
|
226
230
|
- spec/rubocop/cops/numeric_literals_spec.rb
|
227
231
|
- spec/rubocop/cops/offence_spec.rb
|
228
232
|
- spec/rubocop/cops/one_line_conditional_spec.rb
|
233
|
+
- spec/rubocop/cops/op_method_spec.rb
|
229
234
|
- spec/rubocop/cops/parameter_lists_spec.rb
|
230
235
|
- spec/rubocop/cops/parentheses_around_condition_spec.rb
|
236
|
+
- spec/rubocop/cops/percent_literals_spec.rb
|
237
|
+
- spec/rubocop/cops/percent_r_spec.rb
|
238
|
+
- spec/rubocop/cops/reduce_arguments_spec.rb
|
239
|
+
- spec/rubocop/cops/rescue_exception_spec.rb
|
240
|
+
- spec/rubocop/cops/rescue_modifier.rb
|
231
241
|
- spec/rubocop/cops/semicolon_spec.rb
|
232
242
|
- spec/rubocop/cops/single_line_blocks_spec.rb
|
233
243
|
- spec/rubocop/cops/space_after_colon_spec.rb
|
@@ -262,20 +272,91 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
262
272
|
requirements:
|
263
273
|
- - ! '>='
|
264
274
|
- !ruby/object:Gem::Version
|
265
|
-
version:
|
266
|
-
segments:
|
267
|
-
- 0
|
268
|
-
hash: -3879767922505531373
|
275
|
+
version: 1.9.2
|
269
276
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
270
277
|
none: false
|
271
278
|
requirements:
|
272
279
|
- - ! '>='
|
273
280
|
- !ruby/object:Gem::Version
|
274
281
|
version: '0'
|
282
|
+
segments:
|
283
|
+
- 0
|
284
|
+
hash: 4221530219562804900
|
275
285
|
requirements: []
|
276
286
|
rubyforge_project:
|
277
287
|
rubygems_version: 1.8.23
|
278
288
|
signing_key:
|
279
289
|
specification_version: 3
|
280
290
|
summary: Automatic Ruby code style checking tool.
|
281
|
-
test_files:
|
291
|
+
test_files:
|
292
|
+
- spec/rubocop/cli_spec.rb
|
293
|
+
- spec/rubocop/cops/alias_spec.rb
|
294
|
+
- spec/rubocop/cops/align_parameters_spec.rb
|
295
|
+
- spec/rubocop/cops/ampersands_pipes_vs_and_or_spec.rb
|
296
|
+
- spec/rubocop/cops/array_literal_spec.rb
|
297
|
+
- spec/rubocop/cops/ascii_identifiers_and_comments_spec.rb
|
298
|
+
- spec/rubocop/cops/avoid_class_vars_spec.rb
|
299
|
+
- spec/rubocop/cops/avoid_for_spec.rb
|
300
|
+
- spec/rubocop/cops/avoid_perl_backrefs_spec.rb
|
301
|
+
- spec/rubocop/cops/avoid_perlisms_spec.rb
|
302
|
+
- spec/rubocop/cops/brace_after_percent_spec.rb
|
303
|
+
- spec/rubocop/cops/class_and_module_camel_case_spec.rb
|
304
|
+
- spec/rubocop/cops/collection_methods_spec.rb
|
305
|
+
- spec/rubocop/cops/cop_spec.rb
|
306
|
+
- spec/rubocop/cops/def_with_parentheses_spec.rb
|
307
|
+
- spec/rubocop/cops/def_without_parentheses_spec.rb
|
308
|
+
- spec/rubocop/cops/empty_lines_spec.rb
|
309
|
+
- spec/rubocop/cops/encoding_spec.rb
|
310
|
+
- spec/rubocop/cops/end_of_line_spec.rb
|
311
|
+
- spec/rubocop/cops/ensure_return_spec.rb
|
312
|
+
- spec/rubocop/cops/favor_modifier_spec.rb
|
313
|
+
- spec/rubocop/cops/favor_percent_r.rb
|
314
|
+
- spec/rubocop/cops/favor_sprintf_spec.rb
|
315
|
+
- spec/rubocop/cops/favor_unless_over_negated_if_spec.rb
|
316
|
+
- spec/rubocop/cops/favor_until_over_negated_while_spec.rb
|
317
|
+
- spec/rubocop/cops/grammar_spec.rb
|
318
|
+
- spec/rubocop/cops/handle_exceptions_spec.rb
|
319
|
+
- spec/rubocop/cops/hash_literal_spec.rb
|
320
|
+
- spec/rubocop/cops/hash_syntax_spec.rb
|
321
|
+
- spec/rubocop/cops/if_with_semicolon_spec.rb
|
322
|
+
- spec/rubocop/cops/indentation_spec.rb
|
323
|
+
- spec/rubocop/cops/line_length_spec.rb
|
324
|
+
- spec/rubocop/cops/method_and_variable_snake_case_spec.rb
|
325
|
+
- spec/rubocop/cops/method_length_spec.rb
|
326
|
+
- spec/rubocop/cops/multiline_blocks_spec.rb
|
327
|
+
- spec/rubocop/cops/multiline_if_then_spec.rb
|
328
|
+
- spec/rubocop/cops/new_lambda_literal_spec.rb
|
329
|
+
- spec/rubocop/cops/numeric_literals_spec.rb
|
330
|
+
- spec/rubocop/cops/offence_spec.rb
|
331
|
+
- spec/rubocop/cops/one_line_conditional_spec.rb
|
332
|
+
- spec/rubocop/cops/op_method_spec.rb
|
333
|
+
- spec/rubocop/cops/parameter_lists_spec.rb
|
334
|
+
- spec/rubocop/cops/parentheses_around_condition_spec.rb
|
335
|
+
- spec/rubocop/cops/percent_literals_spec.rb
|
336
|
+
- spec/rubocop/cops/percent_r_spec.rb
|
337
|
+
- spec/rubocop/cops/reduce_arguments_spec.rb
|
338
|
+
- spec/rubocop/cops/rescue_exception_spec.rb
|
339
|
+
- spec/rubocop/cops/rescue_modifier.rb
|
340
|
+
- spec/rubocop/cops/semicolon_spec.rb
|
341
|
+
- spec/rubocop/cops/single_line_blocks_spec.rb
|
342
|
+
- spec/rubocop/cops/space_after_colon_spec.rb
|
343
|
+
- spec/rubocop/cops/space_after_comma_spec.rb
|
344
|
+
- spec/rubocop/cops/space_after_semicolon_spec.rb
|
345
|
+
- spec/rubocop/cops/space_around_braces_spec.rb
|
346
|
+
- spec/rubocop/cops/space_around_equals_in_default_parameter_spec.rb
|
347
|
+
- spec/rubocop/cops/space_around_operators_spec.rb
|
348
|
+
- spec/rubocop/cops/space_inside_brackets_spec.rb
|
349
|
+
- spec/rubocop/cops/space_inside_parens_spec.rb
|
350
|
+
- spec/rubocop/cops/string_literals_spec.rb
|
351
|
+
- spec/rubocop/cops/symbol_snake_case_spec.rb
|
352
|
+
- spec/rubocop/cops/syntax_spec.rb
|
353
|
+
- spec/rubocop/cops/tab_spec.rb
|
354
|
+
- spec/rubocop/cops/ternary_operator_spec.rb
|
355
|
+
- spec/rubocop/cops/trailing_whitespace_spec.rb
|
356
|
+
- spec/rubocop/cops/unless_else_spec.rb
|
357
|
+
- spec/rubocop/cops/variable_interpolation_spec.rb
|
358
|
+
- spec/rubocop/cops/when_then_spec.rb
|
359
|
+
- spec/rubocop/reports/emacs_style_spec.rb
|
360
|
+
- spec/rubocop/reports/report_spec.rb
|
361
|
+
- spec/spec_helper.rb
|
362
|
+
has_rdoc:
|