crean_cop 1.0.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 +2 -0
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +5 -0
- data/LICENSE.md +22 -0
- data/README.md +44 -0
- data/crean_cop.gemspec +22 -0
- data/default.yml +86 -0
- data/lib/crean_cop.rb +5 -0
- metadata +66 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: '07668fb106ec03e8d8c307ae2511af0692f38448e06a049180bcf50dd9e63d3c'
|
|
4
|
+
data.tar.gz: 64f70cf4b371e2ad5b43c9aeaa137d78ae7f9fceb1a3608de19b9ada3004084e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: c5e44b37f7995c0ce1d107e1dbec58cdc9fa3eded63d8e90f224a3c7348143c61b25abce16f7185a24c4b5eecead570f7703a5a464995086c60f6b2736aebea8
|
|
7
|
+
data.tar.gz: 4122279d1b30d29dee5c264e9234a6c52383e2fb5ddaf18dd4a08de83686379a0b95925c5124c6ca9d674a2db95f1a2316bcf1d8728d90a072e740b7a3f44a2b
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013 to 2016 Aaron Lasseigne and Taylor Fausak
|
|
4
|
+
Copyright (c) 2017 to 2019 Aaron Lasseigne
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# CreanCop
|
|
2
|
+
|
|
3
|
+
This repository hosts my personal configuration gem for rubocop.
|
|
4
|
+
|
|
5
|
+
The configuration provided here is intended to apply to all of my projects and crean repositories.
|
|
6
|
+
|
|
7
|
+
Your application might have special rules of its own, which you can freely override in your local configuration. But if you think a rule is of general
|
|
8
|
+
relevance, than it should probably live here.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
Include this gem in your Gemfile:
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
gem 'crean_cop'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Let your `.rubocop.yml` inherit from this gem:
|
|
19
|
+
|
|
20
|
+
```yml
|
|
21
|
+
inherit_gem:
|
|
22
|
+
crean_cop:
|
|
23
|
+
- default.yml
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Customizing rules
|
|
27
|
+
|
|
28
|
+
The snippet above is everything needed to use this configuration as default.
|
|
29
|
+
Starting from there it is possible to make local changes to the configuration.
|
|
30
|
+
|
|
31
|
+
Take this example `.rubocop.yml`:
|
|
32
|
+
|
|
33
|
+
```yml
|
|
34
|
+
inherit_gem:
|
|
35
|
+
crean_cop:
|
|
36
|
+
- default.yml
|
|
37
|
+
|
|
38
|
+
# We still have unfixed offenses in some files
|
|
39
|
+
inherit_from: .rubocop_todo.yml
|
|
40
|
+
|
|
41
|
+
# This project agreed on a different line length than the rest of the company
|
|
42
|
+
Metrics/LineLength:
|
|
43
|
+
Max: 120
|
|
44
|
+
```
|
data/crean_cop.gemspec
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
lib = File.expand_path('lib', __dir__)
|
|
5
|
+
$LOAD_PATH.push(lib) unless $LOAD_PATH.include?(lib)
|
|
6
|
+
|
|
7
|
+
require 'crean_cop'
|
|
8
|
+
|
|
9
|
+
Gem::Specification.new do |gem|
|
|
10
|
+
gem.name = 'crean_cop'
|
|
11
|
+
gem.version = CreanCop::VERSION
|
|
12
|
+
gem.licenses = %w[MIT]
|
|
13
|
+
gem.authors = ['Omar Sotillo']
|
|
14
|
+
gem.email = ['omarsotillofranco@gmail.com']
|
|
15
|
+
gem.summary = 'Dependency and configuration for rubocop.'
|
|
16
|
+
|
|
17
|
+
gem.files = `git ls-files -z`.split("\x0")
|
|
18
|
+
.reject { |f| f.match(%r{^spec/}) }
|
|
19
|
+
gem.require_paths = ['lib']
|
|
20
|
+
|
|
21
|
+
gem.add_dependency 'rubocop'
|
|
22
|
+
end
|
data/default.yml
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
Exclude:
|
|
3
|
+
- 'bin/**/*'
|
|
4
|
+
- 'db/schema.rb'
|
|
5
|
+
- 'doc/**/*'
|
|
6
|
+
- 'docker_app/**/*'
|
|
7
|
+
- 'Guardfile'
|
|
8
|
+
- 'tmp/**/*'
|
|
9
|
+
- 'vendor/**/*'
|
|
10
|
+
- 'playground/**/*'
|
|
11
|
+
- 'public/**/*'
|
|
12
|
+
- 'node_modules/**/*'
|
|
13
|
+
|
|
14
|
+
# Models can have a bunch of attributes which lead to long methods and high
|
|
15
|
+
# complexity values. However, these methods are still very readable because they
|
|
16
|
+
# usually have a lot of repetition.
|
|
17
|
+
Metrics:
|
|
18
|
+
Exclude:
|
|
19
|
+
- 'db/migrate/*.rb'
|
|
20
|
+
|
|
21
|
+
# We need to configure exemptions for blocks that we generally accept to be
|
|
22
|
+
# long, since they are less comparable to methods and more comparable to
|
|
23
|
+
# modules/classes.
|
|
24
|
+
Metrics/BlockLength:
|
|
25
|
+
ExcludedMethods:
|
|
26
|
+
- context
|
|
27
|
+
- describe
|
|
28
|
+
- namespace
|
|
29
|
+
- factory
|
|
30
|
+
- define
|
|
31
|
+
- shared_examples_for
|
|
32
|
+
- shared_examples
|
|
33
|
+
- xcontext
|
|
34
|
+
- xdescribe
|
|
35
|
+
Exclude:
|
|
36
|
+
- 'config/environments/*.rb' # instead of excluding all :configure methods
|
|
37
|
+
- 'config/routes.rb'
|
|
38
|
+
- 'spec/spec_helper.rb' # instead of excluding all :configure methods
|
|
39
|
+
- '*.gemspec' # a gemspec could easily have more than the 25 lines limit
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
Metrics/MethodLength:
|
|
43
|
+
Max: 16
|
|
44
|
+
|
|
45
|
+
ClassLength:
|
|
46
|
+
Max: 120
|
|
47
|
+
|
|
48
|
+
Style/AsciiComments:
|
|
49
|
+
Enabled: false
|
|
50
|
+
|
|
51
|
+
Style/Documentation:
|
|
52
|
+
Enabled: false
|
|
53
|
+
|
|
54
|
+
Style/Encoding:
|
|
55
|
+
Enabled: true
|
|
56
|
+
Exclude:
|
|
57
|
+
- '*.gemspec'
|
|
58
|
+
|
|
59
|
+
Style/FrozenStringLiteralComment:
|
|
60
|
+
EnforcedStyle: always
|
|
61
|
+
|
|
62
|
+
Style/ModuleFunction:
|
|
63
|
+
Enabled: false
|
|
64
|
+
|
|
65
|
+
# While it is very often useful to separate numbers after every three digits
|
|
66
|
+
# for readability, this mostly doesn't make sense if the number doesn't
|
|
67
|
+
# represent an amount but rather an identifier. Thus the use of underscores
|
|
68
|
+
# every three digits is recommended but not enforced.
|
|
69
|
+
Style/NumericLiterals:
|
|
70
|
+
Enabled: false
|
|
71
|
+
|
|
72
|
+
# Do not force the same one letter variable names for all occurences of inject
|
|
73
|
+
Style/SingleLineBlockParams:
|
|
74
|
+
Enabled: false
|
|
75
|
+
|
|
76
|
+
MultilineMethodCallBraceLayout:
|
|
77
|
+
EnforcedStyle: new_line
|
|
78
|
+
|
|
79
|
+
MultilineMethodCallIndentation:
|
|
80
|
+
EnforcedStyle: indented
|
|
81
|
+
|
|
82
|
+
PercentLiteralDelimiters:
|
|
83
|
+
PreferredDelimiters:
|
|
84
|
+
'%W': '[]'
|
|
85
|
+
'%i': '[]'
|
|
86
|
+
'%w': '[]'
|
data/lib/crean_cop.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: crean_cop
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Omar Sotillo
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2019-10-20 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rubocop
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
description:
|
|
28
|
+
email:
|
|
29
|
+
- omarsotillofranco@gmail.com
|
|
30
|
+
executables: []
|
|
31
|
+
extensions: []
|
|
32
|
+
extra_rdoc_files: []
|
|
33
|
+
files:
|
|
34
|
+
- ".gitignore"
|
|
35
|
+
- ".rubocop.yml"
|
|
36
|
+
- CHANGELOG.md
|
|
37
|
+
- Gemfile
|
|
38
|
+
- LICENSE.md
|
|
39
|
+
- README.md
|
|
40
|
+
- crean_cop.gemspec
|
|
41
|
+
- default.yml
|
|
42
|
+
- lib/crean_cop.rb
|
|
43
|
+
homepage:
|
|
44
|
+
licenses:
|
|
45
|
+
- MIT
|
|
46
|
+
metadata: {}
|
|
47
|
+
post_install_message:
|
|
48
|
+
rdoc_options: []
|
|
49
|
+
require_paths:
|
|
50
|
+
- lib
|
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
52
|
+
requirements:
|
|
53
|
+
- - ">="
|
|
54
|
+
- !ruby/object:Gem::Version
|
|
55
|
+
version: '0'
|
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0'
|
|
61
|
+
requirements: []
|
|
62
|
+
rubygems_version: 3.0.3
|
|
63
|
+
signing_key:
|
|
64
|
+
specification_version: 4
|
|
65
|
+
summary: Dependency and configuration for rubocop.
|
|
66
|
+
test_files: []
|