lifen-ruby-style 0.2.1 → 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 +4 -4
- data/.overcommit.yml +55 -0
- data/.rubocop.yml +1 -1
- data/Gemfile +2 -0
- data/README.md +358 -31
- data/Rakefile +2 -0
- data/default_overcommit.yml +55 -0
- data/default_rubocop.yml +133 -0
- data/lib/lifen/ruby_style/version.rb +5 -1
- data/lib/lifen/ruby_style.rb +2 -0
- data/lifen-ruby-style.gemspec +23 -17
- data/rubocop +1 -0
- data/style_guide.md +673 -0
- metadata +82 -8
- data/default.yml +0 -170
data/default_rubocop.yml
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
require:
|
|
2
|
+
- rubocop-rspec
|
|
3
|
+
- rubocop-performance
|
|
4
|
+
- rubocop-rails
|
|
5
|
+
|
|
6
|
+
AllCops:
|
|
7
|
+
DisplayStyleGuide: true
|
|
8
|
+
TargetRubyVersion: 2.5
|
|
9
|
+
Exclude:
|
|
10
|
+
- "test/**/*.rb"
|
|
11
|
+
- "bin/*"
|
|
12
|
+
- "*.gemspec"
|
|
13
|
+
- "db/*"
|
|
14
|
+
- "db/migrate/*.rb"
|
|
15
|
+
- "spec/spec_helper.rb"
|
|
16
|
+
- "spec/rails_helper.rb"
|
|
17
|
+
- "node_modules/**/*"
|
|
18
|
+
|
|
19
|
+
# Waiting for default config
|
|
20
|
+
Style/HashEachMethods:
|
|
21
|
+
Enabled: true
|
|
22
|
+
Style/HashTransformKeys:
|
|
23
|
+
Enabled: true
|
|
24
|
+
Style/HashTransformValues:
|
|
25
|
+
Enabled: true
|
|
26
|
+
|
|
27
|
+
Layout/ArgumentAlignment:
|
|
28
|
+
EnforcedStyle: with_fixed_indentation
|
|
29
|
+
|
|
30
|
+
Layout/CaseIndentation:
|
|
31
|
+
EnforcedStyle: end
|
|
32
|
+
|
|
33
|
+
Layout/EmptyLinesAroundClassBody:
|
|
34
|
+
EnforcedStyle: empty_lines
|
|
35
|
+
|
|
36
|
+
Layout/EmptyLinesAroundModuleBody:
|
|
37
|
+
EnforcedStyle: empty_lines_except_namespace
|
|
38
|
+
|
|
39
|
+
Layout/EndAlignment:
|
|
40
|
+
EnforcedStyleAlignWith: variable
|
|
41
|
+
|
|
42
|
+
Layout/FirstArgumentIndentation:
|
|
43
|
+
EnforcedStyle: consistent
|
|
44
|
+
|
|
45
|
+
Layout/FirstArrayElementIndentation:
|
|
46
|
+
EnforcedStyle: consistent
|
|
47
|
+
|
|
48
|
+
Layout/FirstHashElementIndentation:
|
|
49
|
+
EnforcedStyle: consistent
|
|
50
|
+
|
|
51
|
+
Layout/IndentationConsistency:
|
|
52
|
+
EnforcedStyle: indented_internal_methods
|
|
53
|
+
|
|
54
|
+
Layout/LineLength:
|
|
55
|
+
Max: 120
|
|
56
|
+
|
|
57
|
+
Layout/MultilineMethodCallIndentation:
|
|
58
|
+
EnforcedStyle: indented
|
|
59
|
+
|
|
60
|
+
Layout/ParameterAlignment:
|
|
61
|
+
EnforcedStyle: with_fixed_indentation
|
|
62
|
+
|
|
63
|
+
Lint/RescueException:
|
|
64
|
+
Enabled: false
|
|
65
|
+
|
|
66
|
+
Metrics/AbcSize:
|
|
67
|
+
Enabled: false
|
|
68
|
+
|
|
69
|
+
Metrics/BlockLength:
|
|
70
|
+
Enabled: false
|
|
71
|
+
|
|
72
|
+
Metrics/ClassLength:
|
|
73
|
+
Max: 250
|
|
74
|
+
|
|
75
|
+
Metrics/CyclomaticComplexity:
|
|
76
|
+
Enabled: false
|
|
77
|
+
|
|
78
|
+
Metrics/MethodLength:
|
|
79
|
+
Max: 40
|
|
80
|
+
|
|
81
|
+
Metrics/ModuleLength:
|
|
82
|
+
Max: 250
|
|
83
|
+
|
|
84
|
+
Metrics/PerceivedComplexity:
|
|
85
|
+
Enabled: false
|
|
86
|
+
|
|
87
|
+
Naming/MemoizedInstanceVariableName:
|
|
88
|
+
EnforcedStyleForLeadingUnderscores: required
|
|
89
|
+
|
|
90
|
+
Style/ClassAndModuleChildren:
|
|
91
|
+
Enabled: false
|
|
92
|
+
|
|
93
|
+
Style/Documentation:
|
|
94
|
+
Enabled: false
|
|
95
|
+
|
|
96
|
+
Style/NumericLiterals:
|
|
97
|
+
Strict: true
|
|
98
|
+
|
|
99
|
+
Style/RegexpLiteral:
|
|
100
|
+
AllowInnerSlashes: true
|
|
101
|
+
|
|
102
|
+
Style/StructInheritance:
|
|
103
|
+
Enabled: false
|
|
104
|
+
|
|
105
|
+
Style/SymbolArray:
|
|
106
|
+
EnforcedStyle: brackets
|
|
107
|
+
|
|
108
|
+
Style/WordArray:
|
|
109
|
+
EnforcedStyle: brackets
|
|
110
|
+
|
|
111
|
+
RSpec/AnyInstance:
|
|
112
|
+
Enabled: false
|
|
113
|
+
|
|
114
|
+
RSpec/DescribedClass:
|
|
115
|
+
EnforcedStyle: explicit
|
|
116
|
+
|
|
117
|
+
RSpec/ExampleLength:
|
|
118
|
+
Enabled: false
|
|
119
|
+
|
|
120
|
+
RSpec/HookArgument:
|
|
121
|
+
EnforcedStyle: each
|
|
122
|
+
|
|
123
|
+
RSpec/MultipleExpectations:
|
|
124
|
+
Enabled: false
|
|
125
|
+
|
|
126
|
+
RSpec/NestedGroups:
|
|
127
|
+
Max: 4
|
|
128
|
+
|
|
129
|
+
RSpec/NotToNot:
|
|
130
|
+
EnforcedStyle: to_not
|
|
131
|
+
|
|
132
|
+
RSpec/RepeatedDescription:
|
|
133
|
+
Enabled: false
|
data/lib/lifen/ruby_style.rb
CHANGED
data/lifen-ruby-style.gemspec
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require
|
|
5
|
+
require 'lifen/ruby_style/version'
|
|
5
6
|
|
|
6
7
|
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name =
|
|
8
|
+
spec.name = 'lifen-ruby-style'
|
|
8
9
|
spec.version = Lifen::RubyStyle::VERSION
|
|
9
|
-
spec.authors = [
|
|
10
|
-
spec.email = [
|
|
10
|
+
spec.authors = ['Team Lifen']
|
|
11
|
+
spec.email = ['contact@lifen.fr']
|
|
11
12
|
|
|
12
13
|
spec.summary = 'Lifen style guides and shared style configs.'
|
|
13
14
|
spec.homepage = 'https://github.com/honestica/lifen-ruby-style'
|
|
@@ -17,19 +18,24 @@ Gem::Specification.new do |spec|
|
|
|
17
18
|
if spec.respond_to?(:metadata)
|
|
18
19
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
|
19
20
|
else
|
|
20
|
-
raise
|
|
21
|
-
|
|
21
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
|
22
|
+
'public gem pushes.'
|
|
22
23
|
end
|
|
23
24
|
|
|
24
|
-
spec.files
|
|
25
|
-
f.match(
|
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
26
|
+
f.match(/^(test|spec|features)\//)
|
|
26
27
|
end
|
|
27
|
-
spec.bindir =
|
|
28
|
-
spec.executables = spec.files.grep(
|
|
29
|
-
spec.require_paths = [
|
|
28
|
+
spec.bindir = 'exe'
|
|
29
|
+
spec.executables = spec.files.grep(/^exe\//) { |f| File.basename(f) }
|
|
30
|
+
spec.require_paths = ['lib']
|
|
30
31
|
|
|
31
|
-
spec.add_dependency
|
|
32
|
-
spec.add_dependency
|
|
33
|
-
spec.
|
|
34
|
-
spec.
|
|
32
|
+
spec.add_dependency 'overcommit'
|
|
33
|
+
spec.add_dependency 'pronto', '~> 0.1'
|
|
34
|
+
spec.add_dependency 'pronto-rubocop', '~> 0.1'
|
|
35
|
+
spec.add_dependency 'rubocop', '~> 0.8'
|
|
36
|
+
spec.add_dependency 'rubocop-performance', '~> 1.5'
|
|
37
|
+
spec.add_dependency 'rubocop-rails', '~> 2.4'
|
|
38
|
+
spec.add_dependency 'rubocop-rspec', '~> 1.38'
|
|
39
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
|
40
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
|
35
41
|
end
|
data/rubocop
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--force-exclusion
|