rubocop-bitcrowd 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rubocop-rspec.yml +16 -0
- data/.rubocop.yml +102 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +62 -0
- data/Rakefile +1 -0
- data/exe/rubocop-autofix +14 -0
- data/rubocop-bitcrowd.gemspec +23 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 354dce1782e3791856c5f05e9ffe54c4c45dfd36
|
4
|
+
data.tar.gz: 899fc873d1a0ddc0eabdc5b6e8e7bfdaa478e220
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: aea545246216d563b955ef193da7b80436efe103677d46dd64a4aa53047ddba03f4a8c6e580471f0a909e25ddaa6978747516e7152776ace90554c7ca23770a3
|
7
|
+
data.tar.gz: 99aac4836154070c5bb2b4bb84bef8ec02f4dedb81846ef6d39dcdaad01943bf186b2c27877d7c26ef99262cf31b4f4e389631c198f7161baf3a34af3a1fdb4f
|
data/.gitignore
ADDED
data/.rubocop-rspec.yml
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
AllCops:
|
2
|
+
Include:
|
3
|
+
- '**/Gemfile'
|
4
|
+
- '**/Rakefile'
|
5
|
+
- '**/config.ru'
|
6
|
+
- '**/Capfile'
|
7
|
+
Exclude:
|
8
|
+
- 'db/**/*'
|
9
|
+
- 'config/**/*'
|
10
|
+
- 'script/**/*'
|
11
|
+
DisplayCopNames: true
|
12
|
+
DisplayStyleGuide: true
|
13
|
+
|
14
|
+
Documentation:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Lint/UselessAccessModifier:
|
18
|
+
Enabled: true
|
19
|
+
|
20
|
+
Metrics/LineLength:
|
21
|
+
Enabled: true
|
22
|
+
Max: 120
|
23
|
+
|
24
|
+
Rails:
|
25
|
+
Enabled: true
|
26
|
+
|
27
|
+
Rails/ActionFilter:
|
28
|
+
Enabled: true
|
29
|
+
|
30
|
+
Rails/Date:
|
31
|
+
Enabled: true
|
32
|
+
|
33
|
+
Rails/Delegate:
|
34
|
+
Enabled: true
|
35
|
+
|
36
|
+
Rails/FindBy:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
Rails/FindEach:
|
40
|
+
Enabled: true
|
41
|
+
|
42
|
+
Rails/HasAndBelongsToMany:
|
43
|
+
Enabled: true
|
44
|
+
|
45
|
+
Rails/Output:
|
46
|
+
Enabled: true
|
47
|
+
|
48
|
+
Rails/PluralizationGrammar:
|
49
|
+
Enabled: true
|
50
|
+
|
51
|
+
Rails/HttpPositionalArguments:
|
52
|
+
Enabled: true
|
53
|
+
|
54
|
+
Rails/ReadWriteAttribute:
|
55
|
+
Enabled: true
|
56
|
+
|
57
|
+
Rails/ScopeArgs:
|
58
|
+
Enabled: true
|
59
|
+
|
60
|
+
Rails/SkipsModelValidations:
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
Rails/TimeZone:
|
64
|
+
Enabled: true
|
65
|
+
|
66
|
+
Rails/Validation:
|
67
|
+
Enabled: true
|
68
|
+
|
69
|
+
Style/AndOr:
|
70
|
+
Enabled: true
|
71
|
+
|
72
|
+
Style/BlockDelimiters:
|
73
|
+
EnforcedStyle: braces_for_chaining
|
74
|
+
|
75
|
+
Style/ClassAndModuleChildren:
|
76
|
+
EnforcedStyle: compact
|
77
|
+
|
78
|
+
Style/CollectionMethods:
|
79
|
+
Enabled: true
|
80
|
+
|
81
|
+
Style/MethodCalledOnDoEndBlock:
|
82
|
+
Enabled: true
|
83
|
+
|
84
|
+
Style/SpaceInsideBrackets:
|
85
|
+
Enabled: true
|
86
|
+
AutoCorrect: true
|
87
|
+
|
88
|
+
Style/FrozenStringLiteralComment:
|
89
|
+
Enabled: false
|
90
|
+
|
91
|
+
Style/MutableConstant:
|
92
|
+
Enabled: true
|
93
|
+
|
94
|
+
Metrics/MethodLength:
|
95
|
+
Enabled: true
|
96
|
+
|
97
|
+
Metrics/BlockLength:
|
98
|
+
Enabled: true
|
99
|
+
ExcludedMethods: ['describe', 'context', 'define', 'factory']
|
100
|
+
|
101
|
+
Metrics/AbcSize:
|
102
|
+
Enabled: true
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Andreas Knöpfle
|
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,62 @@
|
|
1
|
+
# Rubocop::Bitcrowd
|
2
|
+
|
3
|
+
The bitcrowd rubocop.yml as a gem.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this lines to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'rubocop'
|
11
|
+
gem 'rubocop-bitcrowd'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
## Usage
|
19
|
+
|
20
|
+
To use the configuration in your project create a .rubocop.yml with:
|
21
|
+
|
22
|
+
```yml
|
23
|
+
inherit_gem:
|
24
|
+
rubocop-bitcrowd: .rubocop.yml
|
25
|
+
```
|
26
|
+
|
27
|
+
# Using rubocop-rspec
|
28
|
+
|
29
|
+
There is also a config file for rubocop-rspec. To use it add rubocop-rspec to your Gemfile.
|
30
|
+
```ruby
|
31
|
+
gem 'rubocop-rspec'
|
32
|
+
```
|
33
|
+
|
34
|
+
```yml
|
35
|
+
inherit_gem:
|
36
|
+
rubocop-bitcrowd:
|
37
|
+
- .rubocop.yml
|
38
|
+
- .rubocop-rspec.yml
|
39
|
+
```
|
40
|
+
|
41
|
+
## Autofixing issues
|
42
|
+
At bitcrowd we discovered it to be a very good practice to put each automatically
|
43
|
+
fixable Cop into a single commit when initially adding rubocop into a bigger project.
|
44
|
+
|
45
|
+
This gem provides a simple script, that can help you with this task:
|
46
|
+
|
47
|
+
1. Create your rubocop configuration (either with the instructions above or your own)
|
48
|
+
2. Create a rubocop_todo.yml with:
|
49
|
+
```
|
50
|
+
rubocop --auto-gen-config
|
51
|
+
```
|
52
|
+
3. Make sure you have a clean state in git, since the script will make commits for you (you may want to commit your rubocop_todo.yml)
|
53
|
+
4. Run the script (may take a while, when you want to continue working on your project meanwhile run this in a separate checkout):
|
54
|
+
```
|
55
|
+
rubocop-autofix
|
56
|
+
```
|
57
|
+
5. Review all commits made by the script and run your tests. You can now drop certain commits of cops you don't want. Often it may make some sense to run the script again with changed settings, since rebasing 100+ commits is no fun.
|
58
|
+
|
59
|
+
|
60
|
+
## License
|
61
|
+
|
62
|
+
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/exe/rubocop-autofix
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
rubocop_todo = '.rubocop_todo.yml'
|
5
|
+
if File.exist?(rubocop_todo)
|
6
|
+
rubocop_yaml = YAML.load_file(rubocop_todo)
|
7
|
+
rubocop_yaml.keys.each do |key|
|
8
|
+
puts "Running autofix for #{key}"
|
9
|
+
`rubocop --only '#{key}' -a`
|
10
|
+
`git commit -am 'Run rubocop autofix for #{key}'`
|
11
|
+
end
|
12
|
+
else
|
13
|
+
puts 'Please create a .rubocop_todo.yml with `rubocop --auto-gen-config` first.'
|
14
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
Gem::Specification.new do |spec|
|
3
|
+
spec.name = 'rubocop-bitcrowd'
|
4
|
+
spec.version = '1.0.0'
|
5
|
+
spec.authors = ['bitcrowd']
|
6
|
+
spec.email = ['info@bitcrowd.net']
|
7
|
+
|
8
|
+
spec.summary = 'The bitcrowd rubocop.yml as a gem.'
|
9
|
+
spec.description = 'Use this as a quick start to get rubocop with the '\
|
10
|
+
'settings we use at bitcrowd into your project'
|
11
|
+
spec.homepage = 'https://github.com/bitcrowd/rubocop-bitcrowd'
|
12
|
+
spec.license = 'MIT'
|
13
|
+
|
14
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
15
|
+
f.match(%r{^(test|spec|features)/})
|
16
|
+
end
|
17
|
+
spec.bindir = 'exe'
|
18
|
+
spec.executables = 'rubocop-autofix'
|
19
|
+
|
20
|
+
spec.add_development_dependency 'bundler', '~> 1.14'
|
21
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
22
|
+
spec.add_development_dependency 'rubocop'
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubocop-bitcrowd
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- bitcrowd
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-03-02 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.14'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.14'
|
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
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Use this as a quick start to get rubocop with the settings we use at
|
56
|
+
bitcrowd into your project
|
57
|
+
email:
|
58
|
+
- info@bitcrowd.net
|
59
|
+
executables:
|
60
|
+
- rubocop-autofix
|
61
|
+
extensions: []
|
62
|
+
extra_rdoc_files: []
|
63
|
+
files:
|
64
|
+
- ".gitignore"
|
65
|
+
- ".rubocop-rspec.yml"
|
66
|
+
- ".rubocop.yml"
|
67
|
+
- Gemfile
|
68
|
+
- LICENSE.txt
|
69
|
+
- README.md
|
70
|
+
- Rakefile
|
71
|
+
- exe/rubocop-autofix
|
72
|
+
- rubocop-bitcrowd.gemspec
|
73
|
+
homepage: https://github.com/bitcrowd/rubocop-bitcrowd
|
74
|
+
licenses:
|
75
|
+
- MIT
|
76
|
+
metadata: {}
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options: []
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
requirements: []
|
92
|
+
rubyforge_project:
|
93
|
+
rubygems_version: 2.6.10
|
94
|
+
signing_key:
|
95
|
+
specification_version: 4
|
96
|
+
summary: The bitcrowd rubocop.yml as a gem.
|
97
|
+
test_files: []
|