gatemedia_rubocop 0.1.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.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +34 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/config/.rubocop.yml +605 -0
- data/gatemedia_rubocop.gemspec +23 -0
- data/lib/gatemedia_rubocop/version.rb +3 -0
- data/lib/gatemedia_rubocop.rb +4 -0
- metadata +83 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 26e41b13ebb2e15c4a087a86c436cd24befedb90
|
4
|
+
data.tar.gz: 4219a2d07733c4956034103b5c40f31d5a93fccd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2edbafb31ac58835505b926f0895d187ac3161912584f742002921a28f7cc2e26a73a263b51f55cd0af04a30231dced778fa255d5074215922fe8b4eb073a22f
|
7
|
+
data.tar.gz: cb5182173979ff3b47c8c57c11ede88cc9e04a6b16553341b4d1cbd5449833c593320083d42b9f066ea3e65b36e07f74f3721950ab919ea7790abec24d26c944
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Ben Colon
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# GatemediaRubocop
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'gatemedia_rubocop'
|
9
|
+
```
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install gatemedia_rubocop
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Add a `.rubocop.yml` file at the root of your project with these lines :
|
22
|
+
|
23
|
+
```
|
24
|
+
inherit_gem:
|
25
|
+
gatemedia_rubocop: config/.rubocop.yml
|
26
|
+
```
|
27
|
+
|
28
|
+
## Contributing
|
29
|
+
|
30
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/gatemedia/gatemedia_rubocop.
|
31
|
+
|
32
|
+
## License
|
33
|
+
|
34
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "gatemedia_rubocop"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/config/.rubocop.yml
ADDED
@@ -0,0 +1,605 @@
|
|
1
|
+
# Common configuration.
|
2
|
+
AllCops:
|
3
|
+
# Include gemspec and Rakefile
|
4
|
+
Include:
|
5
|
+
- '**/*.gemspec'
|
6
|
+
- '**/*.podspec'
|
7
|
+
- '**/*.jbuilder'
|
8
|
+
- '**/*.rake'
|
9
|
+
- '**/*.opal'
|
10
|
+
- '**/Gemfile'
|
11
|
+
- '**/Rakefile'
|
12
|
+
- '**/Capfile'
|
13
|
+
- '**/Guardfile'
|
14
|
+
- '**/Podfile'
|
15
|
+
- '**/Thorfile'
|
16
|
+
- '**/Vagrantfile'
|
17
|
+
- '**/Berksfile'
|
18
|
+
- '**/Cheffile'
|
19
|
+
- '**/Vagabondfile'
|
20
|
+
Exclude:
|
21
|
+
- 'vendor/**/*'
|
22
|
+
- 'tmp/**/*'
|
23
|
+
- 'db/schema.rb'
|
24
|
+
# By default, the rails cops are not run. Override in project or home
|
25
|
+
# directory .rubocop.yml files, or by giving the -R/--rails option.
|
26
|
+
RunRailsCops: true
|
27
|
+
|
28
|
+
# Indent private/protected/public as deep as method definitions
|
29
|
+
Style/AccessModifierIndentation:
|
30
|
+
EnforcedStyle: indent
|
31
|
+
SupportedStyles:
|
32
|
+
- outdent
|
33
|
+
- indent
|
34
|
+
|
35
|
+
# Align the elements of a hash literal if they span more than one line.
|
36
|
+
Style/AlignHash:
|
37
|
+
# Alignment of entries using hash rocket as separator. Valid values are:
|
38
|
+
#
|
39
|
+
# key - left alignment of keys
|
40
|
+
# 'a' => 2
|
41
|
+
# 'bb' => 3
|
42
|
+
# separator - alignment of hash rockets, keys are right aligned
|
43
|
+
# 'a' => 2
|
44
|
+
# 'bb' => 3
|
45
|
+
# table - left alignment of keys, hash rockets, and values
|
46
|
+
# 'a' => 2
|
47
|
+
# 'bb' => 3
|
48
|
+
EnforcedHashRocketStyle: key
|
49
|
+
# Alignment of entries using colon as separator. Valid values are:
|
50
|
+
#
|
51
|
+
# key - left alignment of keys
|
52
|
+
# a: 0
|
53
|
+
# bb: 1
|
54
|
+
# separator - alignment of colons, keys are right aligned
|
55
|
+
# a: 0
|
56
|
+
# bb: 1
|
57
|
+
# table - left alignment of keys and values
|
58
|
+
# a: 0
|
59
|
+
# bb: 1
|
60
|
+
EnforcedColonStyle: key
|
61
|
+
# Select whether hashes that are the last argument in a method call should be
|
62
|
+
# inspected? Valid values are:
|
63
|
+
#
|
64
|
+
# always_inspect - Inspect both implicit and explicit hashes.
|
65
|
+
# Registers an offense for:
|
66
|
+
# function(a: 1,
|
67
|
+
# b: 2)
|
68
|
+
# Registers an offense for:
|
69
|
+
# function({a: 1,
|
70
|
+
# b: 2})
|
71
|
+
# always_ignore - Ignore both implicit and explicit hashes.
|
72
|
+
# Accepts:
|
73
|
+
# function(a: 1,
|
74
|
+
# b: 2)
|
75
|
+
# Accepts:
|
76
|
+
# function({a: 1,
|
77
|
+
# b: 2})
|
78
|
+
# ignore_implicit - Ignore only implicit hashes.
|
79
|
+
# Accepts:
|
80
|
+
# function(a: 1,
|
81
|
+
# b: 2)
|
82
|
+
# Registers an offense for:
|
83
|
+
# function({a: 1,
|
84
|
+
# b: 2})
|
85
|
+
# ignore_explicit - Ignore only explicit hashes.
|
86
|
+
# Accepts:
|
87
|
+
# function({a: 1,
|
88
|
+
# b: 2})
|
89
|
+
# Registers an offense for:
|
90
|
+
# function(a: 1,
|
91
|
+
# b: 2)
|
92
|
+
EnforcedLastArgumentHashStyle: always_inspect
|
93
|
+
SupportedLastArgumentHashStyles:
|
94
|
+
- always_inspect
|
95
|
+
- always_ignore
|
96
|
+
- ignore_implicit
|
97
|
+
- ignore_explicit
|
98
|
+
|
99
|
+
Style/AlignParameters:
|
100
|
+
# Alignment of parameters in multi-line method calls.
|
101
|
+
#
|
102
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
103
|
+
# column as the first parameter.
|
104
|
+
#
|
105
|
+
# method_call(a,
|
106
|
+
# b)
|
107
|
+
#
|
108
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
109
|
+
# level of indentation relative to the start of the line with the method call.
|
110
|
+
#
|
111
|
+
# method_call(a,
|
112
|
+
# b)
|
113
|
+
EnforcedStyle: with_first_parameter
|
114
|
+
SupportedStyles:
|
115
|
+
- with_first_parameter
|
116
|
+
- with_fixed_indentation
|
117
|
+
|
118
|
+
Style/AndOr:
|
119
|
+
# Whether `and` and `or` are banned only in conditionals (conditionals)
|
120
|
+
# or completely (always).
|
121
|
+
EnforcedStyle: always
|
122
|
+
SupportedStyles:
|
123
|
+
- always
|
124
|
+
- conditionals
|
125
|
+
|
126
|
+
|
127
|
+
# Checks if usage of %() or %Q() matches configuration.
|
128
|
+
Style/BarePercentLiterals:
|
129
|
+
EnforcedStyle: bare_percent
|
130
|
+
SupportedStyles:
|
131
|
+
- percent_q
|
132
|
+
- bare_percent
|
133
|
+
|
134
|
+
Style/BracesAroundHashParameters:
|
135
|
+
EnforcedStyle: no_braces
|
136
|
+
SupportedStyles:
|
137
|
+
- braces
|
138
|
+
- no_braces
|
139
|
+
|
140
|
+
# Indentation of `when`.
|
141
|
+
Style/CaseIndentation:
|
142
|
+
IndentWhenRelativeTo: case
|
143
|
+
SupportedStyles:
|
144
|
+
- case
|
145
|
+
- end
|
146
|
+
IndentOneStep: false
|
147
|
+
|
148
|
+
Style/ClassAndModuleChildren:
|
149
|
+
# Checks the style of children definitions at classes and modules.
|
150
|
+
#
|
151
|
+
# Basically there are two different styles:
|
152
|
+
#
|
153
|
+
# `nested` - have each child on a separate line
|
154
|
+
# class Foo
|
155
|
+
# class Bar
|
156
|
+
# end
|
157
|
+
# end
|
158
|
+
#
|
159
|
+
# `compact` - combine definitions as much as possible
|
160
|
+
# class Foo::Bar
|
161
|
+
# end
|
162
|
+
#
|
163
|
+
# The compact style is only forced, for classes / modules with one child.
|
164
|
+
EnforcedStyle: nested
|
165
|
+
SupportedStyles:
|
166
|
+
- nested
|
167
|
+
- compact
|
168
|
+
|
169
|
+
Style/ClassCheck:
|
170
|
+
EnforcedStyle: is_a?
|
171
|
+
SupportedStyles:
|
172
|
+
- is_a?
|
173
|
+
- kind_of?
|
174
|
+
|
175
|
+
# Align with the style guide.
|
176
|
+
Style/CollectionMethods:
|
177
|
+
# Mapping from undesired method to desired_method
|
178
|
+
# e.g. to use `detect` over `find`:
|
179
|
+
#
|
180
|
+
# CollectionMethods:
|
181
|
+
# PreferredMethods:
|
182
|
+
# find: detect
|
183
|
+
PreferredMethods:
|
184
|
+
collect: 'map'
|
185
|
+
collect!: 'map!'
|
186
|
+
inject: 'reduce'
|
187
|
+
detect: 'find'
|
188
|
+
find_all: 'select'
|
189
|
+
|
190
|
+
# Checks formatting of special comments
|
191
|
+
Style/CommentAnnotation:
|
192
|
+
Keywords:
|
193
|
+
- TODO
|
194
|
+
- FIXME
|
195
|
+
- OPTIMIZE
|
196
|
+
- HACK
|
197
|
+
- REVIEW
|
198
|
+
|
199
|
+
Style/Documentation:
|
200
|
+
Enabled: false
|
201
|
+
|
202
|
+
# Multi-line method chaining should be done with leading dots.
|
203
|
+
Style/DotPosition:
|
204
|
+
EnforcedStyle: leading
|
205
|
+
SupportedStyles:
|
206
|
+
- leading
|
207
|
+
- trailing
|
208
|
+
|
209
|
+
# Use empty lines between defs.
|
210
|
+
Style/EmptyLineBetweenDefs:
|
211
|
+
# If true, this parameter means that single line method definitions don't
|
212
|
+
# need an empty line between them.
|
213
|
+
AllowAdjacentOneLineDefs: false
|
214
|
+
|
215
|
+
# Checks whether the source file has a utf-8 encoding comment or not
|
216
|
+
Style/Encoding:
|
217
|
+
EnforcedStyle: always
|
218
|
+
SupportedStyles:
|
219
|
+
- when_needed
|
220
|
+
- always
|
221
|
+
|
222
|
+
Style/FileName:
|
223
|
+
# File names listed in AllCops:Include are excluded by default. Add extra
|
224
|
+
# excludes here.
|
225
|
+
Exclude: []
|
226
|
+
|
227
|
+
# Checks use of for or each in multiline loops.
|
228
|
+
Style/For:
|
229
|
+
EnforcedStyle: each
|
230
|
+
SupportedStyles:
|
231
|
+
- for
|
232
|
+
- each
|
233
|
+
|
234
|
+
# Enforce the method used for string formatting.
|
235
|
+
Style/FormatString:
|
236
|
+
EnforcedStyle: format
|
237
|
+
SupportedStyles:
|
238
|
+
- format
|
239
|
+
- sprintf
|
240
|
+
- percent
|
241
|
+
|
242
|
+
# Built-in global variables are allowed by default.
|
243
|
+
Style/GlobalVars:
|
244
|
+
AllowedVariables: []
|
245
|
+
|
246
|
+
# `MinBodyLength` defines the number of lines of the a body of an if / unless
|
247
|
+
# needs to have to trigger this cop
|
248
|
+
Style/GuardClause:
|
249
|
+
MinBodyLength: 1
|
250
|
+
|
251
|
+
Style/HashSyntax:
|
252
|
+
EnforcedStyle: hash_rockets
|
253
|
+
SupportedStyles:
|
254
|
+
- ruby19
|
255
|
+
- hash_rockets
|
256
|
+
|
257
|
+
Style/IfUnlessModifier:
|
258
|
+
MaxLineLength: 80
|
259
|
+
|
260
|
+
Style/IndentationWidth:
|
261
|
+
# Number of spaces for each indentation level.
|
262
|
+
Width: 2
|
263
|
+
|
264
|
+
# Checks the indentation of the first key in a hash literal.
|
265
|
+
Style/IndentHash:
|
266
|
+
# The value `special_inside_parentheses` means that hash literals with braces
|
267
|
+
# that have their opening brace on the same line as a surrounding opening
|
268
|
+
# round parenthesis, shall have their first key indented relative to the
|
269
|
+
# first position inside the parenthesis.
|
270
|
+
# The value `consistent` means that the indentation of the first key shall
|
271
|
+
# always be relative to the first position of the line where the opening
|
272
|
+
# brace is.
|
273
|
+
EnforcedStyle: special_inside_parentheses
|
274
|
+
SupportedStyles:
|
275
|
+
- special_inside_parentheses
|
276
|
+
- consistent
|
277
|
+
|
278
|
+
Style/LambdaCall:
|
279
|
+
EnforcedStyle: call
|
280
|
+
SupportedStyles:
|
281
|
+
- call
|
282
|
+
- braces
|
283
|
+
|
284
|
+
Style/Next:
|
285
|
+
# With `always` all conditions at the end of an iteration needs to be
|
286
|
+
# replaced by next - with `skip_modifier_ifs` the modifier if like this one
|
287
|
+
# are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
|
288
|
+
EnforcedStyle: skip_modifier_ifs
|
289
|
+
# `MinBodyLength` defines the number of lines of the a body of an if / unless
|
290
|
+
# needs to have to trigger this cop
|
291
|
+
MinBodyLength: 3
|
292
|
+
SupportedStyles:
|
293
|
+
- skip_modifier_ifs
|
294
|
+
- always
|
295
|
+
|
296
|
+
Style/NonNilCheck:
|
297
|
+
# With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
|
298
|
+
# `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
|
299
|
+
# **usually** OK, but might change behavior.
|
300
|
+
#
|
301
|
+
# With `IncludeSemanticChanges` set to `false`, this cop does not report
|
302
|
+
# offenses for `!x.nil?` and does no changes that might change behavior.
|
303
|
+
IncludeSemanticChanges: false
|
304
|
+
|
305
|
+
Style/MethodDefParentheses:
|
306
|
+
EnforcedStyle: require_parentheses
|
307
|
+
SupportedStyles:
|
308
|
+
- require_parentheses
|
309
|
+
- require_no_parentheses
|
310
|
+
|
311
|
+
Style/MethodName:
|
312
|
+
EnforcedStyle: snake_case
|
313
|
+
SupportedStyles:
|
314
|
+
- snake_case
|
315
|
+
- camelCase
|
316
|
+
|
317
|
+
Style/MultilineOperationIndentation:
|
318
|
+
EnforcedStyle: aligned
|
319
|
+
SupportedStyles:
|
320
|
+
- aligned
|
321
|
+
- indented
|
322
|
+
|
323
|
+
Style/NumericLiterals:
|
324
|
+
Enabled: false
|
325
|
+
|
326
|
+
# Allow safe assignment in conditions.
|
327
|
+
Style/ParenthesesAroundCondition:
|
328
|
+
AllowSafeAssignment: true
|
329
|
+
|
330
|
+
Style/PercentLiteralDelimiters:
|
331
|
+
PreferredDelimiters:
|
332
|
+
'%': ()
|
333
|
+
'%i': ()
|
334
|
+
'%q': ()
|
335
|
+
'%Q': ()
|
336
|
+
'%r': '{}'
|
337
|
+
'%s': ()
|
338
|
+
'%w': ()
|
339
|
+
'%W': ()
|
340
|
+
'%x': ()
|
341
|
+
|
342
|
+
Style/PercentQLiterals:
|
343
|
+
EnforcedStyle: lower_case_q
|
344
|
+
SupportedStyles:
|
345
|
+
- lower_case_q # Use %q when possible, %Q when necessary
|
346
|
+
- upper_case_q # Always use %Q
|
347
|
+
|
348
|
+
Style/PredicateName:
|
349
|
+
# Predicate name prefices.
|
350
|
+
NamePrefix:
|
351
|
+
- is_
|
352
|
+
- has_
|
353
|
+
- have_
|
354
|
+
# Predicate name prefices that should be removed.
|
355
|
+
NamePrefixBlacklist:
|
356
|
+
- is_
|
357
|
+
- has_
|
358
|
+
- have_
|
359
|
+
|
360
|
+
Style/RaiseArgs:
|
361
|
+
EnforcedStyle: exploded
|
362
|
+
SupportedStyles:
|
363
|
+
- compact # raise Exception.new(msg)
|
364
|
+
- exploded # raise Exception, msg
|
365
|
+
|
366
|
+
Style/RedundantReturn:
|
367
|
+
# When true allows code like `return x, y`.
|
368
|
+
AllowMultipleReturnValues: false
|
369
|
+
|
370
|
+
Style/RegexpLiteral:
|
371
|
+
# The maximum number of (escaped) slashes that a slash-delimited regexp is
|
372
|
+
# allowed to have. If there are more slashes, a %r regexp shall be used.
|
373
|
+
MaxSlashes: 1
|
374
|
+
|
375
|
+
Style/Semicolon:
|
376
|
+
# Allow ; to separate several expressions on the same line.
|
377
|
+
AllowAsExpressionSeparator: false
|
378
|
+
|
379
|
+
Style/SignalException:
|
380
|
+
EnforcedStyle: semantic
|
381
|
+
SupportedStyles:
|
382
|
+
- only_raise
|
383
|
+
- only_fail
|
384
|
+
- semantic
|
385
|
+
|
386
|
+
Style/SingleLineBlockParams:
|
387
|
+
Methods:
|
388
|
+
- reduce:
|
389
|
+
- a
|
390
|
+
- e
|
391
|
+
- inject:
|
392
|
+
- a
|
393
|
+
- e
|
394
|
+
|
395
|
+
Style/SingleLineMethods:
|
396
|
+
AllowIfMethodIsEmpty: true
|
397
|
+
|
398
|
+
Style/StringLiterals:
|
399
|
+
EnforcedStyle: double_quotes
|
400
|
+
SupportedStyles:
|
401
|
+
- single_quotes
|
402
|
+
- double_quotes
|
403
|
+
|
404
|
+
Style/StringLiteralsInInterpolation:
|
405
|
+
EnforcedStyle: double_quotes
|
406
|
+
SupportedStyles:
|
407
|
+
- single_quotes
|
408
|
+
- double_quotes
|
409
|
+
|
410
|
+
Style/SpaceAroundEqualsInParameterDefault:
|
411
|
+
EnforcedStyle: space
|
412
|
+
SupportedStyles:
|
413
|
+
- space
|
414
|
+
- no_space
|
415
|
+
|
416
|
+
Style/SpaceBeforeBlockBraces:
|
417
|
+
EnforcedStyle: space
|
418
|
+
SupportedStyles:
|
419
|
+
- space
|
420
|
+
- no_space
|
421
|
+
|
422
|
+
Style/SpaceInsideBlockBraces:
|
423
|
+
EnforcedStyle: space
|
424
|
+
SupportedStyles:
|
425
|
+
- space
|
426
|
+
- no_space
|
427
|
+
# Valid values are: space, no_space
|
428
|
+
EnforcedStyleForEmptyBraces: no_space
|
429
|
+
# Space between { and |. Overrides EnforcedStyle if there is a conflict.
|
430
|
+
SpaceBeforeBlockParameters: true
|
431
|
+
|
432
|
+
Style/SpaceInsideHashLiteralBraces:
|
433
|
+
EnforcedStyle: space
|
434
|
+
EnforcedStyleForEmptyBraces: no_space
|
435
|
+
SupportedStyles:
|
436
|
+
- space
|
437
|
+
- no_space
|
438
|
+
|
439
|
+
Style/SymbolProc:
|
440
|
+
# A list of method names to be ignored by the check.
|
441
|
+
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
|
442
|
+
IgnoredMethods:
|
443
|
+
- respond_to
|
444
|
+
|
445
|
+
Style/TrailingBlankLines:
|
446
|
+
EnforcedStyle: final_newline
|
447
|
+
SupportedStyles:
|
448
|
+
- final_newline
|
449
|
+
- final_blank_line
|
450
|
+
|
451
|
+
Style/TrailingComma:
|
452
|
+
# If EnforcedStyleForMultiline is comma, the cop allows a comma after the
|
453
|
+
# last item of a list, but only for lists where each item is on its own line.
|
454
|
+
EnforcedStyleForMultiline: no_comma
|
455
|
+
SupportedStyles:
|
456
|
+
- comma
|
457
|
+
- no_comma
|
458
|
+
|
459
|
+
# TrivialAccessors doesn't require exact name matches and doesn't allow
|
460
|
+
# predicated methods by default.
|
461
|
+
Style/TrivialAccessors:
|
462
|
+
ExactNameMatch: false
|
463
|
+
AllowPredicates: false
|
464
|
+
# Allows trivial writers that don't end in an equal sign. e.g.
|
465
|
+
#
|
466
|
+
# def on_exception(action)
|
467
|
+
# @on_exception=action
|
468
|
+
# end
|
469
|
+
# on_exception :restart
|
470
|
+
#
|
471
|
+
# Commonly used in DSLs
|
472
|
+
AllowDSLWriters: false
|
473
|
+
Whitelist:
|
474
|
+
- to_ary
|
475
|
+
- to_a
|
476
|
+
- to_c
|
477
|
+
- to_enum
|
478
|
+
- to_h
|
479
|
+
- to_hash
|
480
|
+
- to_i
|
481
|
+
- to_int
|
482
|
+
- to_io
|
483
|
+
- to_open
|
484
|
+
- to_path
|
485
|
+
- to_proc
|
486
|
+
- to_r
|
487
|
+
- to_regexp
|
488
|
+
- to_str
|
489
|
+
- to_s
|
490
|
+
- to_sym
|
491
|
+
|
492
|
+
Style/VariableName:
|
493
|
+
EnforcedStyle: snake_case
|
494
|
+
SupportedStyles:
|
495
|
+
- snake_case
|
496
|
+
- camelCase
|
497
|
+
|
498
|
+
Style/WhileUntilModifier:
|
499
|
+
MaxLineLength: 80
|
500
|
+
|
501
|
+
Style/WordArray:
|
502
|
+
MinSize: 0
|
503
|
+
# The regular expression WordRegex decides what is considered a word.
|
504
|
+
WordRegex: !ruby/regexp '/\A[\p{Word}]+\z/'
|
505
|
+
|
506
|
+
##################### Metrics ##################################
|
507
|
+
|
508
|
+
Metrics/AbcSize:
|
509
|
+
# The ABC size is a calculated magnitude, so this number can be a Fixnum or
|
510
|
+
# a Float.
|
511
|
+
Max: 20
|
512
|
+
|
513
|
+
Metrics/BlockNesting:
|
514
|
+
Max: 3
|
515
|
+
|
516
|
+
Metrics/ClassLength:
|
517
|
+
CountComments: false # count full line comments?
|
518
|
+
Max: 100
|
519
|
+
|
520
|
+
# Avoid complex methods.
|
521
|
+
Metrics/CyclomaticComplexity:
|
522
|
+
Max: 6
|
523
|
+
|
524
|
+
Metrics/LineLength:
|
525
|
+
Max: 80
|
526
|
+
AllowURI: true
|
527
|
+
URISchemes:
|
528
|
+
- http
|
529
|
+
- https
|
530
|
+
|
531
|
+
Metrics/MethodLength:
|
532
|
+
CountComments: false # count full line comments?
|
533
|
+
Max: 20
|
534
|
+
|
535
|
+
Metrics/ParameterLists:
|
536
|
+
Max: 5
|
537
|
+
CountKeywordArgs: true
|
538
|
+
|
539
|
+
Metrics/PerceivedComplexity:
|
540
|
+
Max: 7
|
541
|
+
|
542
|
+
##################### Lint ##################################
|
543
|
+
|
544
|
+
# Allow safe assignment in conditions.
|
545
|
+
Lint/AssignmentInCondition:
|
546
|
+
AllowSafeAssignment: true
|
547
|
+
|
548
|
+
# Align ends correctly.
|
549
|
+
Lint/EndAlignment:
|
550
|
+
# The value `keyword` means that `end` should be aligned with the matching
|
551
|
+
# keyword (if, while, etc.).
|
552
|
+
# The value `variable` means that in assignments, `end` should be aligned
|
553
|
+
# with the start of the variable on the left hand side of `=`. In all other
|
554
|
+
# situations, `end` should still be aligned with the keyword.
|
555
|
+
AlignWith: keyword
|
556
|
+
SupportedStyles:
|
557
|
+
- keyword
|
558
|
+
- variable
|
559
|
+
|
560
|
+
Lint/DefEndAlignment:
|
561
|
+
# The value `def` means that `end` should be aligned with the def keyword.
|
562
|
+
# The value `start_of_line` means that `end` should be aligned with method
|
563
|
+
# calls like `private`, `public`, etc, if present in front of the `def`
|
564
|
+
# keyword on the same line.
|
565
|
+
AlignWith: start_of_line
|
566
|
+
SupportedStyles:
|
567
|
+
- start_of_line
|
568
|
+
- def
|
569
|
+
|
570
|
+
##################### Rails ##################################
|
571
|
+
|
572
|
+
Rails/ActionFilter:
|
573
|
+
EnforcedStyle: action
|
574
|
+
SupportedStyles:
|
575
|
+
- action
|
576
|
+
- filter
|
577
|
+
Include:
|
578
|
+
- app/controllers/**/*.rb
|
579
|
+
|
580
|
+
Rails/DefaultScope:
|
581
|
+
Include:
|
582
|
+
- app/models/**/*.rb
|
583
|
+
|
584
|
+
Rails/HasAndBelongsToMany:
|
585
|
+
Include:
|
586
|
+
- app/models/**/*.rb
|
587
|
+
|
588
|
+
Rails/Output:
|
589
|
+
Include:
|
590
|
+
- app/**/*.rb
|
591
|
+
- config/**/*.rb
|
592
|
+
- db/**/*.rb
|
593
|
+
- lib/**/*.rb
|
594
|
+
|
595
|
+
Rails/ReadWriteAttribute:
|
596
|
+
Include:
|
597
|
+
- app/models/**/*.rb
|
598
|
+
|
599
|
+
Rails/ScopeArgs:
|
600
|
+
Include:
|
601
|
+
- app/models/**/*.rb
|
602
|
+
|
603
|
+
Rails/Validation:
|
604
|
+
Include:
|
605
|
+
- app/models/**/*.rb
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'gatemedia_rubocop/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "gatemedia_rubocop"
|
8
|
+
spec.version = GatemediaRubocop::VERSION
|
9
|
+
spec.authors = ["Ben Colon"]
|
10
|
+
spec.email = ["ben.colon@gatemedia.ch"]
|
11
|
+
|
12
|
+
spec.summary = %q{Rubocop config file for Gatemedia projects}
|
13
|
+
spec.description = %q{Rubocop config file for Gatemedia projects}
|
14
|
+
spec.homepage = "http://gatemedia.ch"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gatemedia_rubocop
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ben Colon
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-12-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: Rubocop config file for Gatemedia projects
|
42
|
+
email:
|
43
|
+
- ben.colon@gatemedia.ch
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- bin/console
|
54
|
+
- bin/setup
|
55
|
+
- config/.rubocop.yml
|
56
|
+
- gatemedia_rubocop.gemspec
|
57
|
+
- lib/gatemedia_rubocop.rb
|
58
|
+
- lib/gatemedia_rubocop/version.rb
|
59
|
+
homepage: http://gatemedia.ch
|
60
|
+
licenses:
|
61
|
+
- MIT
|
62
|
+
metadata: {}
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options: []
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
requirements: []
|
78
|
+
rubyforge_project:
|
79
|
+
rubygems_version: 2.4.5.1
|
80
|
+
signing_key:
|
81
|
+
specification_version: 4
|
82
|
+
summary: Rubocop config file for Gatemedia projects
|
83
|
+
test_files: []
|