freistil-rubocop 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rubocop.yml +1 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/README.md +43 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/default.yml +153 -0
- data/freistil-rubocop.gemspec +35 -0
- data/lib/freistil/rubocop/version.rb +5 -0
- data/lib/freistil/rubocop.rb +7 -0
- metadata +119 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7e62cb5a0766c0103c9f74f84536745ca9e96637
|
4
|
+
data.tar.gz: 7a02dbdd388571bcbd44c4573cf00c29cbcc5664
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a1ffe34bdfc349a800c40a1e28a777e4538a3e995a2a19cdf0f88a5db31db8649b1152255783ffde9edb4142f866f5f4eb059b930e4ecf1edd246e8d972d1fcd
|
7
|
+
data.tar.gz: 1bd4b4c6adaee183522bfc80f92cebd48f7296d582ade0e70661bf9c729cf8a737c6e2b8407222b0eb419ae88c61d2fb75e56347842260e05bada921609d6afe
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
inherit_from: default.yml
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Freistil::Rubocop
|
2
|
+
|
3
|
+
This gem contains the shared Rubocop style definitions for the freistil IT team.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
group :test, :development do
|
11
|
+
gem 'freistil-rubocop'
|
12
|
+
end
|
13
|
+
```
|
14
|
+
|
15
|
+
Or, for a Ruby library, add this to your gemspec:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
spec.add_development_dependency 'freistil-rubocop'
|
19
|
+
```
|
20
|
+
|
21
|
+
And then run:
|
22
|
+
|
23
|
+
```bash
|
24
|
+
bundle install
|
25
|
+
```
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
Create a `.rubocop.yml` with the following directives:
|
30
|
+
|
31
|
+
```yaml
|
32
|
+
inherit_gem:
|
33
|
+
freistil-rubocop:
|
34
|
+
- default.yml
|
35
|
+
```
|
36
|
+
|
37
|
+
Now, run:
|
38
|
+
|
39
|
+
```bash
|
40
|
+
bundle exec rubocop
|
41
|
+
```
|
42
|
+
|
43
|
+
You do not need to include rubocop directly in your application's dependencies. Percy-style will include a specific version of `rubocop` and `rubocop-rspec` that is shared across all projects.
|
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 "freistil/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(__FILE__)
|
data/bin/setup
ADDED
data/default.yml
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.2
|
3
|
+
Include:
|
4
|
+
- '**/config.ru'
|
5
|
+
Exclude:
|
6
|
+
- Gemfile
|
7
|
+
- Guardfile
|
8
|
+
- '**/Rakefile'
|
9
|
+
- 'bin/**/*'
|
10
|
+
- 'db/**/*'
|
11
|
+
- 'config/**/*'
|
12
|
+
- 'vendor/**/*'
|
13
|
+
- '.chef/*'
|
14
|
+
- 'lib/tasks/*.rake'
|
15
|
+
|
16
|
+
Metrics/BlockLength:
|
17
|
+
Description: 'Avoid blocks longer than 25 lines of code.'
|
18
|
+
Exclude:
|
19
|
+
- "Rakefile"
|
20
|
+
- "**/*.rake"
|
21
|
+
- "spec/**/*.rb"
|
22
|
+
|
23
|
+
Metrics/ClassLength:
|
24
|
+
Description: 'Avoid classes longer than 100 lines of code.'
|
25
|
+
Enabled: false
|
26
|
+
|
27
|
+
Metrics/ModuleLength:
|
28
|
+
Description: 'Avoid modules longer than 100 lines of code.'
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Style/ClassVars:
|
32
|
+
Description: 'Avoid the use of class variables.'
|
33
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
Style/CollectionMethods:
|
37
|
+
Enabled: true
|
38
|
+
PreferredMethods:
|
39
|
+
find: detect
|
40
|
+
inject: reduce
|
41
|
+
collect: map
|
42
|
+
find_all: select
|
43
|
+
|
44
|
+
Style/Documentation:
|
45
|
+
Description: 'Document classes and non-namespace modules.'
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
Layout/DotPosition:
|
49
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
50
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
51
|
+
EnforcedStyle: trailing
|
52
|
+
|
53
|
+
Style/Encoding:
|
54
|
+
Enabled: false
|
55
|
+
|
56
|
+
Style/GlobalVars:
|
57
|
+
Description: 'Do not introduce global variables.'
|
58
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
|
59
|
+
Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
|
60
|
+
Enabled: false
|
61
|
+
|
62
|
+
Style/GuardClause:
|
63
|
+
Description: 'Check for conditionals that can be replaced with guard clauses'
|
64
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
65
|
+
Enabled: false
|
66
|
+
|
67
|
+
Style/IfUnlessModifier:
|
68
|
+
Description: >-
|
69
|
+
Favor modifier if/unless usage when you have a
|
70
|
+
single-line body.
|
71
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
72
|
+
Enabled: false
|
73
|
+
|
74
|
+
Style/InlineComment:
|
75
|
+
Description: 'Avoid inline comments.'
|
76
|
+
Enabled: false
|
77
|
+
|
78
|
+
Style/LineEndConcatenation:
|
79
|
+
Description: >-
|
80
|
+
Use \ instead of + or << to concatenate two string literals at
|
81
|
+
line end.
|
82
|
+
Enabled: false
|
83
|
+
|
84
|
+
Metrics/LineLength:
|
85
|
+
Description: 'Limit lines to 80 characters.'
|
86
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
87
|
+
Max: 80
|
88
|
+
IgnoredPatterns: ['\A#']
|
89
|
+
|
90
|
+
Metrics/MethodLength:
|
91
|
+
Description: 'Avoid methods longer than 10 lines of code.'
|
92
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
93
|
+
Enabled: false
|
94
|
+
|
95
|
+
Layout/MultilineOperationIndentation:
|
96
|
+
Description: >-
|
97
|
+
Checks indentation of binary operations that span more than
|
98
|
+
one line.
|
99
|
+
Enabled: true
|
100
|
+
EnforcedStyle: indented
|
101
|
+
|
102
|
+
Metrics/ParameterLists:
|
103
|
+
Description: 'Avoid parameter lists longer than three or four parameters.'
|
104
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
|
105
|
+
Enabled: false
|
106
|
+
|
107
|
+
Style/PredicateName:
|
108
|
+
Description: 'Check the names of predicate methods.'
|
109
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
110
|
+
NamePrefixBlacklist:
|
111
|
+
- is_
|
112
|
+
Exclude:
|
113
|
+
- spec/**/*
|
114
|
+
|
115
|
+
Style/SingleLineMethods:
|
116
|
+
Description: 'Avoid single-line methods.'
|
117
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
118
|
+
Enabled: false
|
119
|
+
|
120
|
+
Style/StringLiterals:
|
121
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
122
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
123
|
+
EnforcedStyle: double_quotes
|
124
|
+
Enabled: true
|
125
|
+
|
126
|
+
Style/TrailingCommaInArguments:
|
127
|
+
# If `comma`, the cop requires a comma after the last argument, but only for
|
128
|
+
# parenthesized method calls where each argument is on its own line.
|
129
|
+
# If `consistent_comma`, the cop requires a comma after the last argument,
|
130
|
+
# for all parenthesized method calls with arguments.
|
131
|
+
EnforcedStyleForMultiline: comma
|
132
|
+
|
133
|
+
Style/TrailingCommaInLiteral:
|
134
|
+
# If `comma`, the cop requires a comma after the last item in an array or
|
135
|
+
# hash, but only when each item is on its own line.
|
136
|
+
# If `consistent_comma`, the cop requires a comma after the last item of all
|
137
|
+
# non-empty array and hash literals.
|
138
|
+
EnforcedStyleForMultiline: comma
|
139
|
+
|
140
|
+
Style/WhileUntilModifier:
|
141
|
+
Description: >-
|
142
|
+
Favor modifier while/until usage when you have a
|
143
|
+
single-line body.
|
144
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
145
|
+
Enabled: false
|
146
|
+
|
147
|
+
# Lint
|
148
|
+
|
149
|
+
Lint/AssignmentInCondition:
|
150
|
+
Description: "Don't use assignment in conditions."
|
151
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
152
|
+
Enabled: false
|
153
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "freistil/rubocop/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "freistil-rubocop"
|
8
|
+
spec.version = Freistil::Rubocop::VERSION
|
9
|
+
spec.authors = ["freistil IT Ltd"]
|
10
|
+
spec.email = ["ops@freistil.it"]
|
11
|
+
spec.license = "Apache-2.0"
|
12
|
+
|
13
|
+
spec.summary = %q{Rubocop style definitions for freistil IT}
|
14
|
+
spec.description = %q{Ruby style definitions shared by the freistil IT team}
|
15
|
+
spec.homepage = "https://github.com/freistil/freistil-rubocop"
|
16
|
+
|
17
|
+
if spec.respond_to?(:metadata)
|
18
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
19
|
+
else
|
20
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
21
|
+
"public gem pushes."
|
22
|
+
end
|
23
|
+
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
25
|
+
f.match(%r{^(test|spec|features)/})
|
26
|
+
end
|
27
|
+
spec.bindir = "exe"
|
28
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
spec.add_dependency "rubocop", "~> 0.58.2"
|
32
|
+
spec.add_dependency "rubocop-rspec", "~> 1.29", ">= 1.29.1"
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
34
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: freistil-rubocop
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- freistil IT Ltd
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-02-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.58.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.58.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop-rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.29'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 1.29.1
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '1.29'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 1.29.1
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: bundler
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '1.16'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '1.16'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rake
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '10.0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '10.0'
|
75
|
+
description: Ruby style definitions shared by the freistil IT team
|
76
|
+
email:
|
77
|
+
- ops@freistil.it
|
78
|
+
executables: []
|
79
|
+
extensions: []
|
80
|
+
extra_rdoc_files: []
|
81
|
+
files:
|
82
|
+
- ".gitignore"
|
83
|
+
- ".rubocop.yml"
|
84
|
+
- ".travis.yml"
|
85
|
+
- Gemfile
|
86
|
+
- README.md
|
87
|
+
- Rakefile
|
88
|
+
- bin/console
|
89
|
+
- bin/setup
|
90
|
+
- default.yml
|
91
|
+
- freistil-rubocop.gemspec
|
92
|
+
- lib/freistil/rubocop.rb
|
93
|
+
- lib/freistil/rubocop/version.rb
|
94
|
+
homepage: https://github.com/freistil/freistil-rubocop
|
95
|
+
licenses:
|
96
|
+
- Apache-2.0
|
97
|
+
metadata:
|
98
|
+
allowed_push_host: https://rubygems.org
|
99
|
+
post_install_message:
|
100
|
+
rdoc_options: []
|
101
|
+
require_paths:
|
102
|
+
- lib
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
requirements: []
|
114
|
+
rubyforge_project:
|
115
|
+
rubygems_version: 2.6.7
|
116
|
+
signing_key:
|
117
|
+
specification_version: 4
|
118
|
+
summary: Rubocop style definitions for freistil IT
|
119
|
+
test_files: []
|