relaxed-rubocop 2.3

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d82790bc19a292c1e3e1b28c9532ee04f1ef950f1640c20312cdcda73ee75348
4
+ data.tar.gz: 5d5313bc2629e3683e3244bab2430ab8ed983cf53594e18b76c9d19329a91778
5
+ SHA512:
6
+ metadata.gz: e4e31d5ceae30ece1075706b054712c810c7d2ae32ac4edd896b80b2811aeec0bee4c02240d85e95f2592d1924dcd142ec87ba31ba8892949547bc68b1a4cbc4
7
+ data.tar.gz: cf22f0f795676b2c2a075fa17d3532578204f2e2e23ac8d3c1ee087b7a80a3e939d219690bf43c3ef71ee7140f43f4e1743d4117eafc1d0c91d74db4fabb3bae
data/.rubocop.yml ADDED
@@ -0,0 +1,166 @@
1
+ # Relaxed.Ruby.Style
2
+ ## Version 2.2
3
+
4
+ Style/Alias:
5
+ Enabled: false
6
+ StyleGuide: https://relaxed.ruby.style/#stylealias
7
+
8
+ Style/AsciiComments:
9
+ Enabled: false
10
+ StyleGuide: https://relaxed.ruby.style/#styleasciicomments
11
+
12
+ Style/BeginBlock:
13
+ Enabled: false
14
+ StyleGuide: https://relaxed.ruby.style/#stylebeginblock
15
+
16
+ Style/BlockDelimiters:
17
+ Enabled: false
18
+ StyleGuide: https://relaxed.ruby.style/#styleblockdelimiters
19
+
20
+ Style/CommentAnnotation:
21
+ Enabled: false
22
+ StyleGuide: https://relaxed.ruby.style/#stylecommentannotation
23
+
24
+ Style/Documentation:
25
+ Enabled: false
26
+ StyleGuide: https://relaxed.ruby.style/#styledocumentation
27
+
28
+ Layout/DotPosition:
29
+ Enabled: false
30
+ StyleGuide: https://relaxed.ruby.style/#layoutdotposition
31
+
32
+ Style/DoubleNegation:
33
+ Enabled: false
34
+ StyleGuide: https://relaxed.ruby.style/#styledoublenegation
35
+
36
+ Style/EndBlock:
37
+ Enabled: false
38
+ StyleGuide: https://relaxed.ruby.style/#styleendblock
39
+
40
+ Style/FormatString:
41
+ Enabled: false
42
+ StyleGuide: https://relaxed.ruby.style/#styleformatstring
43
+
44
+ Style/IfUnlessModifier:
45
+ Enabled: false
46
+ StyleGuide: https://relaxed.ruby.style/#styleifunlessmodifier
47
+
48
+ Style/Lambda:
49
+ Enabled: false
50
+ StyleGuide: https://relaxed.ruby.style/#stylelambda
51
+
52
+ Style/ModuleFunction:
53
+ Enabled: false
54
+ StyleGuide: https://relaxed.ruby.style/#stylemodulefunction
55
+
56
+ Style/MultilineBlockChain:
57
+ Enabled: false
58
+ StyleGuide: https://relaxed.ruby.style/#stylemultilineblockchain
59
+
60
+ Style/NegatedIf:
61
+ Enabled: false
62
+ StyleGuide: https://relaxed.ruby.style/#stylenegatedif
63
+
64
+ Style/NegatedWhile:
65
+ Enabled: false
66
+ StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile
67
+
68
+ Style/ParallelAssignment:
69
+ Enabled: false
70
+ StyleGuide: https://relaxed.ruby.style/#styleparallelassignment
71
+
72
+ Style/PercentLiteralDelimiters:
73
+ Enabled: false
74
+ StyleGuide: https://relaxed.ruby.style/#stylepercentliteraldelimiters
75
+
76
+ Style/PerlBackrefs:
77
+ Enabled: false
78
+ StyleGuide: https://relaxed.ruby.style/#styleperlbackrefs
79
+
80
+ Style/Semicolon:
81
+ Enabled: false
82
+ StyleGuide: https://relaxed.ruby.style/#stylesemicolon
83
+
84
+ Style/SignalException:
85
+ Enabled: false
86
+ StyleGuide: https://relaxed.ruby.style/#stylesignalexception
87
+
88
+ Style/SingleLineBlockParams:
89
+ Enabled: false
90
+ StyleGuide: https://relaxed.ruby.style/#stylesinglelineblockparams
91
+
92
+ Style/SingleLineMethods:
93
+ Enabled: false
94
+ StyleGuide: https://relaxed.ruby.style/#stylesinglelinemethods
95
+
96
+ Layout/SpaceBeforeBlockBraces:
97
+ Enabled: false
98
+ StyleGuide: https://relaxed.ruby.style/#layoutspacebeforeblockbraces
99
+
100
+ Layout/SpaceInsideParens:
101
+ Enabled: false
102
+ StyleGuide: https://relaxed.ruby.style/#layoutspaceinsideparens
103
+
104
+ Style/SpecialGlobalVars:
105
+ Enabled: false
106
+ StyleGuide: https://relaxed.ruby.style/#stylespecialglobalvars
107
+
108
+ Style/StringLiterals:
109
+ Enabled: false
110
+ StyleGuide: https://relaxed.ruby.style/#stylestringliterals
111
+
112
+ Style/TrailingCommaInArguments:
113
+ Enabled: false
114
+ StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarguments
115
+
116
+ Style/TrailingCommaInArrayLiteral:
117
+ Enabled: false
118
+ StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarrayliteral
119
+
120
+ Style/TrailingCommaInHashLiteral:
121
+ Enabled: false
122
+ StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral
123
+
124
+ Style/WhileUntilModifier:
125
+ Enabled: false
126
+ StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier
127
+
128
+ Style/WordArray:
129
+ Enabled: false
130
+ StyleGuide: https://relaxed.ruby.style/#stylewordarray
131
+
132
+ Lint/AmbiguousRegexpLiteral:
133
+ Enabled: false
134
+ StyleGuide: https://relaxed.ruby.style/#lintambiguousregexpliteral
135
+
136
+ Lint/AssignmentInCondition:
137
+ Enabled: false
138
+ StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition
139
+
140
+ Metrics/AbcSize:
141
+ Enabled: false
142
+
143
+ Metrics/BlockNesting:
144
+ Enabled: false
145
+
146
+ Metrics/ClassLength:
147
+ Enabled: false
148
+
149
+ Metrics/ModuleLength:
150
+ Enabled: false
151
+
152
+ Metrics/CyclomaticComplexity:
153
+ Enabled: false
154
+
155
+ Metrics/LineLength:
156
+ Enabled: false
157
+
158
+ Metrics/MethodLength:
159
+ Enabled: false
160
+
161
+ Metrics/ParameterLists:
162
+ Enabled: false
163
+
164
+ Metrics/PerceivedComplexity:
165
+ Enabled: false
166
+
data/CHANGELOG.md ADDED
@@ -0,0 +1,33 @@
1
+ # Change Log
2
+
3
+ ## Version 2.3
4
+
5
+ - Use HTTPS links everywhere
6
+ - First gem release
7
+
8
+ ## Version 2.2
9
+
10
+ - Style/TrailingCommaInLiteral split into:
11
+ - Style/TrailingCommaInArrayLiteral
12
+ - Style/TrailingCommaInHashLiteral:
13
+
14
+ ## Version 2.1
15
+
16
+ - Style/DotPosition -> Layout/DotPosition
17
+ - Style/SpaceBeforeBlockBraces -> Layout/SpaceBeforeBlockBraces
18
+ - Style/SpaceInsideParens -> Layout/SpaceInsideParens
19
+
20
+ ## Version 2.0
21
+
22
+ - Disable Style/AsciiComments
23
+ - Disable Style/CommentAnnotation
24
+ - Disable Style/TrailingCommaInArguments
25
+ - Disable Style/WordArray
26
+
27
+ ## Version 1.1
28
+
29
+ - TrailingComma -> TrailingCommaInLiteral
30
+
31
+ ## Version 1.0
32
+
33
+ - Initial Release
data/README.md ADDED
@@ -0,0 +1,239 @@
1
+ # [Relaxed Ruby Style](https://relaxed.ruby.style)
2
+
3
+ ## Version 2.3
4
+
5
+ A more liberal style guide for [RuboCop](https://github.com/bbatsov/rubocop). It comes
6
+ with a [config file](https://relaxed.ruby.style/rubocop.yml) that deactivates some of
7
+ RuboCop's features. It is meant as a less restrictive foundation that you can use
8
+ directly or base your style discussions on.
9
+
10
+ ### Motivation
11
+
12
+ RuboCop is an amazing tool, still some of its default rules feel overly strict. This
13
+ might distract you from the helpful messages.
14
+
15
+ **Warning:** Does include opinionated style advice.
16
+
17
+ ### How to Read this Style Guide
18
+
19
+ This is not a stand-alone style guide, but a patch applied to
20
+ [bbatsov/ruby-style-guide](https://github.com/bbatsov/ruby-style-guide)
21
+ (the style guide RuboCop is based on).
22
+
23
+ ### Usage
24
+
25
+ Use, copy or inherit from [rubocop.yml](https://relaxed.ruby.style/rubocop.yml).
26
+ One way is to add the following lines to your `.rubocop.yml`:
27
+
28
+ inherit_from:
29
+ - https://relaxed.ruby.style/rubocop.yml
30
+
31
+ You could also get the styleguide via rubygems. Add to your `Gemfile`:
32
+
33
+ gem "relaxed-rubocop"
34
+
35
+ And in your `.rubocop.yml`:
36
+
37
+ inherit_gem:
38
+ relaxed-rubocop: .rubocop.yml
39
+
40
+ ## Disabled Cops & Relaxed Style Recommendations
41
+
42
+ ### Style/Alias
43
+
44
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#alias-method). Feel free to
45
+ use the `alias` keyword when appropriate.
46
+
47
+ ### Style/AsciiComments
48
+
49
+ You are free to use your source encoding in code comments. For example, if your source
50
+ encoding is UTF-8, you can use UTF-8 characters in comments.
51
+
52
+ ### Style/BeginBlock
53
+
54
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks). Use `BEGIN`
55
+ blocks when you need its functionality.
56
+
57
+ ### Style/BlockDelimiters
58
+
59
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#single-line-blocks).
60
+ Consider [using `{}` for multi-line blocks](https://github.com/chneukirchen/styleguide/blob/e60de37b478d3f892f6985a58d573016f33f0269/RUBY-STYLE#L63-L67).
61
+
62
+ ### Style/CommentAnnotation
63
+
64
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#annotate-keywords). It is
65
+ totally optional to put a colon and a space behind **TODO**s and **FIXME**s
66
+
67
+ ### Style/Documentation
68
+
69
+ Document your code and/or write a good ReadMe. And good specs. Choose descriptive
70
+ method and variable names!
71
+
72
+ ### Layout/DotPosition
73
+
74
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains).
75
+ When chaining methods on multiple lines, it is a good idea to put the dots at the end of
76
+ the lines to indicate that the expression continues on the next line.
77
+
78
+ ### Style/DoubleNegation
79
+
80
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#no-bang-bang). Use `!!variable`
81
+ to get the boolean value of a variable.
82
+
83
+ ### Style/EndBlock
84
+
85
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#no-END-blocks). Use `END`
86
+ blocks or `Kernel#at_exit` for code that should be executed when the program quits.
87
+
88
+ ### Style/FormatString
89
+
90
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#sprintf). Creating format
91
+ string should be done using the [`String#%` method](https://idiosyncratic-ruby.com/49-what-the-format.html).
92
+
93
+ ### Style/IfUnlessModifier
94
+
95
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier). Use or
96
+ don't use `if`/`unless` in modifier style whenever you think it improves code readability.
97
+
98
+ ### Style/Lambda
99
+
100
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#lambda-multi-line). It does
101
+ not matter if you use `->(){}` or `lambda{}` to create lambdas.
102
+
103
+ ### Style/ModuleFunction
104
+
105
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#module-function). Prefer
106
+ `extend self` over `module_function`. It uses Ruby's inheritance chain, instead of
107
+ copying all methods. Less magic!
108
+ [More info](https://idiosyncratic-ruby.com/8-self-improvement.html).
109
+
110
+ ### Style/MultilineBlockChain
111
+
112
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#single-line-blocks). Chain
113
+ multiple blocks when it makes sense, this promotes a functional programming mindset.
114
+
115
+ ### Style/NegatedIf
116
+
117
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#unless-for-negatives). Always
118
+ use `if !condition` for complex conditions with negations. For simple conditions, for
119
+ which it also unlikely that an else clause will be added at some later point, it is also
120
+ OK to use `unless condition`.
121
+
122
+ ### Style/NegatedWhile
123
+
124
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#until-for-negatives). Always
125
+ use `while !condition` for complex conditions with negations. For simple conditions,
126
+ it is also OK to use `until condition`.
127
+
128
+ ### Style/ParallelAssignment
129
+
130
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#parallel-assignment).
131
+ Parallel assignment can sometimes express the intented logic better than sequential
132
+ assignment. It is also [faster](https://github.com/JuanitoFatas/fast-ruby#parallel-assignment-vs-sequential-assignment-code).
133
+
134
+ ### Style/PercentLiteralDelimiters
135
+
136
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#percent-literal-braces). When
137
+ creating literals with the `%` syntax, choose any delimiters that don't interfere with
138
+ the literal's content.
139
+
140
+ ### Style/PerlBackrefs
141
+
142
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers).
143
+ It is fine to use the special **local** variables `$1` - `$9` to access the contents of
144
+ your last matched regex groups.
145
+
146
+ ### Style/Semicolon
147
+
148
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#no-semicolon). Usage of
149
+ semicolons to separate multiple statements is OK.
150
+
151
+ ### Style/SignalException
152
+
153
+ *(Dropped from RuboCop style guide)*. You are free to choose if you want to raise
154
+ exceptions with `raise` or `fail`.
155
+
156
+ ### Style/SingleLineBlockParams
157
+
158
+ *(Dropped from RuboCop style guide)*. Don't give your block parameters bad names.
159
+
160
+ ### Style/SingleLineMethods
161
+
162
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#no-single-line-methods).
163
+ Single-line methods can be useful for short getter- or setter-like methods, when
164
+ `attr_reader` / `attr_accessor` / `attr_writer` are not enough anymore.
165
+
166
+ ### Layout/SpaceBeforeBlockBraces
167
+
168
+ It is not important if there is a space between a method call and a passed block.
169
+
170
+ ### Layout/SpaceInsideParens
171
+
172
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#no-spaces-braces). Avoid
173
+ putting spaces inside parentheses, but do it when it improves readability.
174
+ For example, when using RSpec's `expect` method.
175
+
176
+ ### Style/SpecialGlobalVars
177
+
178
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms).
179
+ 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
+
181
+ ### Style/StringLiterals
182
+
183
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#consistent-string-literals).
184
+ Deliberately use single or double quoted strings!
185
+
186
+ ### Style/TrailingCommaInArguments
187
+
188
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma).
189
+ Use trailing commas in multi-line argument lists. It makes manipulating the params easier
190
+ (reordering, appending, removing) and leads to smaller git diffs. Consider using RuboCop's
191
+ `EnforcedStyleForMultiline: consistent_comma` option.
192
+
193
+ ### Style/TrailingCommaInLiteral
194
+
195
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas).
196
+ Use trailing commas in multi-line literals. It makes manipulating the literal easier
197
+ (reordering, appending, removing) and leads to smaller git diffs. Consider using RuboCop's
198
+ `EnforcedStyleForMultiline: consistent_comma` option.
199
+
200
+ ### Style/WordArray
201
+
202
+ [Word arrays using the percent syntax](https://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Literals#The_.25_Notation)
203
+ make for a good and concise way to create an array of strings, especially if creating lots
204
+ of strings. However, it it should be considered a good option, instead of being mandatory
205
+ to use.
206
+
207
+ ### Style/WhileUntilModifier
208
+
209
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier). Use or
210
+ don't use `while`/`until` in modifier style whenever you think it improves code
211
+ readability.
212
+
213
+ ### Lint/AmbiguousRegexpLiteral
214
+
215
+ Use regex normally.
216
+
217
+ ### Lint/AssignmentInCondition
218
+
219
+ [Disabled rule](https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition).
220
+ Use `=` for assignments in conditions. Use `==` for comparisons in conditions.
221
+
222
+ ### Metrics
223
+
224
+ RuboCop's code complexity metrics can be very useful indications, however, they should
225
+ be discussed, tweaked and activated individually.
226
+
227
+ ## Other Ruby Style Guides
228
+
229
+ * [Leah Neukirchen](https://github.com/chneukirchen/styleguide/blob/master/RUBY-STYLE)
230
+ * [Fast Ruby](https://github.com/JuanitoFatas/fast-ruby)
231
+ * [Ruby Style Guide (Rubocop)](https://github.com/bbatsov/ruby-style-guide/)
232
+ * [GitHub](https://github.com/styleguide/ruby)
233
+ * [Airbnb](https://github.com/airbnb/ruby)
234
+ * [Shopify](https://shopify.github.io/ruby-style-guide/)
235
+
236
+ ## Also See
237
+
238
+ * [Idiosyncratic Ruby](https://idiosyncratic-ruby.com)
239
+ * [Standard Gems](https://stdgems.org)
data/Rakefile ADDED
@@ -0,0 +1,21 @@
1
+ # # #
2
+ # Get gemspec info
3
+
4
+ gemspec_file = Dir["*.gemspec"].first
5
+ gemspec = eval File.read(gemspec_file), binding, gemspec_file
6
+ info = "#{gemspec.name} | #{gemspec.version} | " \
7
+ "#{gemspec.runtime_dependencies.size} dependencies | " \
8
+ "#{gemspec.files.size} files"
9
+
10
+ # # #
11
+ # Gem build and install task
12
+
13
+ desc info
14
+ task :gem do
15
+ puts info + "\n\n"
16
+ print " "; sh "gem build #{gemspec_file}"
17
+ FileUtils.mkdir_p "pkg"
18
+ FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "pkg"
19
+ puts; sh %{gem install --no-document pkg/#{gemspec.name}-#{gemspec.version}.gem}
20
+ end
21
+
@@ -0,0 +1,17 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |gem|
4
+ gem.name = "relaxed-rubocop"
5
+ gem.version = "2.3"
6
+ gem.summary = "A relaxed style guide for RuboCop"
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
+ gem.authors = ["Jan Lelis"]
9
+ gem.email = ["mail@janlelis.de"]
10
+ gem.homepage = "https://github.com/janlelis/relaxed-rubocop"
11
+ gem.license = "MIT"
12
+
13
+ gem.files = Dir["{**/}{.*,*}"].select{ |path| File.file?(path) && path !~ /^(?:pkg|build)/ }
14
+ gem.require_paths = ["lib"]
15
+
16
+ gem.required_ruby_version = "~> 2.0"
17
+ end
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: relaxed-rubocop
3
+ version: !ruby/object:Gem::Version
4
+ version: '2.3'
5
+ platform: ruby
6
+ authors:
7
+ - Jan Lelis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-05-11 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A relaxed style guide for RuboCop. Although RuboCop is an amazing tool,
14
+ some of its default rules feel overly strict. This might distract you from the helpful
15
+ messages.
16
+ email:
17
+ - mail@janlelis.de
18
+ executables: []
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - ".rubocop.yml"
23
+ - CHANGELOG.md
24
+ - README.md
25
+ - Rakefile
26
+ - relaxed-rubocop.gemspec
27
+ homepage: https://github.com/janlelis/relaxed-rubocop
28
+ licenses:
29
+ - MIT
30
+ metadata: {}
31
+ post_install_message:
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubyforge_project:
47
+ rubygems_version: 2.7.6
48
+ signing_key:
49
+ specification_version: 4
50
+ summary: A relaxed style guide for RuboCop
51
+ test_files: []