lifen-ruby-style 1.0.5 → 1.1.2
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 +26 -16
- data/README.md +16 -10
- data/default_overcommit.yml +26 -16
- data/default_rubocop.yml +31 -17
- data/lib/lifen/ruby_style/version.rb +1 -1
- data/lifen-ruby-style.gemspec +3 -2
- metadata +23 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 548b57257fd22c143635e55184cb0e91a2e77e11fac35dade956b76c44aa3b65
|
|
4
|
+
data.tar.gz: 3133553e6e0ba5fe93aa67ded5fa43efade1cb995c3ac25ad7be915bb065737b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ec9fb30668346cbf2a655b847b2a308a346528dd3a1cc7731b73c5829cc143828da6ed4aba8bca7c9d2d8139be3988b04ed71146531760881cf1e29f802024fe
|
|
7
|
+
data.tar.gz: 23710ab43cec2fa7bf5545bfba728e3aef5bc0c0ea747a42fc9fa5e97363bfb72a3faca22bcb657c679fb48c10b54a2aa89451eb918b2ef35cbdf7882435456b
|
data/.overcommit.yml
CHANGED
|
@@ -16,37 +16,47 @@
|
|
|
16
16
|
# Uncomment the following lines to make the configuration take effect.
|
|
17
17
|
|
|
18
18
|
PreCommit:
|
|
19
|
+
RubocopDaemonStart:
|
|
20
|
+
enabled: true
|
|
21
|
+
command: ['bundle', 'exec', 'rubocop-daemon', 'start']
|
|
22
|
+
parallelize: false
|
|
23
|
+
|
|
19
24
|
RuboCop:
|
|
20
25
|
enabled: true
|
|
21
|
-
command: [
|
|
26
|
+
command: ['bundle', 'exec', 'rubocop-daemon', 'exec', '--', '--format=emacs', '--auto-correct']
|
|
27
|
+
required_executable: 'rubocop-daemon'
|
|
28
|
+
flags: []
|
|
29
|
+
install_command: 'gem install rubocop-daemon'
|
|
22
30
|
problem_on_unmodified_line: ignore
|
|
23
31
|
|
|
24
32
|
GoFmt:
|
|
25
33
|
enabled: false
|
|
26
34
|
|
|
35
|
+
AuthorEmail:
|
|
36
|
+
enabled: false
|
|
37
|
+
AuthorName:
|
|
38
|
+
enabled: false
|
|
39
|
+
BrokenSymlinks:
|
|
40
|
+
enabled: false
|
|
41
|
+
CaseConflicts:
|
|
42
|
+
enabled: false
|
|
43
|
+
MergeConflicts:
|
|
44
|
+
enabled: false
|
|
45
|
+
|
|
27
46
|
CommitMsg:
|
|
28
47
|
CapitalizedSubject:
|
|
29
48
|
enabled: false
|
|
30
49
|
|
|
50
|
+
EmptyMessage:
|
|
51
|
+
enabled: false
|
|
52
|
+
|
|
31
53
|
SingleLineSubject:
|
|
32
|
-
enabled:
|
|
54
|
+
enabled: false
|
|
33
55
|
on_warn: fail
|
|
34
56
|
|
|
35
57
|
TextWidth:
|
|
36
|
-
enabled:
|
|
58
|
+
enabled: false
|
|
37
59
|
|
|
38
60
|
TrailingPeriod:
|
|
39
|
-
enabled:
|
|
61
|
+
enabled: false
|
|
40
62
|
on_warn: fail
|
|
41
|
-
#PreCommit:
|
|
42
|
-
# TrailingWhitespace:
|
|
43
|
-
# enabled: true
|
|
44
|
-
# exclude:
|
|
45
|
-
# - '**/db/structure.sql' # Ignore trailing whitespace in generated files
|
|
46
|
-
#
|
|
47
|
-
#PostCheckout:
|
|
48
|
-
# ALL: # Special hook name that customizes all hooks of this type
|
|
49
|
-
# quiet: true # Change all post-checkout hooks to only display output on failure
|
|
50
|
-
#
|
|
51
|
-
# IndexTags:
|
|
52
|
-
# enabled: true # Generate a tags file with `ctags` each time HEAD changes
|
data/README.md
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
- [Overcommit](#commandes-overcommit)
|
|
21
21
|
- [Utilisation d'une version locale](#utilisation-dune-version-locale)
|
|
22
22
|
- [Contributions](#contributions)
|
|
23
|
+
- [Publier une nouvelle version](#publier-une-nouvelle-version)
|
|
23
24
|
- [TODO](#todo)
|
|
24
25
|
- [Archives](#archives)
|
|
25
26
|
|
|
@@ -61,7 +62,7 @@ $ echo '--force-exclusion' > .rubocop
|
|
|
61
62
|
### 3. Config Overcommit
|
|
62
63
|
|
|
63
64
|
```bash
|
|
64
|
-
$ curl https://raw.githubusercontent.com/honestica/lifen-ruby-style/master/default_overcommit.yml > .
|
|
65
|
+
$ curl https://raw.githubusercontent.com/honestica/lifen-ruby-style/master/default_overcommit.yml > .overcommit.yml
|
|
65
66
|
```
|
|
66
67
|
|
|
67
68
|
### 4. Installer les dépendances
|
|
@@ -288,11 +289,12 @@ $ bundle exec rubocop --fail-fast # inspect files in order of modification time
|
|
|
288
289
|
Pour de la correction automatique :
|
|
289
290
|
|
|
290
291
|
```bash
|
|
291
|
-
$ bundle exec rubocop -a # auto-correct offenses.
|
|
292
292
|
$ bundle exec rubocop --safe # run only safe cops.
|
|
293
|
-
$ bundle exec rubocop --
|
|
293
|
+
$ bundle exec rubocop --auto-correct # run auto-correct only when it's safe.
|
|
294
|
+
$ bundle exec rubocop --auto-correct-all # run auto-correct (safe and unsafe).
|
|
294
295
|
$ bundle exec rubocop --lint # run only lint cops.
|
|
295
296
|
$ bundle exec rubocop --fix-layout # run only layout cops, with auto-correct on.
|
|
297
|
+
$ bundle exec rubocop --auto-correct-all --only "Style/AccessModifierDeclarations,Style/Alias,Style/AndOr,Style/ArrayJoin" # run autocorrect on listed cops
|
|
296
298
|
```
|
|
297
299
|
|
|
298
300
|
Liste des commandes disponibles :
|
|
@@ -368,15 +370,19 @@ Vous allez vouloir tester localement les modifications de règle de style que vo
|
|
|
368
370
|
|
|
369
371
|
**ATTENTION : La configuration d'overcommit n'est pas liée automatiquement au projet, il faut la copier/coller dans le projet cible après avoir effectué des changements.**
|
|
370
372
|
|
|
373
|
+
## Publier une nouvelle version
|
|
374
|
+
|
|
375
|
+
Suivre les instructions du [guide de release](RELEASING.md).
|
|
376
|
+
|
|
371
377
|
## TODO
|
|
372
378
|
|
|
373
|
-
[ ] Ajouter rubocop-daemon (arriver à faire une bonne intégration aux IDE)
|
|
374
|
-
[ ] Ajouter le hook de pre-commit au CI
|
|
375
|
-
[ ] Ajouter un hook de pre-push ?
|
|
376
|
-
[ ] Ajouter `fasterer` si pertinent
|
|
377
|
-
[ ] Ajouter `reek` si pertinent
|
|
378
|
-
[ ] Ajouter `slim_lint` si pertinent
|
|
379
|
-
[ ] Ajouter `scss` si pertinent
|
|
379
|
+
- [ ] Ajouter rubocop-daemon (arriver à faire une bonne intégration aux IDE)
|
|
380
|
+
- [ ] Ajouter le hook de pre-commit au CI
|
|
381
|
+
- [ ] Ajouter un hook de pre-push ?
|
|
382
|
+
- [ ] Ajouter `fasterer` si pertinent
|
|
383
|
+
- [ ] Ajouter `reek` si pertinent
|
|
384
|
+
- [ ] Ajouter `slim_lint` si pertinent
|
|
385
|
+
- [ ] Ajouter `scss` si pertinent
|
|
380
386
|
|
|
381
387
|
## Archives
|
|
382
388
|
|
data/default_overcommit.yml
CHANGED
|
@@ -16,37 +16,47 @@
|
|
|
16
16
|
# Uncomment the following lines to make the configuration take effect.
|
|
17
17
|
|
|
18
18
|
PreCommit:
|
|
19
|
+
RubocopDaemonStart:
|
|
20
|
+
enabled: true
|
|
21
|
+
command: ['bundle', 'exec', 'rubocop-daemon', 'start']
|
|
22
|
+
parallelize: false
|
|
23
|
+
|
|
19
24
|
RuboCop:
|
|
20
25
|
enabled: true
|
|
21
|
-
command: [
|
|
26
|
+
command: ['bundle', 'exec', 'rubocop-daemon', 'exec', '--', '--format=emacs', '--auto-correct']
|
|
27
|
+
required_executable: 'rubocop-daemon'
|
|
28
|
+
flags: []
|
|
29
|
+
install_command: 'gem install rubocop-daemon'
|
|
22
30
|
problem_on_unmodified_line: ignore
|
|
23
31
|
|
|
24
32
|
GoFmt:
|
|
25
33
|
enabled: false
|
|
26
34
|
|
|
35
|
+
AuthorEmail:
|
|
36
|
+
enabled: false
|
|
37
|
+
AuthorName:
|
|
38
|
+
enabled: false
|
|
39
|
+
BrokenSymlinks:
|
|
40
|
+
enabled: false
|
|
41
|
+
CaseConflicts:
|
|
42
|
+
enabled: false
|
|
43
|
+
MergeConflicts:
|
|
44
|
+
enabled: false
|
|
45
|
+
|
|
27
46
|
CommitMsg:
|
|
28
47
|
CapitalizedSubject:
|
|
29
48
|
enabled: false
|
|
30
49
|
|
|
50
|
+
EmptyMessage:
|
|
51
|
+
enabled: false
|
|
52
|
+
|
|
31
53
|
SingleLineSubject:
|
|
32
|
-
enabled:
|
|
54
|
+
enabled: false
|
|
33
55
|
on_warn: fail
|
|
34
56
|
|
|
35
57
|
TextWidth:
|
|
36
|
-
enabled:
|
|
58
|
+
enabled: false
|
|
37
59
|
|
|
38
60
|
TrailingPeriod:
|
|
39
|
-
enabled:
|
|
61
|
+
enabled: false
|
|
40
62
|
on_warn: fail
|
|
41
|
-
#PreCommit:
|
|
42
|
-
# TrailingWhitespace:
|
|
43
|
-
# enabled: true
|
|
44
|
-
# exclude:
|
|
45
|
-
# - '**/db/structure.sql' # Ignore trailing whitespace in generated files
|
|
46
|
-
#
|
|
47
|
-
#PostCheckout:
|
|
48
|
-
# ALL: # Special hook name that customizes all hooks of this type
|
|
49
|
-
# quiet: true # Change all post-checkout hooks to only display output on failure
|
|
50
|
-
#
|
|
51
|
-
# IndexTags:
|
|
52
|
-
# enabled: true # Generate a tags file with `ctags` each time HEAD changes
|
data/default_rubocop.yml
CHANGED
|
@@ -5,6 +5,7 @@ require:
|
|
|
5
5
|
|
|
6
6
|
AllCops:
|
|
7
7
|
DisplayStyleGuide: true
|
|
8
|
+
NewCops: enable
|
|
8
9
|
TargetRubyVersion: 2.5
|
|
9
10
|
Exclude:
|
|
10
11
|
- "test/**/*.rb"
|
|
@@ -16,18 +17,6 @@ AllCops:
|
|
|
16
17
|
- "spec/rails_helper.rb"
|
|
17
18
|
- "node_modules/**/*"
|
|
18
19
|
|
|
19
|
-
# Waiting for default config
|
|
20
|
-
Lint/RaiseException:
|
|
21
|
-
Enabled: true
|
|
22
|
-
Lint/StructNewOverride:
|
|
23
|
-
Enabled: true
|
|
24
|
-
Style/HashEachMethods:
|
|
25
|
-
Enabled: true
|
|
26
|
-
Style/HashTransformKeys:
|
|
27
|
-
Enabled: true
|
|
28
|
-
Style/HashTransformValues:
|
|
29
|
-
Enabled: true
|
|
30
|
-
|
|
31
20
|
Layout/ArgumentAlignment:
|
|
32
21
|
EnforcedStyle: with_fixed_indentation
|
|
33
22
|
|
|
@@ -56,7 +45,7 @@ Layout/IndentationConsistency:
|
|
|
56
45
|
EnforcedStyle: indented_internal_methods
|
|
57
46
|
|
|
58
47
|
Layout/LineLength:
|
|
59
|
-
|
|
48
|
+
Enabled: false
|
|
60
49
|
|
|
61
50
|
Layout/MultilineMethodCallIndentation:
|
|
62
51
|
EnforcedStyle: indented
|
|
@@ -85,15 +74,17 @@ Metrics/MethodLength:
|
|
|
85
74
|
Metrics/ModuleLength:
|
|
86
75
|
Max: 250
|
|
87
76
|
|
|
77
|
+
Metrics/ParameterLists:
|
|
78
|
+
Enabled: false
|
|
79
|
+
|
|
88
80
|
Metrics/PerceivedComplexity:
|
|
89
81
|
Enabled: false
|
|
90
82
|
|
|
91
83
|
Naming/MemoizedInstanceVariableName:
|
|
92
84
|
EnforcedStyleForLeadingUnderscores: required
|
|
93
85
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
- spec/lib/tasks/deployment/**/*
|
|
86
|
+
Naming/VariableNumber:
|
|
87
|
+
Enabled: false
|
|
97
88
|
|
|
98
89
|
Style/BlockDelimiters:
|
|
99
90
|
EnforcedStyle: braces_for_chaining
|
|
@@ -101,9 +92,24 @@ Style/BlockDelimiters:
|
|
|
101
92
|
Style/ClassAndModuleChildren:
|
|
102
93
|
Enabled: false
|
|
103
94
|
|
|
95
|
+
Style/ExplicitBlockArgument:
|
|
96
|
+
AutoCorrect: false
|
|
97
|
+
|
|
104
98
|
Style/Documentation:
|
|
105
99
|
Enabled: false
|
|
106
100
|
|
|
101
|
+
Style/TrailingCommaInArguments:
|
|
102
|
+
Enabled: true
|
|
103
|
+
EnforcedStyleForMultiline: comma
|
|
104
|
+
|
|
105
|
+
Style/TrailingCommaInArrayLiteral:
|
|
106
|
+
Enabled: true
|
|
107
|
+
EnforcedStyleForMultiline: comma
|
|
108
|
+
|
|
109
|
+
Style/TrailingCommaInHashLiteral:
|
|
110
|
+
Enabled: true
|
|
111
|
+
EnforcedStyleForMultiline: comma
|
|
112
|
+
|
|
107
113
|
Style/IfUnlessModifier:
|
|
108
114
|
Enabled: true
|
|
109
115
|
AutoCorrect: false
|
|
@@ -139,6 +145,11 @@ RSpec/AnyInstance:
|
|
|
139
145
|
|
|
140
146
|
RSpec/DescribedClass:
|
|
141
147
|
EnforcedStyle: explicit
|
|
148
|
+
Exclude:
|
|
149
|
+
- spec/lib/tasks/deployment/**/*
|
|
150
|
+
|
|
151
|
+
RSpec/EmptyExampleGroup:
|
|
152
|
+
Enabled: false
|
|
142
153
|
|
|
143
154
|
RSpec/ExampleLength:
|
|
144
155
|
Enabled: false
|
|
@@ -152,8 +163,11 @@ RSpec/LetSetup:
|
|
|
152
163
|
RSpec/MultipleExpectations:
|
|
153
164
|
Enabled: false
|
|
154
165
|
|
|
166
|
+
RSpec/MultipleMemoizedHelpers:
|
|
167
|
+
Enabled: false
|
|
168
|
+
|
|
155
169
|
RSpec/NestedGroups:
|
|
156
|
-
|
|
170
|
+
Enabled: false
|
|
157
171
|
|
|
158
172
|
RSpec/NotToNot:
|
|
159
173
|
EnforcedStyle: to_not
|
data/lifen-ruby-style.gemspec
CHANGED
|
@@ -30,10 +30,11 @@ Gem::Specification.new do |spec|
|
|
|
30
30
|
spec.require_paths = ['lib']
|
|
31
31
|
|
|
32
32
|
spec.add_dependency 'overcommit'
|
|
33
|
-
spec.add_dependency 'rubocop', '
|
|
33
|
+
spec.add_dependency 'rubocop', '~> 1.5'
|
|
34
|
+
spec.add_dependency 'rubocop-daemon'
|
|
34
35
|
spec.add_dependency 'rubocop-performance', '~> 1.5'
|
|
35
36
|
spec.add_dependency 'rubocop-rails', '~> 2.4'
|
|
36
|
-
spec.add_dependency 'rubocop-rspec', '~>
|
|
37
|
+
spec.add_dependency 'rubocop-rspec', '~> 2.0'
|
|
37
38
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
|
38
39
|
spec.add_development_dependency 'rake', '~> 10.0'
|
|
39
40
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lifen-ruby-style
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Team Lifen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-12-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: overcommit
|
|
@@ -28,16 +28,30 @@ dependencies:
|
|
|
28
28
|
name: rubocop
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '1.5'
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
40
|
+
version: '1.5'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rubocop-daemon
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
56
|
name: rubocop-performance
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -72,14 +86,14 @@ dependencies:
|
|
|
72
86
|
requirements:
|
|
73
87
|
- - "~>"
|
|
74
88
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '
|
|
89
|
+
version: '2.0'
|
|
76
90
|
type: :runtime
|
|
77
91
|
prerelease: false
|
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
93
|
requirements:
|
|
80
94
|
- - "~>"
|
|
81
95
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '
|
|
96
|
+
version: '2.0'
|
|
83
97
|
- !ruby/object:Gem::Dependency
|
|
84
98
|
name: bundler
|
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -150,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
150
164
|
- !ruby/object:Gem::Version
|
|
151
165
|
version: '0'
|
|
152
166
|
requirements: []
|
|
153
|
-
rubygems_version: 3.
|
|
167
|
+
rubygems_version: 3.1.3
|
|
154
168
|
signing_key:
|
|
155
169
|
specification_version: 4
|
|
156
170
|
summary: Lifen style guides and shared style configs.
|