rubocop 0.3.0 → 0.4.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.
- data/.rubocop.yml +40 -0
- data/.travis.yml +1 -0
- data/Gemfile +7 -10
- data/Gemfile.lock +21 -19
- data/README.md +62 -5
- data/VERSION +1 -1
- data/bin/rubocop +1 -1
- data/lib/rubocop/cli.rb +35 -15
- data/lib/rubocop/cop/class_and_module_camel_case.rb +20 -0
- data/lib/rubocop/cop/collection_methods.rb +29 -0
- data/lib/rubocop/cop/cop.rb +1 -1
- data/lib/rubocop/cop/def_parentheses.rb +4 -1
- data/lib/rubocop/cop/encoding.rb +6 -4
- data/lib/rubocop/cop/end_of_line.rb +1 -3
- data/lib/rubocop/cop/favor_modifier.rb +82 -0
- data/lib/rubocop/cop/favor_unless_over_negated_if.rb +47 -0
- data/lib/rubocop/cop/grammar.rb +3 -2
- data/lib/rubocop/cop/indentation.rb +1 -1
- data/lib/rubocop/cop/line_length.rb +7 -3
- data/lib/rubocop/cop/method_and_variable_snake_case.rb +31 -0
- data/lib/rubocop/cop/new_lambda_literal.rb +17 -0
- data/lib/rubocop/cop/parentheses_around_condition.rb +24 -0
- data/lib/rubocop/cop/surrounding_space.rb +48 -47
- data/lib/rubocop/cop/syntax.rb +19 -0
- data/lib/rubocop/cop/tab.rb +1 -3
- data/lib/rubocop/report/plain_text.rb +1 -1
- data/lib/rubocop/report/report.rb +5 -2
- data/lib/rubocop/version.rb +1 -1
- data/lib/rubocop.rb +14 -0
- data/rubocop.gemspec +38 -22
- data/spec/rubocop/cli_spec.rb +120 -40
- data/spec/rubocop/cops/align_parameters_spec.rb +29 -29
- data/spec/rubocop/cops/ampersands_pipes_vs_and_or_spec.rb +4 -4
- data/spec/rubocop/cops/class_and_module_camel_case_spec.rb +34 -0
- data/spec/rubocop/cops/collection_methods_spec.rb +39 -0
- data/spec/rubocop/cops/cop_spec.rb +5 -5
- data/spec/rubocop/cops/def_with_parentheses_spec.rb +5 -5
- data/spec/rubocop/cops/def_without_parentheses_spec.rb +4 -4
- data/spec/rubocop/cops/empty_lines_spec.rb +8 -8
- data/spec/rubocop/cops/encoding_spec.rb +17 -11
- data/spec/rubocop/cops/end_of_line_spec.rb +5 -5
- data/spec/rubocop/cops/favor_modifier_spec.rb +112 -0
- data/spec/rubocop/cops/favor_unless_over_negated_if_spec.rb +62 -0
- data/spec/rubocop/cops/favor_until_over_negated_while_spec.rb +45 -0
- data/spec/rubocop/cops/grammar_spec.rb +14 -9
- data/spec/rubocop/cops/hash_syntax_spec.rb +10 -10
- data/spec/rubocop/cops/if_with_semicolon_spec.rb +3 -3
- data/spec/rubocop/cops/indentation_spec.rb +7 -7
- data/spec/rubocop/cops/line_length_spec.rb +4 -4
- data/spec/rubocop/cops/method_and_variable_snake_case_spec.rb +47 -0
- data/spec/rubocop/cops/multiline_blocks_spec.rb +4 -4
- data/spec/rubocop/cops/multiline_if_then_spec.rb +7 -7
- data/spec/rubocop/cops/new_lambda_literal_spec.rb +23 -0
- data/spec/rubocop/cops/numeric_literals_spec.rb +10 -10
- data/spec/rubocop/cops/offence_spec.rb +4 -4
- data/spec/rubocop/cops/one_line_conditional_spec.rb +2 -3
- data/spec/rubocop/cops/parameter_lists_spec.rb +4 -4
- data/spec/rubocop/cops/parentheses_around_condition_spec.rb +64 -0
- data/spec/rubocop/cops/single_line_blocks_spec.rb +4 -4
- data/spec/rubocop/cops/space_after_colon_spec.rb +5 -5
- data/spec/rubocop/cops/space_after_comma_spec.rb +3 -3
- data/spec/rubocop/cops/space_after_semicolon_spec.rb +3 -3
- data/spec/rubocop/cops/space_around_braces_spec.rb +6 -6
- data/spec/rubocop/cops/space_around_equals_in_default_parameter_spec.rb +22 -0
- data/spec/rubocop/cops/space_around_operators_spec.rb +50 -25
- data/spec/rubocop/cops/space_inside_brackets_spec.rb +8 -8
- data/spec/rubocop/cops/space_inside_parens_spec.rb +4 -4
- data/spec/rubocop/cops/string_literals_spec.rb +5 -5
- data/spec/rubocop/cops/syntax_spec.rb +18 -0
- data/spec/rubocop/cops/tab_spec.rb +3 -3
- data/spec/rubocop/cops/ternary_operator_spec.rb +8 -8
- data/spec/rubocop/cops/trailing_whitespace_spec.rb +4 -4
- data/spec/rubocop/cops/unless_else_spec.rb +4 -4
- data/spec/rubocop/cops/when_then_spec.rb +5 -5
- data/spec/rubocop/reports/emacs_style_spec.rb +3 -3
- data/spec/rubocop/reports/report_spec.rb +5 -5
- data/spec/spec_helper.rb +6 -0
- metadata +57 -28
- data/.rbenv-version +0 -1
- data/.rvmrc +0 -1
- data/features/rubocop.feature +0 -9
- data/features/step_definitions/rubocop_steps.rb +0 -1
- data/features/support/env.rb +0 -15
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
module Rubocop
|
|
4
|
+
module Cop
|
|
5
|
+
class ParenthesesAroundCondition < Cop
|
|
6
|
+
ERROR_MESSAGE = "Don't use parentheses around the condition of an " +
|
|
7
|
+
'if/unless/while/until, unless the condition contains an assignment.'
|
|
8
|
+
|
|
9
|
+
def inspect(file, source, tokens, sexp)
|
|
10
|
+
[:if, :elsif, :unless, :while, :until,
|
|
11
|
+
:if_mod, :unless_mod, :while_mod, :until_mod].each do |keyword|
|
|
12
|
+
each(keyword, sexp) do |s|
|
|
13
|
+
if s[1][0] == :paren && s[1][1][0][0] != :assign
|
|
14
|
+
positions = all_positions(s[1])
|
|
15
|
+
if positions.first.lineno == positions.last.lineno
|
|
16
|
+
add_offence(:convention, positions.first.lineno, ERROR_MESSAGE)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -1,37 +1,26 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
|
-
require_relative 'grammar'
|
|
4
|
-
|
|
5
3
|
module Rubocop
|
|
6
4
|
module Cop
|
|
7
5
|
module SurroundingSpace
|
|
8
6
|
def inspect(file, source, tokens, sexp)
|
|
9
7
|
@correlations.sort.each do |ix, grammar_path|
|
|
10
|
-
|
|
8
|
+
check_missing_space(tokens, ix, grammar_path)
|
|
11
9
|
end
|
|
12
|
-
tokens.each_index { |ix|
|
|
10
|
+
tokens.each_index { |ix| check_unwanted_space(tokens, ix) }
|
|
13
11
|
end
|
|
14
12
|
|
|
15
13
|
private
|
|
16
14
|
|
|
17
|
-
def tokens_on_same_row?(t1, t2)
|
|
18
|
-
t1.pos.lineno == t2.pos.lineno
|
|
19
|
-
end
|
|
20
|
-
|
|
21
15
|
def previous_non_space(tokens, ix)
|
|
22
|
-
|
|
23
|
-
t = tokens[i]
|
|
24
|
-
return t unless whitespace?(t)
|
|
25
|
-
end
|
|
26
|
-
nil
|
|
16
|
+
tokens[0...ix].reverse.find { |t| not whitespace?(t) }
|
|
27
17
|
end
|
|
28
18
|
|
|
29
19
|
def ok_without_spaces?(grammar_path)
|
|
30
20
|
parent, child = grammar_path.values_at(-2, -1)
|
|
31
21
|
return true if [:unary, :symbol, :defs, :def, :call].include?(parent)
|
|
32
22
|
return true if [:**, :block_var].include?(child)
|
|
33
|
-
|
|
34
|
-
false
|
|
23
|
+
parent == :command_call && child == :'::'
|
|
35
24
|
end
|
|
36
25
|
|
|
37
26
|
def surrounded_by_whitespace?(nearby_tokens)
|
|
@@ -40,7 +29,7 @@ module Rubocop
|
|
|
40
29
|
end
|
|
41
30
|
|
|
42
31
|
# Default implementation for classes that don't need it.
|
|
43
|
-
def
|
|
32
|
+
def check_missing_space(tokens, ix, grammar_path)
|
|
44
33
|
end
|
|
45
34
|
end
|
|
46
35
|
|
|
@@ -48,7 +37,7 @@ module Rubocop
|
|
|
48
37
|
include SurroundingSpace
|
|
49
38
|
ERROR_MESSAGE = 'Surrounding space missing for operator '
|
|
50
39
|
|
|
51
|
-
def
|
|
40
|
+
def check_missing_space(tokens, ix, grammar_path)
|
|
52
41
|
t = tokens[ix]
|
|
53
42
|
if t.type == :on_op
|
|
54
43
|
unless surrounded_by_whitespace?(tokens[ix - 1, 3])
|
|
@@ -60,7 +49,7 @@ module Rubocop
|
|
|
60
49
|
end
|
|
61
50
|
end
|
|
62
51
|
|
|
63
|
-
def
|
|
52
|
+
def check_unwanted_space(tokens, ix)
|
|
64
53
|
prev, t, nxt = tokens.values_at(ix - 1, ix, ix + 1)
|
|
65
54
|
if t.type == :on_op && t.text == '**' &&
|
|
66
55
|
(whitespace?(prev) || whitespace?(nxt))
|
|
@@ -73,10 +62,10 @@ module Rubocop
|
|
|
73
62
|
class SpaceAroundBraces < Cop
|
|
74
63
|
include SurroundingSpace
|
|
75
64
|
|
|
76
|
-
def
|
|
65
|
+
def check_unwanted_space(tokens, ix)
|
|
77
66
|
end
|
|
78
67
|
|
|
79
|
-
def
|
|
68
|
+
def check_missing_space(tokens, ix, grammar_path)
|
|
80
69
|
t = tokens[ix]
|
|
81
70
|
case t.type
|
|
82
71
|
when :on_lbrace
|
|
@@ -93,48 +82,60 @@ module Rubocop
|
|
|
93
82
|
end
|
|
94
83
|
end
|
|
95
84
|
|
|
96
|
-
|
|
85
|
+
module SpaceInside
|
|
97
86
|
include SurroundingSpace
|
|
98
|
-
|
|
87
|
+
|
|
88
|
+
Paren = Struct.new :left, :right, :kind
|
|
89
|
+
|
|
90
|
+
def check_unwanted_space(tokens, ix)
|
|
91
|
+
paren = get_paren
|
|
99
92
|
prev, t, nxt = tokens.values_at(ix - 1, ix, ix + 1)
|
|
100
93
|
offence_detected = case t.type
|
|
101
|
-
when
|
|
94
|
+
when paren.left
|
|
102
95
|
nxt.type == :on_sp
|
|
103
|
-
when
|
|
96
|
+
when paren.right
|
|
104
97
|
if prev.type == :on_sp
|
|
105
98
|
prev_ns = previous_non_space(tokens, ix)
|
|
106
|
-
prev_ns &&
|
|
107
|
-
|
|
108
|
-
# Avoid double
|
|
109
|
-
prev_ns.type !=
|
|
99
|
+
prev_ns &&
|
|
100
|
+
prev_ns.pos.lineno == tokens[ix].pos.lineno &&
|
|
101
|
+
# Avoid double reporting
|
|
102
|
+
prev_ns.type != paren.left
|
|
110
103
|
end
|
|
111
104
|
end
|
|
112
105
|
if offence_detected
|
|
113
106
|
add_offence(:convention, t.pos.lineno,
|
|
114
|
-
|
|
107
|
+
"Space inside #{paren.kind} detected.")
|
|
115
108
|
end
|
|
116
109
|
end
|
|
117
110
|
end
|
|
118
111
|
|
|
112
|
+
class SpaceInsideParens < Cop
|
|
113
|
+
include SpaceInside
|
|
114
|
+
def get_paren
|
|
115
|
+
Paren.new(:on_lparen, :on_rparen, 'parentheses')
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
119
|
class SpaceInsideBrackets < Cop
|
|
120
|
-
include
|
|
121
|
-
def
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
120
|
+
include SpaceInside
|
|
121
|
+
def get_paren
|
|
122
|
+
Paren.new(:on_lbracket, :on_rbracket, 'square brackets')
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
class SpaceAroundEqualsInParameterDefault < Cop
|
|
127
|
+
def inspect(file, source, tokens, sexp)
|
|
128
|
+
each(:params, sexp) do |s|
|
|
129
|
+
(s[2] || []).each do |param, value|
|
|
130
|
+
value_pos = all_positions(value).first or next
|
|
131
|
+
if param[-1].lineno == value_pos.lineno
|
|
132
|
+
if value_pos.column - (param[-1].column + param[1].length) <= 2
|
|
133
|
+
add_offence(:convention, param[-1].lineno,
|
|
134
|
+
'Surrounding space missing in default value ' +
|
|
135
|
+
'assignment.')
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
end
|
|
138
139
|
end
|
|
139
140
|
end
|
|
140
141
|
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
|
|
3
|
+
require 'open3'
|
|
4
|
+
|
|
5
|
+
module Rubocop
|
|
6
|
+
module Cop
|
|
7
|
+
class Syntax < Cop
|
|
8
|
+
def inspect(file, source, tokens, sexp)
|
|
9
|
+
_, stderr, _ =
|
|
10
|
+
Open3.capture3('ruby -wc', stdin_data: source.join("\n"))
|
|
11
|
+
|
|
12
|
+
stderr.each_line do |line|
|
|
13
|
+
line_no, warning = line.match(/.+:(\d+): warning: (.+)/).captures
|
|
14
|
+
add_offence(:warning, line_no.to_i, warning.capitalize) if line_no
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
data/lib/rubocop/cop/tab.rb
CHANGED
|
@@ -7,9 +7,7 @@ module Rubocop
|
|
|
7
7
|
|
|
8
8
|
def inspect(file, source, tokens, sexp)
|
|
9
9
|
source.each_with_index do |line, index|
|
|
10
|
-
if line =~ /^ *\t/
|
|
11
|
-
add_offence(:convention, index + 1, ERROR_MESSAGE)
|
|
12
|
-
end
|
|
10
|
+
add_offence(:convention, index + 1, ERROR_MESSAGE) if line =~ /^ *\t/
|
|
13
11
|
end
|
|
14
12
|
end
|
|
15
13
|
end
|
|
@@ -16,8 +16,7 @@ module Rubocop
|
|
|
16
16
|
module_function :create
|
|
17
17
|
|
|
18
18
|
class Report
|
|
19
|
-
|
|
20
|
-
attr_accessor :filename
|
|
19
|
+
attr_reader :filename
|
|
21
20
|
|
|
22
21
|
# @param [String] the filename for this report
|
|
23
22
|
def initialize(filename)
|
|
@@ -33,6 +32,10 @@ module Rubocop
|
|
|
33
32
|
end
|
|
34
33
|
end
|
|
35
34
|
|
|
35
|
+
def entries
|
|
36
|
+
@entries.sort_by(&:line_number)
|
|
37
|
+
end
|
|
38
|
+
|
|
36
39
|
def empty?
|
|
37
40
|
entries.empty?
|
|
38
41
|
end
|
data/lib/rubocop/version.rb
CHANGED
data/lib/rubocop.rb
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
|
|
3
3
|
require 'ripper'
|
|
4
|
+
require 'term/ansicolor'
|
|
5
|
+
|
|
6
|
+
class String
|
|
7
|
+
include Term::ANSIColor
|
|
8
|
+
end
|
|
4
9
|
|
|
5
10
|
require 'rubocop/cop/offence'
|
|
6
11
|
require 'rubocop/cop/cop'
|
|
7
12
|
require 'rubocop/cop/encoding'
|
|
8
13
|
require 'rubocop/cop/line_length'
|
|
14
|
+
require 'rubocop/cop/syntax'
|
|
9
15
|
require 'rubocop/cop/tab'
|
|
10
16
|
require 'rubocop/cop/trailing_whitespace'
|
|
11
17
|
require 'rubocop/cop/indentation'
|
|
@@ -25,9 +31,17 @@ require 'rubocop/cop/ternary_operator'
|
|
|
25
31
|
require 'rubocop/cop/unless_else'
|
|
26
32
|
require 'rubocop/cop/ampersands_pipes_vs_and_or'
|
|
27
33
|
require 'rubocop/cop/when_then'
|
|
34
|
+
require 'rubocop/cop/favor_modifier'
|
|
35
|
+
require 'rubocop/cop/favor_unless_over_negated_if'
|
|
36
|
+
require 'rubocop/cop/new_lambda_literal'
|
|
37
|
+
require 'rubocop/cop/parentheses_around_condition'
|
|
38
|
+
require 'rubocop/cop/method_and_variable_snake_case'
|
|
39
|
+
require 'rubocop/cop/class_and_module_camel_case'
|
|
40
|
+
require 'rubocop/cop/collection_methods'
|
|
28
41
|
|
|
29
42
|
require 'rubocop/report/report'
|
|
30
43
|
require 'rubocop/report/plain_text'
|
|
31
44
|
require 'rubocop/report/emacs_style'
|
|
32
45
|
|
|
33
46
|
require 'rubocop/cli'
|
|
47
|
+
require 'rubocop/version'
|
data/rubocop.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = "rubocop"
|
|
8
|
-
s.version = "0.
|
|
8
|
+
s.version = "0.4.0"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Bozhidar Batsov"]
|
|
12
|
-
s.date = "2013-
|
|
12
|
+
s.date = "2013-04-11"
|
|
13
13
|
s.description = "Automatic Ruby code style checking tool. Aims to enforce the community-driven Ruby Style Guide."
|
|
14
14
|
s.email = "bozhidar@batsov.com"
|
|
15
15
|
s.executables = ["rubocop"]
|
|
@@ -19,10 +19,8 @@ Gem::Specification.new do |s|
|
|
|
19
19
|
]
|
|
20
20
|
s.files = [
|
|
21
21
|
".document",
|
|
22
|
-
".rbenv-version",
|
|
23
22
|
".rspec",
|
|
24
23
|
".rubocop.yml",
|
|
25
|
-
".rvmrc",
|
|
26
24
|
".travis.yml",
|
|
27
25
|
"CONTRIBUTING.md",
|
|
28
26
|
"Gemfile",
|
|
@@ -32,30 +30,35 @@ Gem::Specification.new do |s|
|
|
|
32
30
|
"Rakefile",
|
|
33
31
|
"VERSION",
|
|
34
32
|
"bin/rubocop",
|
|
35
|
-
"features/rubocop.feature",
|
|
36
|
-
"features/step_definitions/rubocop_steps.rb",
|
|
37
|
-
"features/support/env.rb",
|
|
38
33
|
"lib/rubocop.rb",
|
|
39
34
|
"lib/rubocop/cli.rb",
|
|
40
35
|
"lib/rubocop/cop/align_parameters.rb",
|
|
41
36
|
"lib/rubocop/cop/ampersands_pipes_vs_and_or.rb",
|
|
42
37
|
"lib/rubocop/cop/blocks.rb",
|
|
38
|
+
"lib/rubocop/cop/class_and_module_camel_case.rb",
|
|
39
|
+
"lib/rubocop/cop/collection_methods.rb",
|
|
43
40
|
"lib/rubocop/cop/cop.rb",
|
|
44
41
|
"lib/rubocop/cop/def_parentheses.rb",
|
|
45
42
|
"lib/rubocop/cop/empty_lines.rb",
|
|
46
43
|
"lib/rubocop/cop/encoding.rb",
|
|
47
44
|
"lib/rubocop/cop/end_of_line.rb",
|
|
45
|
+
"lib/rubocop/cop/favor_modifier.rb",
|
|
46
|
+
"lib/rubocop/cop/favor_unless_over_negated_if.rb",
|
|
48
47
|
"lib/rubocop/cop/grammar.rb",
|
|
49
48
|
"lib/rubocop/cop/hash_syntax.rb",
|
|
50
49
|
"lib/rubocop/cop/if_then_else.rb",
|
|
51
50
|
"lib/rubocop/cop/indentation.rb",
|
|
52
51
|
"lib/rubocop/cop/line_length.rb",
|
|
52
|
+
"lib/rubocop/cop/method_and_variable_snake_case.rb",
|
|
53
|
+
"lib/rubocop/cop/new_lambda_literal.rb",
|
|
53
54
|
"lib/rubocop/cop/numeric_literals.rb",
|
|
54
55
|
"lib/rubocop/cop/offence.rb",
|
|
55
56
|
"lib/rubocop/cop/parameter_lists.rb",
|
|
57
|
+
"lib/rubocop/cop/parentheses_around_condition.rb",
|
|
56
58
|
"lib/rubocop/cop/space_after_comma_etc.rb",
|
|
57
59
|
"lib/rubocop/cop/string_literals.rb",
|
|
58
60
|
"lib/rubocop/cop/surrounding_space.rb",
|
|
61
|
+
"lib/rubocop/cop/syntax.rb",
|
|
59
62
|
"lib/rubocop/cop/tab.rb",
|
|
60
63
|
"lib/rubocop/cop/ternary_operator.rb",
|
|
61
64
|
"lib/rubocop/cop/trailing_whitespace.rb",
|
|
@@ -69,32 +72,42 @@ Gem::Specification.new do |s|
|
|
|
69
72
|
"spec/rubocop/cli_spec.rb",
|
|
70
73
|
"spec/rubocop/cops/align_parameters_spec.rb",
|
|
71
74
|
"spec/rubocop/cops/ampersands_pipes_vs_and_or_spec.rb",
|
|
75
|
+
"spec/rubocop/cops/class_and_module_camel_case_spec.rb",
|
|
76
|
+
"spec/rubocop/cops/collection_methods_spec.rb",
|
|
72
77
|
"spec/rubocop/cops/cop_spec.rb",
|
|
73
78
|
"spec/rubocop/cops/def_with_parentheses_spec.rb",
|
|
74
79
|
"spec/rubocop/cops/def_without_parentheses_spec.rb",
|
|
75
80
|
"spec/rubocop/cops/empty_lines_spec.rb",
|
|
76
81
|
"spec/rubocop/cops/encoding_spec.rb",
|
|
77
82
|
"spec/rubocop/cops/end_of_line_spec.rb",
|
|
83
|
+
"spec/rubocop/cops/favor_modifier_spec.rb",
|
|
84
|
+
"spec/rubocop/cops/favor_unless_over_negated_if_spec.rb",
|
|
85
|
+
"spec/rubocop/cops/favor_until_over_negated_while_spec.rb",
|
|
78
86
|
"spec/rubocop/cops/grammar_spec.rb",
|
|
79
87
|
"spec/rubocop/cops/hash_syntax_spec.rb",
|
|
80
88
|
"spec/rubocop/cops/if_with_semicolon_spec.rb",
|
|
81
89
|
"spec/rubocop/cops/indentation_spec.rb",
|
|
82
90
|
"spec/rubocop/cops/line_length_spec.rb",
|
|
91
|
+
"spec/rubocop/cops/method_and_variable_snake_case_spec.rb",
|
|
83
92
|
"spec/rubocop/cops/multiline_blocks_spec.rb",
|
|
84
93
|
"spec/rubocop/cops/multiline_if_then_spec.rb",
|
|
94
|
+
"spec/rubocop/cops/new_lambda_literal_spec.rb",
|
|
85
95
|
"spec/rubocop/cops/numeric_literals_spec.rb",
|
|
86
96
|
"spec/rubocop/cops/offence_spec.rb",
|
|
87
97
|
"spec/rubocop/cops/one_line_conditional_spec.rb",
|
|
88
98
|
"spec/rubocop/cops/parameter_lists_spec.rb",
|
|
99
|
+
"spec/rubocop/cops/parentheses_around_condition_spec.rb",
|
|
89
100
|
"spec/rubocop/cops/single_line_blocks_spec.rb",
|
|
90
101
|
"spec/rubocop/cops/space_after_colon_spec.rb",
|
|
91
102
|
"spec/rubocop/cops/space_after_comma_spec.rb",
|
|
92
103
|
"spec/rubocop/cops/space_after_semicolon_spec.rb",
|
|
93
104
|
"spec/rubocop/cops/space_around_braces_spec.rb",
|
|
105
|
+
"spec/rubocop/cops/space_around_equals_in_default_parameter_spec.rb",
|
|
94
106
|
"spec/rubocop/cops/space_around_operators_spec.rb",
|
|
95
107
|
"spec/rubocop/cops/space_inside_brackets_spec.rb",
|
|
96
108
|
"spec/rubocop/cops/space_inside_parens_spec.rb",
|
|
97
109
|
"spec/rubocop/cops/string_literals_spec.rb",
|
|
110
|
+
"spec/rubocop/cops/syntax_spec.rb",
|
|
98
111
|
"spec/rubocop/cops/tab_spec.rb",
|
|
99
112
|
"spec/rubocop/cops/ternary_operator_spec.rb",
|
|
100
113
|
"spec/rubocop/cops/trailing_whitespace_spec.rb",
|
|
@@ -114,26 +127,29 @@ Gem::Specification.new do |s|
|
|
|
114
127
|
s.specification_version = 3
|
|
115
128
|
|
|
116
129
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
117
|
-
s.
|
|
118
|
-
s.add_development_dependency(%q<
|
|
119
|
-
s.add_development_dependency(%q<
|
|
120
|
-
s.add_development_dependency(%q<
|
|
121
|
-
s.add_development_dependency(%q<
|
|
130
|
+
s.add_runtime_dependency(%q<term-ansicolor>, [">= 0"])
|
|
131
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
|
132
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
|
133
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
|
134
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
|
135
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
|
122
136
|
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
|
123
137
|
else
|
|
124
|
-
s.add_dependency(%q<
|
|
125
|
-
s.add_dependency(%q<
|
|
126
|
-
s.add_dependency(%q<
|
|
127
|
-
s.add_dependency(%q<
|
|
128
|
-
s.add_dependency(%q<
|
|
138
|
+
s.add_dependency(%q<term-ansicolor>, [">= 0"])
|
|
139
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
|
140
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
|
141
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
|
142
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
|
143
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
|
129
144
|
s.add_dependency(%q<simplecov>, [">= 0"])
|
|
130
145
|
end
|
|
131
146
|
else
|
|
132
|
-
s.add_dependency(%q<
|
|
133
|
-
s.add_dependency(%q<
|
|
134
|
-
s.add_dependency(%q<
|
|
135
|
-
s.add_dependency(%q<
|
|
136
|
-
s.add_dependency(%q<
|
|
147
|
+
s.add_dependency(%q<term-ansicolor>, [">= 0"])
|
|
148
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
|
149
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
|
150
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
|
151
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
|
152
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
|
137
153
|
s.add_dependency(%q<simplecov>, [">= 0"])
|
|
138
154
|
end
|
|
139
155
|
end
|