relaxed-rubocop 2.3.1 → 2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -1
- data/CHANGELOG.md +5 -0
- data/README.md +41 -30
- data/relaxed-rubocop.gemspec +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f03b9d6775a9a566af9637b7afb298704c12d275cd67e0f09299b722d398fe0c
|
4
|
+
data.tar.gz: 2d20b2f246030c919e9381349578066a0716ffb99fb059bfd5de25f7efe737ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 524f1db4ef50b4d000f9fb5415fd12b78f723f5f3a152364ca7bbebd5059a369f11eb43c3bcaec14182d9e2196822de8021c80a899e16d20d3ec025980f78e27
|
7
|
+
data.tar.gz: 65fe4c9d6533015a3a0c34bf0dc675d0fc3d876a906d5b01c0bad11fd8c725a7ac39fa16f8d88f9689191513e9965691fd2d65cb512848cd6369799fad6f5c20
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Relaxed.Ruby.Style
|
2
|
-
## Version 2.
|
2
|
+
## Version 2.4
|
3
3
|
|
4
4
|
Style/Alias:
|
5
5
|
Enabled: false
|
@@ -65,6 +65,10 @@ Style/NegatedWhile:
|
|
65
65
|
Enabled: false
|
66
66
|
StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile
|
67
67
|
|
68
|
+
Style/NumericPredicate:
|
69
|
+
Enabled: false
|
70
|
+
StyleGuide: https://relaxed.ruby.style/#stylenumericpredicate
|
71
|
+
|
68
72
|
Style/ParallelAssignment:
|
69
73
|
Enabled: false
|
70
74
|
StyleGuide: https://relaxed.ruby.style/#styleparallelassignment
|
@@ -121,6 +125,10 @@ Style/TrailingCommaInHashLiteral:
|
|
121
125
|
Enabled: false
|
122
126
|
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral
|
123
127
|
|
128
|
+
Style/SymbolArray:
|
129
|
+
Enabled: false
|
130
|
+
StyleGuide: http://relaxed.ruby.style/#stylesymbolarray
|
131
|
+
|
124
132
|
Style/WhileUntilModifier:
|
125
133
|
Enabled: false
|
126
134
|
StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# [Relaxed Ruby Style](https://relaxed.ruby.style)
|
2
2
|
|
3
|
-
## Version 2.
|
3
|
+
## Version 2.4
|
4
4
|
|
5
|
-
A more liberal style guide for [RuboCop](https://github.com/
|
5
|
+
A more liberal style guide for [RuboCop](https://github.com/rubocop-hq/rubocop). It comes
|
6
6
|
with a [config file](https://relaxed.ruby.style/rubocop.yml) that deactivates some of
|
7
7
|
RuboCop's features. It is meant as a less restrictive foundation that you can use
|
8
8
|
directly or base your style discussions on.
|
@@ -17,7 +17,7 @@ might distract you from the helpful messages.
|
|
17
17
|
### How to Read this Style Guide
|
18
18
|
|
19
19
|
This is not a stand-alone style guide, but a patch applied to
|
20
|
-
[
|
20
|
+
[rubocop-hq/ruby-style-guide](https://github.com/rubocop-hq/ruby-style-guide)
|
21
21
|
(the style guide RuboCop is based on).
|
22
22
|
|
23
23
|
### Usage
|
@@ -41,7 +41,7 @@ And in your `.rubocop.yml`:
|
|
41
41
|
|
42
42
|
### Style/Alias
|
43
43
|
|
44
|
-
[Disabled rule](https://github.com/
|
44
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#alias-method). Feel free to
|
45
45
|
use the `alias` keyword when appropriate.
|
46
46
|
|
47
47
|
### Style/AsciiComments
|
@@ -51,17 +51,17 @@ encoding is UTF-8, you can use UTF-8 characters in comments.
|
|
51
51
|
|
52
52
|
### Style/BeginBlock
|
53
53
|
|
54
|
-
[Disabled rule](https://github.com/
|
54
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#no-BEGIN-blocks). Use `BEGIN`
|
55
55
|
blocks when you need its functionality.
|
56
56
|
|
57
57
|
### Style/BlockDelimiters
|
58
58
|
|
59
|
-
[Disabled rule](https://github.com/
|
59
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#single-line-blocks).
|
60
60
|
Consider [using `{}` for multi-line blocks](https://github.com/chneukirchen/styleguide/blob/e60de37b478d3f892f6985a58d573016f33f0269/RUBY-STYLE#L63-L67).
|
61
61
|
|
62
62
|
### Style/CommentAnnotation
|
63
63
|
|
64
|
-
[Disabled rule](https://github.com/
|
64
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#annotate-keywords). It is
|
65
65
|
totally optional to put a colon and a space behind **TODO**s and **FIXME**s
|
66
66
|
|
67
67
|
### Style/Documentation
|
@@ -71,81 +71,87 @@ method and variable names!
|
|
71
71
|
|
72
72
|
### Layout/DotPosition
|
73
73
|
|
74
|
-
[Disabled rule](https://github.com/
|
74
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#consistent-multi-line-chains).
|
75
75
|
When chaining methods on multiple lines, it is a good idea to put the dots at the end of
|
76
76
|
the lines to indicate that the expression continues on the next line.
|
77
77
|
|
78
78
|
### Style/DoubleNegation
|
79
79
|
|
80
|
-
[Disabled rule](https://github.com/
|
80
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#no-bang-bang). Use `!!variable`
|
81
81
|
to get the boolean value of a variable.
|
82
82
|
|
83
83
|
### Style/EndBlock
|
84
84
|
|
85
|
-
[Disabled rule](https://github.com/
|
85
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#no-END-blocks). Use `END`
|
86
86
|
blocks or `Kernel#at_exit` for code that should be executed when the program quits.
|
87
87
|
|
88
88
|
### Style/FormatString
|
89
89
|
|
90
|
-
[Disabled rule](https://github.com/
|
90
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#sprintf). Creating format
|
91
91
|
string should be done using the [`String#%` method](https://idiosyncratic-ruby.com/49-what-the-format.html).
|
92
92
|
|
93
93
|
### Style/IfUnlessModifier
|
94
94
|
|
95
|
-
[Disabled rule](https://github.com/
|
95
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#if-as-a-modifier). Use or
|
96
96
|
don't use `if`/`unless` in modifier style whenever you think it improves code readability.
|
97
97
|
|
98
98
|
### Style/Lambda
|
99
99
|
|
100
|
-
[Disabled rule](https://github.com/
|
100
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#lambda-multi-line). It does
|
101
101
|
not matter if you use `->(){}` or `lambda{}` to create lambdas.
|
102
102
|
|
103
103
|
### Style/ModuleFunction
|
104
104
|
|
105
|
-
[Disabled rule](https://github.com/
|
105
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#module-function). Prefer
|
106
106
|
`extend self` over `module_function`. It uses Ruby's inheritance chain, instead of
|
107
107
|
copying all methods. Less magic!
|
108
108
|
[More info](https://idiosyncratic-ruby.com/8-self-improvement.html).
|
109
109
|
|
110
110
|
### Style/MultilineBlockChain
|
111
111
|
|
112
|
-
[Disabled rule](https://github.com/
|
112
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#single-line-blocks). Chain
|
113
113
|
multiple blocks when it makes sense, this promotes a functional programming mindset.
|
114
114
|
|
115
115
|
### Style/NegatedIf
|
116
116
|
|
117
|
-
[Disabled rule](https://github.com/
|
117
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#unless-for-negatives). Always
|
118
118
|
use `if !condition` for complex conditions with negations. For simple conditions, for
|
119
119
|
which it also unlikely that an else clause will be added at some later point, it is also
|
120
120
|
OK to use `unless condition`.
|
121
121
|
|
122
122
|
### Style/NegatedWhile
|
123
123
|
|
124
|
-
[Disabled rule](https://github.com/
|
124
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#until-for-negatives). Always
|
125
125
|
use `while !condition` for complex conditions with negations. For simple conditions,
|
126
126
|
it is also OK to use `until condition`.
|
127
127
|
|
128
|
+
### Style/NumericPredicate
|
129
|
+
|
130
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#predicate-methods).
|
131
|
+
Numprical predicates (like `x.negative?`) can be used when it improves code readability,
|
132
|
+
but using explicit comparisons (like `x < 0`) is good, too.
|
133
|
+
|
128
134
|
### Style/ParallelAssignment
|
129
135
|
|
130
|
-
[Disabled rule](https://github.com/
|
136
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#parallel-assignment).
|
131
137
|
Parallel assignment can sometimes express the intented logic better than sequential
|
132
138
|
assignment. It is also [faster](https://github.com/JuanitoFatas/fast-ruby#parallel-assignment-vs-sequential-assignment-code).
|
133
139
|
|
134
140
|
### Style/PercentLiteralDelimiters
|
135
141
|
|
136
|
-
[Disabled rule](https://github.com/
|
142
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#percent-literal-braces). When
|
137
143
|
creating literals with the `%` syntax, choose any delimiters that don't interfere with
|
138
144
|
the literal's content.
|
139
145
|
|
140
146
|
### Style/PerlBackrefs
|
141
147
|
|
142
|
-
[Disabled rule](https://github.com/
|
148
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#no-perl-regexp-last-matchers).
|
143
149
|
It is fine to use the special **local** variables `$1` - `$9` to access the contents of
|
144
150
|
your last matched regex groups.
|
145
151
|
|
146
152
|
### Style/Semicolon
|
147
153
|
|
148
|
-
[Disabled rule](https://github.com/
|
154
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#no-semicolon). Usage of
|
149
155
|
semicolons to separate multiple statements is OK.
|
150
156
|
|
151
157
|
### Style/SignalException
|
@@ -159,7 +165,7 @@ exceptions with `raise` or `fail`.
|
|
159
165
|
|
160
166
|
### Style/SingleLineMethods
|
161
167
|
|
162
|
-
[Disabled rule](https://github.com/
|
168
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#no-single-line-methods).
|
163
169
|
Single-line methods can be useful for short getter- or setter-like methods, when
|
164
170
|
`attr_reader` / `attr_accessor` / `attr_writer` are not enough anymore.
|
165
171
|
|
@@ -169,30 +175,35 @@ It is not important if there is a space between a method call and a passed block
|
|
169
175
|
|
170
176
|
### Layout/SpaceInsideParens
|
171
177
|
|
172
|
-
[Disabled rule](https://github.com/
|
178
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#no-spaces-braces). Avoid
|
173
179
|
putting spaces inside parentheses, but do it when it improves readability.
|
174
180
|
For example, when using RSpec's `expect` method.
|
175
181
|
|
176
182
|
### Style/SpecialGlobalVars
|
177
183
|
|
178
|
-
[Disabled rule](https://github.com/
|
184
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#no-cryptic-perlisms).
|
179
185
|
Refering to [two-letter version of special global variables](https://idiosyncratic-ruby.com/9-globalization.html#list-of-all-special-global-variables) is OK, although not very polite.
|
180
186
|
|
181
187
|
### Style/StringLiterals
|
182
188
|
|
183
|
-
[Disabled rule](https://github.com/
|
189
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#consistent-string-literals).
|
184
190
|
Deliberately use single or double quoted strings!
|
185
191
|
|
186
192
|
### Style/TrailingCommaInArguments
|
187
193
|
|
188
|
-
[Disabled rule](https://github.com/
|
194
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#no-trailing-params-comma).
|
189
195
|
Use trailing commas in multi-line argument lists. It makes manipulating the params easier
|
190
196
|
(reordering, appending, removing) and leads to smaller git diffs. Consider using RuboCop's
|
191
197
|
`EnforcedStyleForMultiline: consistent_comma` option.
|
192
198
|
|
199
|
+
### Style/SymbolArray
|
200
|
+
|
201
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#percent-i). You can use the
|
202
|
+
`%i` syntax for an array of symbols, but usage of an array of symbols is fine, too.
|
203
|
+
|
193
204
|
### Style/TrailingCommaInLiteral
|
194
205
|
|
195
|
-
[Disabled rule](https://github.com/
|
206
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#no-trailing-array-commas).
|
196
207
|
Use trailing commas in multi-line literals. It makes manipulating the literal easier
|
197
208
|
(reordering, appending, removing) and leads to smaller git diffs. Consider using RuboCop's
|
198
209
|
`EnforcedStyleForMultiline: consistent_comma` option.
|
@@ -206,7 +217,7 @@ to use.
|
|
206
217
|
|
207
218
|
### Style/WhileUntilModifier
|
208
219
|
|
209
|
-
[Disabled rule](https://github.com/
|
220
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#while-as-a-modifier). Use or
|
210
221
|
don't use `while`/`until` in modifier style whenever you think it improves code
|
211
222
|
readability.
|
212
223
|
|
@@ -216,7 +227,7 @@ Use regex normally.
|
|
216
227
|
|
217
228
|
### Lint/AssignmentInCondition
|
218
229
|
|
219
|
-
[Disabled rule](https://github.com/
|
230
|
+
[Disabled rule](https://github.com/rubocop-hq/ruby-style-guide#safe-assignment-in-condition).
|
220
231
|
Use `=` for assignments in conditions. Use `==` for comparisons in conditions.
|
221
232
|
|
222
233
|
### Metrics
|
@@ -228,7 +239,7 @@ be discussed, tweaked and activated individually.
|
|
228
239
|
|
229
240
|
* [Leah Neukirchen](https://github.com/chneukirchen/styleguide/blob/master/RUBY-STYLE)
|
230
241
|
* [Fast Ruby](https://github.com/JuanitoFatas/fast-ruby)
|
231
|
-
* [Ruby Style Guide (
|
242
|
+
* [Ruby Style Guide (RuboCop)](https://github.com/rubocop-hq/ruby-style-guide/)
|
232
243
|
* [GitHub](https://github.com/styleguide/ruby)
|
233
244
|
* [Airbnb](https://github.com/airbnb/ruby)
|
234
245
|
* [Shopify](https://shopify.github.io/ruby-style-guide/)
|
data/relaxed-rubocop.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "relaxed-rubocop"
|
5
|
-
gem.version = "2.
|
5
|
+
gem.version = "2.4"
|
6
6
|
gem.summary = "A relaxed style guide for RuboCop"
|
7
7
|
gem.description = "A relaxed style guide for RuboCop. Although RuboCop is an amazing tool, some of its default rules feel overly strict. This might distract you from the helpful messages."
|
8
8
|
gem.authors = ["Jan Lelis"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaxed-rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: '2.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A relaxed style guide for RuboCop. Although RuboCop is an amazing tool,
|
14
14
|
some of its default rules feel overly strict. This might distract you from the helpful
|
@@ -43,8 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '0'
|
45
45
|
requirements: []
|
46
|
-
|
47
|
-
rubygems_version: 2.7.6
|
46
|
+
rubygems_version: 3.0.3
|
48
47
|
signing_key:
|
49
48
|
specification_version: 4
|
50
49
|
summary: A relaxed style guide for RuboCop
|