rubocop 0.25.0 → 0.26.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.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +37 -0
- data/README.md +2 -2
- data/assets/output.html.erb +190 -0
- data/config/default.yml +14 -2
- data/config/disabled.yml +7 -0
- data/config/enabled.yml +132 -5
- data/lib/rubocop.rb +5 -0
- data/lib/rubocop/cop/commissioner.rb +4 -10
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +1 -1
- data/lib/rubocop/cop/lint/end_in_method.rb +3 -8
- data/lib/rubocop/cop/lint/ensure_return.rb +2 -2
- data/lib/rubocop/cop/lint/space_before_first_arg.rb +8 -1
- data/lib/rubocop/cop/lint/useless_assignment.rb +35 -0
- data/lib/rubocop/cop/lint/useless_setter_call.rb +2 -3
- data/lib/rubocop/cop/metrics/block_nesting.rb +3 -3
- data/lib/rubocop/cop/metrics/class_length.rb +1 -2
- data/lib/rubocop/cop/mixin/access_modifier_node.rb +5 -1
- data/lib/rubocop/cop/mixin/autocorrect_alignment.rb +2 -2
- data/lib/rubocop/cop/mixin/configurable_naming.rb +2 -2
- data/lib/rubocop/cop/mixin/method_complexity.rb +2 -4
- data/lib/rubocop/cop/mixin/statement_modifier.rb +1 -3
- data/lib/rubocop/cop/rails/delegate.rb +1 -1
- data/lib/rubocop/cop/rails/validation.rb +25 -2
- data/lib/rubocop/cop/style/alias.rb +1 -1
- data/lib/rubocop/cop/style/and_or.rb +12 -2
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +19 -12
- data/lib/rubocop/cop/style/documentation.rb +1 -1
- data/lib/rubocop/cop/style/dot_position.rb +20 -0
- data/lib/rubocop/cop/style/empty_lines_around_access_modifier.rb +5 -1
- data/lib/rubocop/cop/style/encoding.rb +4 -4
- data/lib/rubocop/cop/style/format_string.rb +12 -2
- data/lib/rubocop/cop/style/if_unless_modifier.rb +8 -11
- data/lib/rubocop/cop/style/infinite_loop.rb +57 -0
- data/lib/rubocop/cop/style/multiline_block_chain.rb +15 -16
- data/lib/rubocop/cop/style/multiline_if_then.rb +10 -0
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +3 -3
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +3 -1
- data/lib/rubocop/cop/style/predicate_name.rb +23 -5
- data/lib/rubocop/cop/style/redundant_begin.rb +1 -1
- data/lib/rubocop/cop/style/single_line_block_params.rb +1 -1
- data/lib/rubocop/cop/style/space_around_equals_in_parameter_default.rb +4 -8
- data/lib/rubocop/cop/style/space_inside_hash_literal_braces.rb +9 -11
- data/lib/rubocop/cop/style/space_inside_range_literal.rb +58 -0
- data/lib/rubocop/cop/style/special_global_vars.rb +1 -1
- data/lib/rubocop/cop/style/symbol_proc.rb +71 -0
- data/lib/rubocop/cop/style/tab.rb +11 -3
- data/lib/rubocop/cop/style/unneeded_capital_w.rb +6 -2
- data/lib/rubocop/cop/style/variable_name.rb +4 -14
- data/lib/rubocop/cop/style/while_until_modifier.rb +12 -8
- data/lib/rubocop/cop/variable_force.rb +17 -30
- data/lib/rubocop/cop/variable_force/assignment.rb +15 -23
- data/lib/rubocop/cop/variable_force/locatable.rb +29 -8
- data/lib/rubocop/cop/variable_force/scope.rb +34 -23
- data/lib/rubocop/cop/variable_force/variable.rb +7 -10
- data/lib/rubocop/formatter/disabled_config_formatter.rb +3 -2
- data/lib/rubocop/formatter/formatter_set.rb +1 -0
- data/lib/rubocop/formatter/fuubar_style_formatter.rb +1 -1
- data/lib/rubocop/formatter/html_formatter.rb +90 -0
- data/lib/rubocop/formatter/progress_formatter.rb +1 -1
- data/lib/rubocop/options.rb +1 -0
- data/lib/rubocop/processed_source.rb +10 -1
- data/lib/rubocop/string_util.rb +153 -0
- data/lib/rubocop/target_finder.rb +1 -1
- data/lib/rubocop/version.rb +1 -1
- data/relnotes/v0.26.0.md +89 -0
- data/rubocop.gemspec +1 -0
- data/spec/rubocop/cli_spec.rb +60 -34
- data/spec/rubocop/config_loader_spec.rb +19 -15
- data/spec/rubocop/cop/commissioner_spec.rb +2 -2
- data/spec/rubocop/cop/lint/block_alignment_spec.rb +74 -58
- data/spec/rubocop/cop/lint/space_before_first_arg_spec.rb +7 -0
- data/spec/rubocop/cop/lint/useless_assignment_spec.rb +173 -0
- data/spec/rubocop/cop/rails/validation_spec.rb +9 -2
- data/spec/rubocop/cop/style/access_modifier_indentation_spec.rb +26 -0
- data/spec/rubocop/cop/style/and_or_spec.rb +52 -61
- data/spec/rubocop/cop/style/braces_around_hash_parameters_spec.rb +26 -8
- data/spec/rubocop/cop/style/case_indentation_spec.rb +8 -8
- data/spec/rubocop/cop/style/def_with_parentheses_spec.rb +6 -2
- data/spec/rubocop/cop/style/dot_position_spec.rb +39 -0
- data/spec/rubocop/cop/style/empty_lines_around_access_modifier_spec.rb +12 -2
- data/spec/rubocop/cop/style/encoding_spec.rb +16 -28
- data/spec/rubocop/cop/style/format_string_spec.rb +12 -0
- data/spec/rubocop/cop/style/infinite_loop_spec.rb +48 -0
- data/spec/rubocop/cop/style/method_def_parentheses_spec.rb +3 -1
- data/spec/rubocop/cop/style/multiline_if_then_spec.rb +9 -0
- data/spec/rubocop/cop/style/percent_literal_delimiters_spec.rb +21 -1
- data/spec/rubocop/cop/style/predicate_name_spec.rb +44 -13
- data/spec/rubocop/cop/style/redundant_begin_spec.rb +32 -0
- data/spec/rubocop/cop/style/space_inside_range_literal_spec.rb +52 -0
- data/spec/rubocop/cop/style/symbol_proc_spec.rb +76 -0
- data/spec/rubocop/cop/style/tab_spec.rb +30 -0
- data/spec/rubocop/cop/style/trailing_whitespace_spec.rb +2 -1
- data/spec/rubocop/cop/style/unneeded_capital_w_spec.rb +18 -5
- data/spec/rubocop/cop/style/variable_name_spec.rb +5 -5
- data/spec/rubocop/cop/style/when_then_spec.rb +3 -1
- data/spec/rubocop/cop/style/while_until_do_spec.rb +4 -2
- data/spec/rubocop/cop/util_spec.rb +1 -9
- data/spec/rubocop/cop/variable_force/assignment_spec.rb +2 -15
- data/spec/rubocop/cop/variable_force/locatable_spec.rb +2 -37
- data/spec/rubocop/cop/variable_force/scope_spec.rb +156 -49
- data/spec/rubocop/cop/variable_force/variable_spec.rb +2 -1
- data/spec/rubocop/cop/variable_force_spec.rb +2 -1
- data/spec/rubocop/formatter/emacs_style_formatter_spec.rb +2 -1
- data/spec/rubocop/formatter/html_formatter_spec.rb +145 -0
- data/spec/rubocop/formatter/simple_text_formatter_spec.rb +18 -6
- data/spec/rubocop/options_spec.rb +1 -0
- data/spec/rubocop/path_util_spec.rb +6 -4
- data/spec/rubocop/processed_source_spec.rb +17 -1
- data/spec/rubocop/string_util_spec.rb +46 -0
- metadata +33 -4
- data/spec/support/ast_helper.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 800751d069262c05789ef58ff88e1b89cc84926f
|
4
|
+
data.tar.gz: 87c0f2ae5445f9a95671dc7bdcc949545adcbf2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85b985829442ce2e4fe87a526c5f214a78ea7956b0589e34620473e426a62783e2944e46acb28cef8fb7a2bd4e84e11e00fbf7e5f86025d6f5f88dc19047d27d
|
7
|
+
data.tar.gz: 3908cc133515d66b1d8e861c3caa7fd1e5a7eab03a4217a03c856586d9f2f1d9f31b4c949cd8c6aabc870dc5d2655a3bbc530eb4be17cd4c4550205e6710a626
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,40 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.26.0 (03/09/2014)
|
6
|
+
|
7
|
+
### New features
|
8
|
+
|
9
|
+
* New formatter `HTMLFormatter` generates a html file with a list of files with offences in them. ([@SkuliOskarsson][])
|
10
|
+
* New cop `SpaceInsideRangeLiteral` checks for spaces around `..` and `...` in range literals. ([@bbatsov][])
|
11
|
+
* New cop `InfiniteLoop` checks for places where `Kernel#loop` should have been used. ([@bbatsov][])
|
12
|
+
* New cop `SymbolProc` checks for places where a symbol can be used as proc instead of a block. ([@bbatsov][])
|
13
|
+
* `UselessAssignment` cop now suggests a variable name for possible typos if there's a variable-ish identifier similar to the unused variable name in the same scope. ([@yujinakayama][])
|
14
|
+
* `PredicateName` cop now has separate configurations for prefices that denote predicate method names and predicate prefices that should be removed. ([@bbatsov][])
|
15
|
+
* [#1272](https://github.com/bbatsov/rubocop/issues/1272): `Tab` cop does auto-correction. ([@yous][])
|
16
|
+
* [#1274](https://github.com/bbatsov/rubocop/issues/1274): `MultilineIfThen` cop does auto-correction. ([@bbatsov][])
|
17
|
+
* [#1279](https://github.com/bbatsov/rubocop/issues/1279): `DotPosition` cop does auto-correction. ([@yous][])
|
18
|
+
* [#1277](https://github.com/bbatsov/rubocop/issues/1277): `SpaceBeforeFirstArg` cop does auto-correction. ([@yous][])
|
19
|
+
* [#1310](https://github.com/bbatsov/rubocop/issues/1310): Handle `module_function` in `Style/AccessModifierIndentation` and `Style/EmptyLinesAroundAccessModifier`. ([@bbatsov][])
|
20
|
+
|
21
|
+
### Changes
|
22
|
+
|
23
|
+
* [#1289](https://github.com/bbatsov/rubocop/issues/1289): Use utf-8 as default encoding for inspected files. ([@jonas054][])
|
24
|
+
* [#1304](https://github.com/bbatsov/rubocop/issues/1304): `Style/Encoding` is no longer a no-op on Ruby 2.x. It's also disabled by default, as projects not supporting 1.9 don't need to run it. ([@bbatsov][])
|
25
|
+
|
26
|
+
### Bugs fixed
|
27
|
+
|
28
|
+
* [#1263](https://github.com/bbatsov/rubocop/issues/1263): Do not report `%W` literals with special escaped characters in `UnneededCapitalW`. ([@jonas054][])
|
29
|
+
* [#1286](https://github.com/bbatsov/rubocop/issues/1286): Fix a false positive in `VariableName`. ([@bbatsov][])
|
30
|
+
* [#1211](https://github.com/bbatsov/rubocop/issues/1211): Fix false negative in `UselessAssignment` when there's a reference for the variable in an exclusive branch. ([@yujinakayama][])
|
31
|
+
* [#1307](https://github.com/bbatsov/rubocop/issues/1307): Fix auto-correction of `RedundantBegin` cop deletes new line. ([@yous][])
|
32
|
+
* [#1283](https://github.com/bbatsov/rubocop/issues/1283): Fix auto-correction of indented expressions in `PercentLiteralDelimiters`. ([@jonas054][])
|
33
|
+
* [#1315](https://github.com/bbatsov/rubocop/pull/1315): `BracesAroundHashParameters` auto-correction removes whitespace around content inside braces. ([@jspanjers][])
|
34
|
+
* [#1313](https://github.com/bbatsov/rubocop/issues/1313): Fix a false positive in `AndOr` when enforced style is `conditionals`. ([@bbatsov][])
|
35
|
+
* Handle post-conditional `while` and `until` in `AndOr` when enforced style is `conditionals`. ([@yujinakayama][])
|
36
|
+
* [#1319](https://github.com/bbatsov/rubocop/issues/1319): Fix a false positive in `FormatString`. ([@bbatsov][])
|
37
|
+
* [#1287](https://github.com/bbatsov/rubocop/issues/1287): Allow missing blank line for EmptyLinesAroundAccessModifier if next line closes a block. ([@sch1zo][])
|
38
|
+
|
5
39
|
## 0.25.0 (15/08/2014)
|
6
40
|
|
7
41
|
### New features
|
@@ -1056,3 +1090,6 @@
|
|
1056
1090
|
[@mcls]: https://github.com/mcls
|
1057
1091
|
[@yous]: https://github.com/yous
|
1058
1092
|
[@vrthra]: https://github.com/vrthra
|
1093
|
+
[@SkuliOskarsson]: https://github.com/SkuliOskarsson
|
1094
|
+
[@jspanjers]: https://github.com/jspanjers
|
1095
|
+
[@sch1zo]: https://github.com/sch1zo
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/rubocop.svg)](http://badge.fury.io/rb/rubocop)
|
2
2
|
[![Dependency Status](https://gemnasium.com/bbatsov/rubocop.svg)](https://gemnasium.com/bbatsov/rubocop)
|
3
3
|
[![Build Status](https://travis-ci.org/bbatsov/rubocop.svg?branch=master)](https://travis-ci.org/bbatsov/rubocop)
|
4
|
-
[![Coverage Status](
|
5
|
-
[![Code Climate](https://codeclimate.com/github/bbatsov/rubocop.
|
4
|
+
[![Coverage Status](http://img.shields.io/coveralls/bbatsov/rubocop/master.svg)](https://coveralls.io/r/bbatsov/rubocop)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/bbatsov/rubocop/badges/gpa.svg)](https://codeclimate.com/github/bbatsov/rubocop)
|
6
6
|
[![Inline docs](http://inch-ci.org/github/bbatsov/rubocop.svg)](http://inch-ci.org/github/bbatsov/rubocop)
|
7
7
|
|
8
8
|
# RuboCop
|
@@ -0,0 +1,190 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset='UTF-8' />
|
5
|
+
<title>RuboCop output</title>
|
6
|
+
<style>
|
7
|
+
* {
|
8
|
+
-webkit-box-sizing: border-box;
|
9
|
+
-moz-box-sizing: border-box;
|
10
|
+
box-sizing: border-box;
|
11
|
+
}
|
12
|
+
|
13
|
+
body, html {
|
14
|
+
font-size: 62.5%;
|
15
|
+
}
|
16
|
+
body {
|
17
|
+
background-color: #ecedf0;
|
18
|
+
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
|
19
|
+
margin: 0;
|
20
|
+
}
|
21
|
+
#header {
|
22
|
+
background: #171717;
|
23
|
+
border-bottom: none;
|
24
|
+
border-left: 1px solid #3a3a3a;
|
25
|
+
box-shadow: 1px 3px 0 1px #cccccc;
|
26
|
+
height: 50px;
|
27
|
+
padding: 0;
|
28
|
+
}
|
29
|
+
h2 {
|
30
|
+
color: #FFF;
|
31
|
+
display: inline-block;
|
32
|
+
float: left;
|
33
|
+
height: 50px;
|
34
|
+
font-size: 2rem;
|
35
|
+
letter-spacing: normal;
|
36
|
+
line-height: 50px;
|
37
|
+
margin: 0;
|
38
|
+
padding: 0 22px 0 20px;
|
39
|
+
}
|
40
|
+
|
41
|
+
.information, #offenses {
|
42
|
+
width: 100%;
|
43
|
+
padding: 20px;
|
44
|
+
color: #333;
|
45
|
+
}
|
46
|
+
#offenses {
|
47
|
+
padding: 0 20px;
|
48
|
+
}
|
49
|
+
|
50
|
+
.information .infobox {
|
51
|
+
border-left: 3px solid;
|
52
|
+
border-radius: 4px;
|
53
|
+
background-color: #fff;
|
54
|
+
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
|
55
|
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
|
56
|
+
padding: 15px;
|
57
|
+
border-color: #0088cc;
|
58
|
+
}
|
59
|
+
|
60
|
+
.information .infobox .info-title {
|
61
|
+
font-size: 1.8rem;
|
62
|
+
line-height: 2.2rem;
|
63
|
+
margin: 0;
|
64
|
+
}
|
65
|
+
.information .infobox ul {
|
66
|
+
font-size: 1.4rem;
|
67
|
+
list-style: none;
|
68
|
+
margin: 0;
|
69
|
+
margin-top: 5px;
|
70
|
+
padding: 0;
|
71
|
+
}
|
72
|
+
.information .infobox ul li {
|
73
|
+
line-height: 1.8rem
|
74
|
+
}
|
75
|
+
|
76
|
+
#offenses .offense-box {
|
77
|
+
border-radius: 4px;
|
78
|
+
margin-bottom: 20px;
|
79
|
+
background-color: #fff;
|
80
|
+
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
|
81
|
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
|
82
|
+
}
|
83
|
+
#offenses .offense-box .box-title h3 {
|
84
|
+
color: #33353f;
|
85
|
+
background-color: #f6f6f6;
|
86
|
+
font-size: 2rem;
|
87
|
+
line-height: 2rem;
|
88
|
+
display: block;
|
89
|
+
padding: 15px;
|
90
|
+
border-radius: 5px;
|
91
|
+
margin: 0;
|
92
|
+
}
|
93
|
+
#offenses .offense-box .offense-reports {
|
94
|
+
padding: 0 15px;
|
95
|
+
}
|
96
|
+
#offenses .offense-box .offense-reports .report {
|
97
|
+
border-bottom: 1px dotted #ddd;
|
98
|
+
padding: 15px 0px;
|
99
|
+
position: relative;
|
100
|
+
font-size: 1.3rem;
|
101
|
+
}
|
102
|
+
#offenses .offense-box .offense-reports .report:last-child {
|
103
|
+
border-bottom: none;
|
104
|
+
}
|
105
|
+
#offenses .offense-box .offense-reports .report pre {
|
106
|
+
background: #000;
|
107
|
+
color: #fff;
|
108
|
+
padding: 10px 15px;
|
109
|
+
font-size: 1.2rem;
|
110
|
+
border-radius: 5px;
|
111
|
+
line-height: 1.6rem;
|
112
|
+
}
|
113
|
+
#offenses .offense-box .offense-reports .report .location {
|
114
|
+
padding: 0;
|
115
|
+
list-style: none;
|
116
|
+
}
|
117
|
+
#offenses .offense-box .offense-reports .report .location li {
|
118
|
+
display: inline;
|
119
|
+
margin-right: 10px;
|
120
|
+
}
|
121
|
+
.severity {
|
122
|
+
text-transform: capitalize;
|
123
|
+
font-weight: bold;
|
124
|
+
}
|
125
|
+
.severity.convention, .severity.refactor {
|
126
|
+
color: #47a447;
|
127
|
+
}
|
128
|
+
.severity.warning {
|
129
|
+
color: #ed9c28;
|
130
|
+
}
|
131
|
+
.severity.error, .severity.fatal {
|
132
|
+
color: #d2322d;
|
133
|
+
}
|
134
|
+
</style>
|
135
|
+
</head>
|
136
|
+
<body>
|
137
|
+
<div id="header">
|
138
|
+
<h2>RuboCop Output</h2>
|
139
|
+
</div>
|
140
|
+
<div class="information">
|
141
|
+
<div class="infobox">
|
142
|
+
<h4 class="info-title">RuboCop Stats</h4>
|
143
|
+
<ul>
|
144
|
+
<li><strong>Offense Count:</strong> <%= output_hash[:summary][:offense_count] %></li>
|
145
|
+
<li><strong>Target File Count:</strong> <%= output_hash[:summary][:target_file_count] %></li>
|
146
|
+
<li><strong>Inspected File Count:</strong> <%= output_hash[:summary][:inspected_file_count] %></li>
|
147
|
+
</ul>
|
148
|
+
</div>
|
149
|
+
</div>
|
150
|
+
<div id="offenses">
|
151
|
+
<% output_hash[:files].each do |file| %>
|
152
|
+
<% if file[:offenses].any? %>
|
153
|
+
<div class="offense-box">
|
154
|
+
<div class="box-title"><h3><%= file[:path] %> - <%= file[:offenses].length %></h3></div>
|
155
|
+
<div class="offense-reports">
|
156
|
+
<% file[:offenses].each do |offense| %>
|
157
|
+
<div class="report">
|
158
|
+
<p class="message"><span class="severity <%= offense[:severity] %>"><%= offense[:severity] %>:</span> <%= offense[:message] %></p>
|
159
|
+
<% if offense[:location][:source_line].strip.length > 0 %>
|
160
|
+
<pre>
|
161
|
+
<%= offense[:location][:source_line] %>
|
162
|
+
<%= offense[:location][:highlight] %>
|
163
|
+
</pre>
|
164
|
+
<% end %>
|
165
|
+
<ul class="location">
|
166
|
+
<li><strong>Line: </strong> <%= offense[:location][:line] %></li>
|
167
|
+
<li><strong>Column: </strong> <%= offense[:location][:column] %></li>
|
168
|
+
<li><strong>Length: </strong> <%= offense[:location][:length] %></li>
|
169
|
+
</ul>
|
170
|
+
</div>
|
171
|
+
<% end %>
|
172
|
+
</div>
|
173
|
+
</div>
|
174
|
+
<% end %>
|
175
|
+
<% end %>
|
176
|
+
</div>
|
177
|
+
<div class="information">
|
178
|
+
<div class="infobox">
|
179
|
+
<h4 class="info-title">Environment Information</h4>
|
180
|
+
<ul>
|
181
|
+
<li><strong>RuboCop Version:</strong> <%= output_hash[:metadata][:rubocop_version] %></li>
|
182
|
+
<li><strong>Ruby Engine:</strong> <%= output_hash[:metadata][:ruby_engine] %></li>
|
183
|
+
<li><strong>Ruby Version:</strong> <%= output_hash[:metadata][:ruby_version] %></li>
|
184
|
+
<li><strong>Ruby Patch Level:</strong> <%= output_hash[:metadata][:ruby_patchlevel] %></li>
|
185
|
+
<li><strong>Ruby Platform:</strong> <%= output_hash[:metadata][:ruby_platform] %></li>
|
186
|
+
</ul>
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
</body>
|
190
|
+
</html>
|
data/config/default.yml
CHANGED
@@ -100,8 +100,8 @@ Style/AlignHash:
|
|
100
100
|
Style/AlignParameters:
|
101
101
|
# Alignment of parameters in multi-line method calls.
|
102
102
|
#
|
103
|
-
# The `with_first_parameter` style aligns the following lines along the same
|
104
|
-
# as the first parameter.
|
103
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
104
|
+
# column as the first parameter.
|
105
105
|
#
|
106
106
|
# method_call(a,
|
107
107
|
# b)
|
@@ -338,6 +338,12 @@ Style/PercentQLiterals:
|
|
338
338
|
- upper_case_q # Always use %Q
|
339
339
|
|
340
340
|
Style/PredicateName:
|
341
|
+
# Predicate name prefices.
|
342
|
+
NamePrefix:
|
343
|
+
- is_
|
344
|
+
- has_
|
345
|
+
- have_
|
346
|
+
# Predicate name prefices that should be removed.
|
341
347
|
NamePrefixBlacklist:
|
342
348
|
- is_
|
343
349
|
- has_
|
@@ -416,6 +422,12 @@ Style/SpaceInsideHashLiteralBraces:
|
|
416
422
|
- space
|
417
423
|
- no_space
|
418
424
|
|
425
|
+
Style/SymbolProc:
|
426
|
+
# A list of method names to be ignored by the check.
|
427
|
+
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
|
428
|
+
IgnoredMethods:
|
429
|
+
- respond_to
|
430
|
+
|
419
431
|
Style/TrailingBlankLines:
|
420
432
|
EnforcedStyle: final_newline
|
421
433
|
SupportedStyles:
|
data/config/disabled.yml
CHANGED
@@ -1,13 +1,20 @@
|
|
1
1
|
# These are all the cops that are disabled in the default configuration.
|
2
2
|
|
3
|
+
Style/Encoding:
|
4
|
+
Description: 'Use UTF-8 as the source file encoding.'
|
5
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#utf-8'
|
6
|
+
Enabled: false
|
7
|
+
|
3
8
|
Style/InlineComment:
|
4
9
|
Description: 'Avoid inline comments.'
|
5
10
|
Enabled: false
|
6
11
|
|
7
12
|
Style/MethodCalledOnDoEndBlock:
|
8
13
|
Description: 'Avoid chaining a method call on a do...end block.'
|
14
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
9
15
|
Enabled: false
|
10
16
|
|
11
17
|
Style/SymbolArray:
|
12
18
|
Description: 'Use %i or %I for arrays of symbols.'
|
19
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-i'
|
13
20
|
Enabled: false
|
data/config/enabled.yml
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
Style/AccessModifierIndentation:
|
4
4
|
Description: Check indentation of private/protected visibility modifiers.
|
5
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
|
5
6
|
Enabled: true
|
6
7
|
|
7
8
|
Style/AccessorMethodName:
|
@@ -10,12 +11,14 @@ Style/AccessorMethodName:
|
|
10
11
|
|
11
12
|
Style/Alias:
|
12
13
|
Description: 'Use alias_method instead of alias.'
|
14
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
|
13
15
|
Enabled: true
|
14
16
|
|
15
17
|
Style/AlignArray:
|
16
18
|
Description: >-
|
17
19
|
Align the elements of an array literal if they span more than
|
18
20
|
one line.
|
21
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
|
19
22
|
Enabled: true
|
20
23
|
|
21
24
|
Style/AlignHash:
|
@@ -28,38 +31,47 @@ Style/AlignParameters:
|
|
28
31
|
Description: >-
|
29
32
|
Align the parameters of a method call if they span more
|
30
33
|
than one line.
|
34
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
|
31
35
|
Enabled: true
|
32
36
|
|
33
37
|
Style/AndOr:
|
34
38
|
Description: 'Use &&/|| instead of and/or.'
|
39
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
|
35
40
|
Enabled: true
|
36
41
|
|
37
42
|
Style/ArrayJoin:
|
38
43
|
Description: 'Use Array#join instead of Array#*.'
|
44
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
|
39
45
|
Enabled: true
|
40
46
|
|
41
47
|
Style/AsciiComments:
|
42
48
|
Description: 'Use only ascii symbols in comments.'
|
49
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
43
50
|
Enabled: true
|
44
51
|
|
45
52
|
Style/AsciiIdentifiers:
|
46
53
|
Description: 'Use only ascii symbols in identifiers.'
|
54
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
47
55
|
Enabled: true
|
48
56
|
|
49
57
|
Style/Attr:
|
50
58
|
Description: 'Checks for uses of Module#attr.'
|
59
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
51
60
|
Enabled: true
|
52
61
|
|
53
62
|
Style/BeginBlock:
|
54
63
|
Description: 'Avoid the use of BEGIN blocks.'
|
64
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
|
55
65
|
Enabled: true
|
56
66
|
|
57
67
|
Style/BarePercentLiterals:
|
58
68
|
Description: 'Checks if usage of %() or %Q() matches configuration.'
|
69
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
|
59
70
|
Enabled: true
|
60
71
|
|
61
72
|
Style/BlockComments:
|
62
73
|
Description: 'Do not use block comments.'
|
74
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
|
63
75
|
Enabled: true
|
64
76
|
|
65
77
|
Style/BlockEndNewline:
|
@@ -71,6 +83,7 @@ Style/Blocks:
|
|
71
83
|
Avoid using {...} for multi-line blocks (multiline chaining is
|
72
84
|
always ugly).
|
73
85
|
Prefer {...} over do...end for single-line blocks.
|
86
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
74
87
|
Enabled: true
|
75
88
|
|
76
89
|
Style/BracesAroundHashParameters:
|
@@ -79,18 +92,22 @@ Style/BracesAroundHashParameters:
|
|
79
92
|
|
80
93
|
Style/CaseEquality:
|
81
94
|
Description: 'Avoid explicit use of the case equality operator(===).'
|
95
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
82
96
|
Enabled: true
|
83
97
|
|
84
98
|
Style/CaseIndentation:
|
85
99
|
Description: 'Indentation of when in a case/when/[else/]end.'
|
100
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
|
86
101
|
Enabled: true
|
87
102
|
|
88
103
|
Style/CharacterLiteral:
|
89
104
|
Description: 'Checks for uses of character literals.'
|
105
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
|
90
106
|
Enabled: true
|
91
107
|
|
92
108
|
Style/ClassAndModuleCamelCase:
|
93
109
|
Description: 'Use CamelCase for classes and modules.'
|
110
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
|
94
111
|
Enabled: true
|
95
112
|
|
96
113
|
Style/ClassAndModuleChildren:
|
@@ -103,18 +120,22 @@ Style/ClassCheck:
|
|
103
120
|
|
104
121
|
Style/ClassMethods:
|
105
122
|
Description: 'Use self when defining module/class methods.'
|
123
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-singletons'
|
106
124
|
Enabled: true
|
107
125
|
|
108
126
|
Style/ClassVars:
|
109
127
|
Description: 'Avoid the use of class variables.'
|
128
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
110
129
|
Enabled: true
|
111
130
|
|
112
131
|
Style/CollectionMethods:
|
113
132
|
Description: 'Preferred collection methods.'
|
133
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#map-fine-select-reduce-size'
|
114
134
|
Enabled: true
|
115
135
|
|
116
136
|
Style/ColonMethodCall:
|
117
137
|
Description: 'Do not use :: for method call.'
|
138
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
|
118
139
|
Enabled: true
|
119
140
|
|
120
141
|
Style/CommentAnnotation:
|
@@ -129,6 +150,7 @@ Style/CommentIndentation:
|
|
129
150
|
|
130
151
|
Style/ConstantName:
|
131
152
|
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
153
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
|
132
154
|
Enabled: true
|
133
155
|
|
134
156
|
Style/DefWithParentheses:
|
@@ -137,6 +159,7 @@ Style/DefWithParentheses:
|
|
137
159
|
|
138
160
|
Style/DeprecatedHashMethods:
|
139
161
|
Description: 'Checks for use of deprecated Hash methods.'
|
162
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
|
140
163
|
Enabled: true
|
141
164
|
|
142
165
|
Style/Documentation:
|
@@ -145,10 +168,12 @@ Style/Documentation:
|
|
145
168
|
|
146
169
|
Style/DotPosition:
|
147
170
|
Description: 'Checks the position of the dot in multi-line method calls.'
|
171
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
148
172
|
Enabled: true
|
149
173
|
|
150
174
|
Style/DoubleNegation:
|
151
175
|
Description: 'Checks for uses of double negation (!!).'
|
176
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
|
152
177
|
Enabled: true
|
153
178
|
|
154
179
|
Style/EachWithObject:
|
@@ -157,6 +182,7 @@ Style/EachWithObject:
|
|
157
182
|
|
158
183
|
Style/EmptyLineBetweenDefs:
|
159
184
|
Description: 'Use empty lines between defs.'
|
185
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
|
160
186
|
Enabled: true
|
161
187
|
|
162
188
|
Style/EmptyLines:
|
@@ -173,62 +199,71 @@ Style/EmptyLinesAroundBody:
|
|
173
199
|
|
174
200
|
Style/EmptyLiteral:
|
175
201
|
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
176
|
-
|
177
|
-
|
178
|
-
Style/Encoding:
|
179
|
-
Description: 'Use UTF-8 as the source file encoding.'
|
202
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
|
180
203
|
Enabled: true
|
181
204
|
|
182
205
|
Style/EndBlock:
|
183
206
|
Description: 'Avoid the use of END blocks.'
|
207
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
|
184
208
|
Enabled: true
|
185
209
|
|
186
210
|
Style/EndOfLine:
|
187
211
|
Description: 'Use Unix-style line endings.'
|
212
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
|
188
213
|
Enabled: true
|
189
214
|
|
190
215
|
Style/EvenOdd:
|
191
216
|
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
|
217
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
192
218
|
Enabled: true
|
193
219
|
|
194
220
|
Style/FileName:
|
195
221
|
Description: 'Use snake_case for source file names.'
|
222
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
196
223
|
Enabled: true
|
197
224
|
|
198
225
|
Style/FlipFlop:
|
199
226
|
Description: 'Checks for flip flops'
|
227
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
200
228
|
Enabled: true
|
201
229
|
|
202
230
|
Style/For:
|
203
231
|
Description: 'Checks use of for or each in multiline loops.'
|
232
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
|
204
233
|
Enabled: true
|
205
234
|
|
206
235
|
Style/FormatString:
|
207
236
|
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
237
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
|
208
238
|
Enabled: true
|
209
239
|
|
210
240
|
Style/GlobalVars:
|
211
241
|
Description: 'Do not introduce global variables.'
|
242
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
|
212
243
|
Enabled: true
|
213
244
|
|
214
245
|
Style/GuardClause:
|
215
246
|
Description: 'Check for conditionals that can be replaced with guard clauses'
|
247
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
216
248
|
Enabled: true
|
217
249
|
|
218
250
|
Style/HashSyntax:
|
219
251
|
Description: >-
|
220
252
|
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
221
253
|
{ :a => 1, :b => 2 }.
|
254
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
|
222
255
|
Enabled: true
|
223
256
|
|
224
257
|
Style/IfUnlessModifier:
|
225
258
|
Description: >-
|
226
259
|
Favor modifier if/unless usage when you have a
|
227
260
|
single-line body.
|
261
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
228
262
|
Enabled: true
|
229
263
|
|
230
264
|
Style/IfWithSemicolon:
|
231
265
|
Description: 'Never use if x; .... Use the ternary operator instead.'
|
266
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
|
232
267
|
Enabled: true
|
233
268
|
|
234
269
|
Style/IndentationConsistency:
|
@@ -237,6 +272,7 @@ Style/IndentationConsistency:
|
|
237
272
|
|
238
273
|
Style/IndentationWidth:
|
239
274
|
Description: 'Use 2 spaces for indentation.'
|
275
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
|
240
276
|
Enabled: true
|
241
277
|
|
242
278
|
Style/IndentArray:
|
@@ -249,16 +285,24 @@ Style/IndentHash:
|
|
249
285
|
Description: 'Checks the indentation of the first key in a hash literal.'
|
250
286
|
Enabled: true
|
251
287
|
|
288
|
+
Style/InfiniteLoop:
|
289
|
+
Description: 'Use Kernel#loop for infinite loops.'
|
290
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
|
291
|
+
Enabled: true
|
292
|
+
|
252
293
|
Style/Lambda:
|
253
294
|
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
295
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
|
254
296
|
Enabled: true
|
255
297
|
|
256
298
|
Style/LambdaCall:
|
257
299
|
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
300
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
258
301
|
Enabled: true
|
259
302
|
|
260
303
|
Style/LeadingCommentSpace:
|
261
304
|
Description: 'Comments should start with a space.'
|
305
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
|
262
306
|
Enabled: true
|
263
307
|
|
264
308
|
Style/LineEndConcatenation:
|
@@ -269,20 +313,24 @@ Style/LineEndConcatenation:
|
|
269
313
|
|
270
314
|
Style/MethodCallParentheses:
|
271
315
|
Description: 'Do not use parentheses for method calls with no arguments.'
|
316
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
|
272
317
|
Enabled: true
|
273
318
|
|
274
319
|
Style/MethodDefParentheses:
|
275
320
|
Description: >-
|
276
321
|
Checks if the method definitions have or don't have
|
277
322
|
parentheses.
|
323
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
|
278
324
|
Enabled: true
|
279
325
|
|
280
326
|
Style/MethodName:
|
281
327
|
Description: 'Use the configured style when naming methods.'
|
328
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
|
282
329
|
Enabled: true
|
283
330
|
|
284
331
|
Style/ModuleFunction:
|
285
332
|
Description: 'Checks for usage of `extend self` in modules.'
|
333
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
|
286
334
|
Enabled: true
|
287
335
|
|
288
336
|
Style/MultilineBlockChain:
|
@@ -295,68 +343,82 @@ Style/MultilineBlockLayout:
|
|
295
343
|
|
296
344
|
Style/MultilineIfThen:
|
297
345
|
Description: 'Never use then for multi-line if/unless.'
|
346
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
|
298
347
|
Enabled: true
|
299
348
|
|
300
349
|
Style/MultilineTernaryOperator:
|
301
350
|
Description: >-
|
302
351
|
Avoid multi-line ?: (the ternary operator);
|
303
352
|
use if/unless instead.
|
353
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
|
304
354
|
Enabled: true
|
305
355
|
|
306
356
|
Style/NegatedIf:
|
307
357
|
Description: >-
|
308
358
|
Favor unless over if for negative conditions
|
309
359
|
(or control flow or).
|
360
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
310
361
|
Enabled: true
|
311
362
|
|
312
363
|
Style/NegatedWhile:
|
313
364
|
Description: 'Favor until over while for negative conditions.'
|
365
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
|
314
366
|
Enabled: true
|
315
367
|
|
316
368
|
Style/NestedTernaryOperator:
|
317
369
|
Description: 'Use one expression per branch in a ternary operator.'
|
370
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
|
318
371
|
Enabled: true
|
319
372
|
|
320
373
|
Style/Next:
|
321
374
|
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
375
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
322
376
|
Enabled: true
|
323
377
|
|
324
378
|
Style/NilComparison:
|
325
379
|
Description: 'Prefer x.nil? to x == nil.'
|
380
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
326
381
|
Enabled: true
|
327
382
|
|
328
383
|
Style/NonNilCheck:
|
329
384
|
Description: 'Checks for redundant nil checks.'
|
385
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
|
330
386
|
Enabled: true
|
331
387
|
|
332
388
|
Style/Not:
|
333
389
|
Description: 'Use ! instead of not.'
|
390
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
334
391
|
Enabled: true
|
335
392
|
|
336
393
|
Style/NumericLiterals:
|
337
394
|
Description: >-
|
338
395
|
Add underscores to large numeric literals to improve their
|
339
396
|
readability.
|
397
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
340
398
|
Enabled: true
|
341
399
|
|
342
400
|
Style/OneLineConditional:
|
343
401
|
Description: >-
|
344
402
|
Favor the ternary operator(?:) over
|
345
403
|
if/then/else/end constructs.
|
404
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
346
405
|
Enabled: true
|
347
406
|
|
348
407
|
Style/OpMethod:
|
349
408
|
Description: 'When defining binary operators, name the argument other.'
|
409
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
350
410
|
Enabled: true
|
351
411
|
|
352
412
|
Style/ParenthesesAroundCondition:
|
353
413
|
Description: >-
|
354
414
|
Don't use parentheses around the condition of an
|
355
415
|
if/unless/while.
|
416
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
|
356
417
|
Enabled: true
|
357
418
|
|
358
419
|
Style/PercentLiteralDelimiters:
|
359
420
|
Description: 'Use `%`-literal delimiters consistently'
|
421
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
|
360
422
|
Enabled: true
|
361
423
|
|
362
424
|
Style/PercentQLiterals:
|
@@ -365,18 +427,22 @@ Style/PercentQLiterals:
|
|
365
427
|
|
366
428
|
Style/PerlBackrefs:
|
367
429
|
Description: 'Avoid Perl-style regex back references.'
|
430
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
368
431
|
Enabled: true
|
369
432
|
|
370
433
|
Style/PredicateName:
|
371
434
|
Description: 'Check the names of predicate methods.'
|
435
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
372
436
|
Enabled: true
|
373
437
|
|
374
438
|
Style/Proc:
|
375
439
|
Description: 'Use proc instead of Proc.new.'
|
440
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
|
376
441
|
Enabled: true
|
377
442
|
|
378
443
|
Style/RaiseArgs:
|
379
444
|
Description: 'Checks the arguments passed to raise/fail.'
|
445
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
|
380
446
|
Enabled: true
|
381
447
|
|
382
448
|
Style/RedundantBegin:
|
@@ -385,14 +451,17 @@ Style/RedundantBegin:
|
|
385
451
|
|
386
452
|
Style/RedundantException:
|
387
453
|
Description: "Checks for an obsolete RuntimeException argument in raise/fail."
|
454
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
|
388
455
|
Enabled: true
|
389
456
|
|
390
457
|
Style/RedundantReturn:
|
391
458
|
Description: "Don't use return where it's not required."
|
459
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
|
392
460
|
Enabled: true
|
393
461
|
|
394
462
|
Style/RedundantSelf:
|
395
463
|
Description: "Don't use self where it's not needed."
|
464
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
|
396
465
|
Enabled: true
|
397
466
|
|
398
467
|
Style/RegexpLiteral:
|
@@ -401,32 +470,39 @@ Style/RegexpLiteral:
|
|
401
470
|
`MaxSlashes` '/' characters.
|
402
471
|
Use %r only for regular expressions matching more than
|
403
472
|
`MaxSlashes` '/' character.
|
473
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
404
474
|
Enabled: true
|
405
475
|
|
406
476
|
Style/RescueModifier:
|
407
477
|
Description: 'Avoid using rescue in its modifier form.'
|
478
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
|
408
479
|
Enabled: true
|
409
480
|
|
410
481
|
Style/SelfAssignment:
|
411
482
|
Description: >-
|
412
483
|
Checks for places where self-assignment shorthand should have
|
413
484
|
been used.
|
485
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
414
486
|
Enabled: true
|
415
487
|
|
416
488
|
Style/Semicolon:
|
417
489
|
Description: "Don't use semicolons to terminate expressions."
|
490
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
|
418
491
|
Enabled: true
|
419
492
|
|
420
493
|
Style/SignalException:
|
421
494
|
Description: 'Checks for proper usage of fail and raise.'
|
495
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
|
422
496
|
Enabled: true
|
423
497
|
|
424
498
|
Style/SingleLineBlockParams:
|
425
499
|
Description: 'Enforces the names of some block params.'
|
500
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
|
426
501
|
Enabled: true
|
427
502
|
|
428
503
|
Style/SingleLineMethods:
|
429
504
|
Description: 'Avoid single-line methods.'
|
505
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
430
506
|
Enabled: true
|
431
507
|
|
432
508
|
Style/SingleSpaceBeforeFirstArg:
|
@@ -437,10 +513,12 @@ Style/SingleSpaceBeforeFirstArg:
|
|
437
513
|
|
438
514
|
Style/SpaceAfterColon:
|
439
515
|
Description: 'Use spaces after colons.'
|
516
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
440
517
|
Enabled: true
|
441
518
|
|
442
519
|
Style/SpaceAfterComma:
|
443
520
|
Description: 'Use spaces after commas.'
|
521
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
444
522
|
Enabled: true
|
445
523
|
|
446
524
|
Style/SpaceAfterControlKeyword:
|
@@ -451,14 +529,17 @@ Style/SpaceAfterMethodName:
|
|
451
529
|
Description: >-
|
452
530
|
Never put a space between a method name and the opening
|
453
531
|
parenthesis in a method definition.
|
532
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
454
533
|
Enabled: true
|
455
534
|
|
456
535
|
Style/SpaceAfterNot:
|
457
536
|
Description: Tracks redundant space after the ! operator.
|
537
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
|
458
538
|
Enabled: true
|
459
539
|
|
460
540
|
Style/SpaceAfterSemicolon:
|
461
541
|
Description: 'Use spaces after semicolons.'
|
542
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
462
543
|
Enabled: true
|
463
544
|
|
464
545
|
Style/SpaceBeforeBlockBraces:
|
@@ -493,10 +574,12 @@ Style/SpaceAroundEqualsInParameterDefault:
|
|
493
574
|
Checks that the equals signs in parameter default assignments
|
494
575
|
have or don't have surrounding space depending on
|
495
576
|
configuration.
|
577
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
|
496
578
|
Enabled: true
|
497
579
|
|
498
580
|
Style/SpaceAroundOperators:
|
499
581
|
Description: 'Use spaces around operators.'
|
582
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
500
583
|
Enabled: true
|
501
584
|
|
502
585
|
Style/SpaceBeforeModifierKeyword:
|
@@ -505,48 +588,68 @@ Style/SpaceBeforeModifierKeyword:
|
|
505
588
|
|
506
589
|
Style/SpaceInsideBrackets:
|
507
590
|
Description: 'No spaces after [ or before ].'
|
591
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
|
508
592
|
Enabled: true
|
509
593
|
|
510
594
|
Style/SpaceInsideHashLiteralBraces:
|
511
595
|
Description: "Use spaces inside hash literal braces - or don't."
|
596
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
512
597
|
Enabled: true
|
513
598
|
|
514
599
|
Style/SpaceInsideParens:
|
515
600
|
Description: 'No spaces after ( or before ).'
|
601
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
|
602
|
+
Enabled: true
|
603
|
+
|
604
|
+
Style/SpaceInsideRangeLiteral:
|
605
|
+
Description: 'No spaces inside range literals.'
|
606
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
|
516
607
|
Enabled: true
|
517
608
|
|
518
609
|
Style/SpecialGlobalVars:
|
519
610
|
Description: 'Avoid Perl-style global variables.'
|
611
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
|
520
612
|
Enabled: true
|
521
613
|
|
522
614
|
Style/StringLiterals:
|
523
615
|
Description: 'Checks if uses of quotes match the configured preference.'
|
616
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
617
|
+
Enabled: true
|
618
|
+
|
619
|
+
Style/SymbolProc:
|
620
|
+
Description: 'Use symbols as procs instead of blocks when possible.'
|
524
621
|
Enabled: true
|
525
622
|
|
526
623
|
Style/Tab:
|
527
624
|
Description: 'No hard tabs.'
|
625
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
|
528
626
|
Enabled: true
|
529
627
|
|
530
628
|
Style/TrailingBlankLines:
|
531
629
|
Description: 'Checks trailing blank lines and final newline.'
|
630
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
|
532
631
|
Enabled: true
|
533
632
|
|
534
633
|
Style/TrailingComma:
|
535
634
|
Description: 'Checks for trailing comma in parameter lists and literals.'
|
635
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
536
636
|
Enabled: true
|
537
637
|
|
538
638
|
Style/TrailingWhitespace:
|
539
639
|
Description: 'Avoid trailing whitespace.'
|
640
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
|
540
641
|
Enabled: true
|
541
642
|
|
542
643
|
Style/TrivialAccessors:
|
543
644
|
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
645
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
|
544
646
|
Enabled: true
|
545
647
|
|
546
648
|
Style/UnlessElse:
|
547
649
|
Description: >-
|
548
650
|
Never use unless with else. Rewrite these with the positive
|
549
651
|
case first.
|
652
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
|
550
653
|
Enabled: true
|
551
654
|
|
552
655
|
Style/UnneededCapitalW:
|
@@ -555,44 +658,53 @@ Style/UnneededCapitalW:
|
|
555
658
|
|
556
659
|
Style/UnneededPercentQ:
|
557
660
|
Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
|
661
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
|
558
662
|
Enabled: true
|
559
663
|
|
560
664
|
Style/UnneededPercentX:
|
561
665
|
Description: 'Checks for %x when `` would do.'
|
666
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
|
562
667
|
Enabled: true
|
563
668
|
|
564
669
|
Style/VariableInterpolation:
|
565
670
|
Description: >-
|
566
671
|
Don't interpolate global, instance and class variables
|
567
672
|
directly in strings.
|
673
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
|
568
674
|
Enabled: true
|
569
675
|
|
570
676
|
Style/VariableName:
|
571
677
|
Description: 'Use the configured style when naming variables.'
|
678
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
|
572
679
|
Enabled: true
|
573
680
|
|
574
681
|
Style/WhenThen:
|
575
682
|
Description: 'Use when x then ... for one-line cases.'
|
683
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
|
576
684
|
Enabled: true
|
577
685
|
|
578
686
|
Style/WhileUntilDo:
|
579
687
|
Description: 'Checks for redundant do after while or until.'
|
688
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
|
580
689
|
Enabled: true
|
581
690
|
|
582
691
|
Style/WhileUntilModifier:
|
583
692
|
Description: >-
|
584
693
|
Favor modifier while/until usage when you have a
|
585
694
|
single-line body.
|
695
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
586
696
|
Enabled: true
|
587
697
|
|
588
698
|
Style/WordArray:
|
589
699
|
Description: 'Use %w or %W for arrays of words.'
|
700
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
|
590
701
|
Enabled: true
|
591
702
|
|
592
703
|
#################### Metrics ################################
|
593
704
|
|
594
705
|
Metrics/BlockNesting:
|
595
706
|
Description: 'Avoid excessive block nesting'
|
707
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
596
708
|
Enabled: true
|
597
709
|
|
598
710
|
Metrics/ClassLength:
|
@@ -607,14 +719,17 @@ Metrics/CyclomaticComplexity:
|
|
607
719
|
|
608
720
|
Metrics/LineLength:
|
609
721
|
Description: 'Limit lines to 80 characters.'
|
722
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
610
723
|
Enabled: true
|
611
724
|
|
612
725
|
Metrics/MethodLength:
|
613
726
|
Description: 'Avoid methods longer than 10 lines of code.'
|
727
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
614
728
|
Enabled: true
|
615
729
|
|
616
730
|
Metrics/ParameterLists:
|
617
731
|
Description: 'Avoid parameter lists longer than three or four parameters.'
|
732
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
|
618
733
|
Enabled: true
|
619
734
|
|
620
735
|
Metrics/PerceivedComplexity:
|
@@ -630,6 +745,7 @@ Lint/AmbiguousOperator:
|
|
630
745
|
Description: >-
|
631
746
|
Checks for ambiguous operators in the first argument of a
|
632
747
|
method invocation without parentheses.
|
748
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
|
633
749
|
Enabled: true
|
634
750
|
|
635
751
|
Lint/AmbiguousRegexpLiteral:
|
@@ -640,6 +756,7 @@ Lint/AmbiguousRegexpLiteral:
|
|
640
756
|
|
641
757
|
Lint/AssignmentInCondition:
|
642
758
|
Description: "Don't use assignment in conditions."
|
759
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
643
760
|
Enabled: true
|
644
761
|
|
645
762
|
Lint/BlockAlignment:
|
@@ -650,6 +767,7 @@ Lint/ConditionPosition:
|
|
650
767
|
Description: >-
|
651
768
|
Checks for condition placed in a confusing position relative to
|
652
769
|
the keyword.
|
770
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
653
771
|
Enabled: true
|
654
772
|
|
655
773
|
Lint/Debugger:
|
@@ -686,6 +804,7 @@ Lint/EndInMethod:
|
|
686
804
|
|
687
805
|
Lint/EnsureReturn:
|
688
806
|
Description: 'Never use return in an ensure block.'
|
807
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
|
689
808
|
Enabled: true
|
690
809
|
|
691
810
|
Lint/Eval:
|
@@ -694,6 +813,7 @@ Lint/Eval:
|
|
694
813
|
|
695
814
|
Lint/HandleExceptions:
|
696
815
|
Description: "Don't suppress exception."
|
816
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
697
817
|
Enabled: true
|
698
818
|
|
699
819
|
Lint/InvalidCharacterLiteral:
|
@@ -714,12 +834,14 @@ Lint/Loop:
|
|
714
834
|
Description: >-
|
715
835
|
Use Kernel#loop with break rather than begin/end/until or
|
716
836
|
begin/end/while for post-loop tests.
|
837
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
717
838
|
Enabled: true
|
718
839
|
|
719
840
|
Lint/ParenthesesAsGroupedExpression:
|
720
841
|
Description: >-
|
721
842
|
Checks for method calls with a space before the opening
|
722
843
|
parenthesis.
|
844
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
723
845
|
Enabled: true
|
724
846
|
|
725
847
|
Lint/RequireParentheses:
|
@@ -730,6 +852,7 @@ Lint/RequireParentheses:
|
|
730
852
|
|
731
853
|
Lint/RescueException:
|
732
854
|
Description: 'Avoid rescuing the Exception class.'
|
855
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
|
733
856
|
Enabled: true
|
734
857
|
|
735
858
|
Lint/ShadowingOuterLocalVariable:
|
@@ -746,6 +869,7 @@ Lint/SpaceBeforeFirstArg:
|
|
746
869
|
|
747
870
|
Lint/StringConversionInInterpolation:
|
748
871
|
Description: 'Checks for Object#to_s usage in string interpolation.'
|
872
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
|
749
873
|
Enabled: true
|
750
874
|
|
751
875
|
Lint/UnderscorePrefixedVariableName:
|
@@ -754,10 +878,12 @@ Lint/UnderscorePrefixedVariableName:
|
|
754
878
|
|
755
879
|
Lint/UnusedBlockArgument:
|
756
880
|
Description: 'Checks for unused block arguments.'
|
881
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
|
757
882
|
Enabled: true
|
758
883
|
|
759
884
|
Lint/UnusedMethodArgument:
|
760
885
|
Description: 'Checks for unused method arguments.'
|
886
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
|
761
887
|
Enabled: true
|
762
888
|
|
763
889
|
Lint/UnreachableCode:
|
@@ -770,6 +896,7 @@ Lint/UselessAccessModifier:
|
|
770
896
|
|
771
897
|
Lint/UselessAssignment:
|
772
898
|
Description: 'Checks for useless assignment to a local variable.'
|
899
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
|
773
900
|
Enabled: true
|
774
901
|
|
775
902
|
Lint/UselessComparison:
|
@@ -821,5 +948,5 @@ Rails/ScopeArgs:
|
|
821
948
|
Enabled: true
|
822
949
|
|
823
950
|
Rails/Validation:
|
824
|
-
Description: 'Use
|
951
|
+
Description: 'Use validates :attribute, hash of validations.'
|
825
952
|
Enabled: true
|