rubocop-traitify 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +27 -0
- data/config/default.yml +16 -0
- data/config/rubocop-airbnb.yml +11 -0
- data/config/rubocop-layout.yml +23 -0
- data/config/rubocop-lint.yml +2 -0
- data/config/rubocop-style.yml +52 -0
- data/config/rubocop-todo.yml +11 -0
- data/lib/rubocop/traitify/inject.rb +21 -0
- data/lib/rubocop/traitify/version.rb +5 -0
- data/lib/rubocop/traitify.rb +13 -0
- data/lib/rubocop-traitify.rb +9 -0
- data/rubocop-traitify.gemspec +28 -0
- metadata +85 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ee5d28cd9101958b565f26ad578d9a7b26ce7f191d88d25d9be3d5c654934ab5
|
4
|
+
data.tar.gz: f48d12434fb23251651b48551c12a2507fe164b21632440dce5b3cf1e9edd8a2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8795dcd9894ce3e88cca451eae41bbb841dd7376980c712e4c88a0f58cd8be202f422ed632a4a3a7e50b7b652bdbbe8d7f003ec450fe15eaa75a5b8a125b54e1
|
7
|
+
data.tar.gz: f06641d401eab8f6c289b8c0d1e11398ef695c8b2ded898508d2e23ce0275a7d9c6de9355a377bf47a0f8dff3ea2171fd6b191a4b4e532a37ea2e011b5a47854
|
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# RuboCop Traitify
|
2
|
+
|
3
|
+
Traitify's default configuration for [RuboCop](https://github.com/rubocop-hq/rubocop).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Until `rubocop-airbnb` is updated to support ruby 2.6 a fork is required
|
8
|
+
|
9
|
+
```
|
10
|
+
gem "rubocop-airbnb",
|
11
|
+
git: "https://github.com/mcamara/ruby.git",
|
12
|
+
glob: "rubocop-airbnb/*.gemspec" # Until airbnb supports ruby 2.6
|
13
|
+
gem "rubocop-traitify"
|
14
|
+
```
|
15
|
+
|
16
|
+
## Usage
|
17
|
+
|
18
|
+
Add the following to `.rubocop.yml`
|
19
|
+
|
20
|
+
```
|
21
|
+
inherit_gem:
|
22
|
+
rubocop-traitify: .rubocop_traitify.yml
|
23
|
+
```
|
24
|
+
|
25
|
+
## Credit
|
26
|
+
|
27
|
+
Heavily influenced by (as well as dependent on) Airbnb's [configuration/plugin](https://github.com/airbnb/ruby)
|
data/config/default.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- bin/yarn
|
4
|
+
- db/schema.rb
|
5
|
+
|
6
|
+
inherit_from:
|
7
|
+
- ./rubocop-airbnb.yml
|
8
|
+
- ./rubocop-layout.yml
|
9
|
+
- ./rubocop-lint.yml
|
10
|
+
- ./rubocop-style.yml
|
11
|
+
- ./rubocop-todo.yml
|
12
|
+
|
13
|
+
# TODO: Remove. Move to specific rules that need it
|
14
|
+
inherit_mode:
|
15
|
+
merge:
|
16
|
+
- Exclude
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Layout/AlignParameters:
|
2
|
+
Enabled: true
|
3
|
+
EnforcedStyle: with_fixed_indentation
|
4
|
+
|
5
|
+
Layout/CaseIndentation:
|
6
|
+
Enabled: true
|
7
|
+
EnforcedStyle: end
|
8
|
+
|
9
|
+
Layout/DotPosition:
|
10
|
+
Enabled: true
|
11
|
+
EnforcedStyle: leading
|
12
|
+
|
13
|
+
Layout/EndAlignment:
|
14
|
+
Enabled: true
|
15
|
+
EnforcedStyleAlignWith: start_of_line
|
16
|
+
|
17
|
+
Layout/SpaceBeforeBlockBraces:
|
18
|
+
Enabled: true
|
19
|
+
EnforcedStyle: no_space
|
20
|
+
|
21
|
+
Layout/SpaceInsideHashLiteralBraces:
|
22
|
+
Enabled: true
|
23
|
+
EnforcedStyle: no_space
|
@@ -0,0 +1,52 @@
|
|
1
|
+
Style/BlockDelimiters:
|
2
|
+
Enabled: false
|
3
|
+
|
4
|
+
Style/MixinUsage:
|
5
|
+
Enabled: true
|
6
|
+
Exclude:
|
7
|
+
- bin/*
|
8
|
+
|
9
|
+
Style/MultilineIfModifier:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
Style/MultilineTernaryOperator:
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
Style/PercentLiteralDelimiters:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
Style/RaiseArgs:
|
19
|
+
Enabled: true
|
20
|
+
EnforcedStyle: compact
|
21
|
+
|
22
|
+
Style/RescueModifier:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Style/Semicolon:
|
26
|
+
AllowAsExpressionSeparator: true
|
27
|
+
Enabled: true
|
28
|
+
|
29
|
+
Style/StringLiterals:
|
30
|
+
Enabled: true
|
31
|
+
EnforcedStyle: double_quotes
|
32
|
+
|
33
|
+
Style/StringLiteralsInInterpolation:
|
34
|
+
Enabled: true
|
35
|
+
EnforcedStyle: double_quotes
|
36
|
+
|
37
|
+
Style/SymbolArray:
|
38
|
+
Enabled: true
|
39
|
+
EnforcedStyle: brackets
|
40
|
+
MinSize: 1
|
41
|
+
|
42
|
+
Style/TrailingCommaInArrayLiteral:
|
43
|
+
Enabled: true
|
44
|
+
EnforcedStyleForMultiline: no_comma
|
45
|
+
|
46
|
+
Style/TrailingCommaInHashLiteral:
|
47
|
+
Enabled: true
|
48
|
+
EnforcedStyleForMultiline: no_comma
|
49
|
+
|
50
|
+
Style/WordArray:
|
51
|
+
Enabled: true
|
52
|
+
EnforcedStyle: brackets
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# TODO: Disabled until rule fixed for symbols
|
2
|
+
Airbnb/ClassName:
|
3
|
+
Enabled: false
|
4
|
+
|
5
|
+
# TODO: Disabled until rule fixed for symbols
|
6
|
+
Airbnb/FactoryClassUseString:
|
7
|
+
Enabled: false
|
8
|
+
|
9
|
+
# TODO: Disabled until rule fixed
|
10
|
+
Layout/RescueEnsureAlignment:
|
11
|
+
Enabled: false
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Straight up ripped from Airbnb ripped from Rspec
|
2
|
+
# https://github.com/airbnb/ruby/blob/master/rubocop-airbnb/lib/rubocop/airbnb/inject.rb
|
3
|
+
# https://github.com/nevir/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb
|
4
|
+
require "yaml"
|
5
|
+
|
6
|
+
module RuboCop
|
7
|
+
module Traitify
|
8
|
+
# Because RuboCop doesn't yet support plugins, we have to monkey patch in a
|
9
|
+
# bit of our configuration.
|
10
|
+
module Inject
|
11
|
+
def self.defaults!
|
12
|
+
path = CONFIG_DEFAULT.to_s
|
13
|
+
hash = ConfigLoader.load_file(path).to_hash
|
14
|
+
config = Config.new(hash, path)
|
15
|
+
puts "configuration from #{path}" if ConfigLoader.debug?
|
16
|
+
config = ConfigLoader.merge_with_default(config, path)
|
17
|
+
ConfigLoader.instance_variable_set(:@default_configuration, config)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require "pathname"
|
2
|
+
require "psych"
|
3
|
+
|
4
|
+
module RuboCop
|
5
|
+
module Traitify
|
6
|
+
PROJECT_ROOT =
|
7
|
+
Pathname.new(__FILE__).parent.parent.parent.expand_path.freeze
|
8
|
+
CONFIG_DEFAULT = PROJECT_ROOT.join("config", "default.yml").freeze
|
9
|
+
CONFIG = Psych.safe_load(CONFIG_DEFAULT.read).freeze
|
10
|
+
|
11
|
+
private_constant(*constants(false))
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
2
|
+
require "rubocop/traitify/version"
|
3
|
+
|
4
|
+
Gem::Specification.new do |spec|
|
5
|
+
spec.name = "rubocop-traitify"
|
6
|
+
spec.summary = "Default Rubocop config for Traitify Apps"
|
7
|
+
spec.description = <<-EOF
|
8
|
+
Traitify's Ruby configuration for Rubocop. Heavily influenced by (as well as dependent on)
|
9
|
+
Airbnb's https://github.com/airbnb/ruby
|
10
|
+
EOF
|
11
|
+
spec.authors = ["Tom Prats"]
|
12
|
+
spec.email = ["tom@traitify.com"]
|
13
|
+
spec.homepage = "https://github.com/traitify/rubocop-traitify"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.version = RuboCop::Traitify::VERSION
|
16
|
+
spec.platform = Gem::Platform::RUBY
|
17
|
+
spec.required_ruby_version = ">= 2.1"
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
spec.files = Dir[
|
20
|
+
"{config,lib}/**/*",
|
21
|
+
"*.md",
|
22
|
+
"*.gemspec",
|
23
|
+
"Gemfile"
|
24
|
+
]
|
25
|
+
|
26
|
+
spec.add_dependency("rubocop", "~> 0.62.0")
|
27
|
+
spec.add_dependency("rubocop-airbnb", "~> 2.0.0")
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubocop-traitify
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tom Prats
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-07-29 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.62.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.62.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop-airbnb
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.0.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.0.0
|
41
|
+
description: |2
|
42
|
+
Traitify's Ruby configuration for Rubocop. Heavily influenced by (as well as dependent on)
|
43
|
+
Airbnb's https://github.com/airbnb/ruby
|
44
|
+
email:
|
45
|
+
- tom@traitify.com
|
46
|
+
executables: []
|
47
|
+
extensions: []
|
48
|
+
extra_rdoc_files: []
|
49
|
+
files:
|
50
|
+
- README.md
|
51
|
+
- config/default.yml
|
52
|
+
- config/rubocop-airbnb.yml
|
53
|
+
- config/rubocop-layout.yml
|
54
|
+
- config/rubocop-lint.yml
|
55
|
+
- config/rubocop-style.yml
|
56
|
+
- config/rubocop-todo.yml
|
57
|
+
- lib/rubocop-traitify.rb
|
58
|
+
- lib/rubocop/traitify.rb
|
59
|
+
- lib/rubocop/traitify/inject.rb
|
60
|
+
- lib/rubocop/traitify/version.rb
|
61
|
+
- rubocop-traitify.gemspec
|
62
|
+
homepage: https://github.com/traitify/rubocop-traitify
|
63
|
+
licenses:
|
64
|
+
- MIT
|
65
|
+
metadata: {}
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '2.1'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubygems_version: 3.0.2
|
82
|
+
signing_key:
|
83
|
+
specification_version: 4
|
84
|
+
summary: Default Rubocop config for Traitify Apps
|
85
|
+
test_files: []
|