lifen-ruby-style 1.0.4 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d83fc95d69649b222043d845f130a29f96018c26962a032ad01e964710c44427
4
- data.tar.gz: 94ac735a37ef9306e4fbe8a85c9b5bd7c41f5286286a5102c2a5f499a5ea0b6b
3
+ metadata.gz: 5cbac6f002e6d616e150c920089419d9a44b5b7b93c549dff410be015a353210
4
+ data.tar.gz: f2d267a1b83879b8bfea25b49ea08d28b9664deef816d93083761c208685a970
5
5
  SHA512:
6
- metadata.gz: bbb80f85b58c9f588d8b297f31478c1e6aefcc6b910f65f66118b9c0cd3340e96093dd711190dc498f87974a3203315ec4f95693615832190d913a189b221191
7
- data.tar.gz: 5ab2eb5753cdf6e69d1f4ea21f03253d9895f48bd6582d64bac651423f667c5e01f725daaad7e978dd10bbe1e9635df3ab2772984ce93c8ed89851616e2e925d
6
+ metadata.gz: e0c69f959d219382dd5392b1f8beb0e3972a5520f8859abaaccb83908c4e04b336b5a5433b3cc6f1966860dfff9c44e1fa74757dd18342fa34e86ce9da71b5e9
7
+ data.tar.gz: 7f11f7497a3b3a26657865d0a9856c1620cde6bebeeba19473d063086075195402fbc0a247eb74b289dd9ff2c7a328d5d35d5b754af3078ffdf17d22126c9510
@@ -16,36 +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: ["bundle", "exec", "rubocop"]
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'
30
+ problem_on_unmodified_line: ignore
22
31
 
23
32
  GoFmt:
24
33
  enabled: false
25
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
+
26
46
  CommitMsg:
27
47
  CapitalizedSubject:
28
48
  enabled: false
29
49
 
50
+ EmptyMessage:
51
+ enabled: false
52
+
30
53
  SingleLineSubject:
31
- enabled: true
54
+ enabled: false
32
55
  on_warn: fail
33
56
 
34
57
  TextWidth:
35
- enabled: true
58
+ enabled: false
36
59
 
37
60
  TrailingPeriod:
38
- enabled: true
61
+ enabled: false
39
62
  on_warn: fail
40
- #PreCommit:
41
- # TrailingWhitespace:
42
- # enabled: true
43
- # exclude:
44
- # - '**/db/structure.sql' # Ignore trailing whitespace in generated files
45
- #
46
- #PostCheckout:
47
- # ALL: # Special hook name that customizes all hooks of this type
48
- # quiet: true # Change all post-checkout hooks to only display output on failure
49
- #
50
- # IndexTags:
51
- # 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 > .overcommit_test.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
@@ -123,17 +124,20 @@ $ bundle exec overcommit --install
123
124
  - Paramétrage recommandé pour l'auto-formatting :
124
125
 
125
126
  ```json
127
+ "editor.formatOnPaste": true, // global auto-format code when pasting
128
+ "editor.formatOnSave": true, // global auto-format code when saving
126
129
  "[ruby]": {
127
- "editor.formatOnPaste": true, // auto-format ruby code when pasting
128
- "editor.formatOnSave": true // auto-format ruby code when saving
130
+ "editor.formatOnSave": false // disable auto-format on save only for ruby files
129
131
  },
130
132
  ```
131
133
 
132
134
  ou
133
135
 
134
136
  ```json
135
- "editor.formatOnPaste": true, // auto-format code when pasting
136
- "editor.formatOnSave": true, // auto-format code when saving
137
+ "[ruby]": {
138
+ "editor.formatOnPaste": true, // auto-format ruby code when pasting
139
+ "editor.formatOnSave": false // auto-format ruby code when saving
140
+ },
137
141
  ```
138
142
 
139
143
  ### 3. Bonus - Autres extensions utiles :
@@ -285,11 +289,12 @@ $ bundle exec rubocop --fail-fast # inspect files in order of modification time
285
289
  Pour de la correction automatique :
286
290
 
287
291
  ```bash
288
- $ bundle exec rubocop -a # auto-correct offenses.
289
292
  $ bundle exec rubocop --safe # run only safe cops.
290
- $ bundle exec rubocop --safe-auto-correct # run auto-correct only when it's safe.
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).
291
295
  $ bundle exec rubocop --lint # run only lint cops.
292
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
293
298
  ```
294
299
 
295
300
  Liste des commandes disponibles :
@@ -365,15 +370,19 @@ Vous allez vouloir tester localement les modifications de règle de style que vo
365
370
 
366
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.**
367
372
 
373
+ ## Publier une nouvelle version
374
+
375
+ Suivre les instructions du [guide de release](RELEASING.md).
376
+
368
377
  ## TODO
369
378
 
370
- [ ] Ajouter rubocop-daemon (arriver à faire une bonne intégration aux IDE)
371
- [ ] Ajouter le hook de pre-commit au CI
372
- [ ] Ajouter un hook de pre-push ?
373
- [ ] Ajouter `fasterer` si pertinent
374
- [ ] Ajouter `reek` si pertinent
375
- [ ] Ajouter `slim_lint` si pertinent
376
- [ ] 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
377
386
 
378
387
  ## Archives
379
388
 
@@ -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: ["bundle", "exec", "rubocop"]
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: true
54
+ enabled: false
33
55
  on_warn: fail
34
56
 
35
57
  TextWidth:
36
- enabled: true
58
+ enabled: false
37
59
 
38
60
  TrailingPeriod:
39
- enabled: true
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
@@ -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
- Max: 120
48
+ Enabled: false
60
49
 
61
50
  Layout/MultilineMethodCallIndentation:
62
51
  EnforcedStyle: indented
@@ -85,6 +74,9 @@ 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
 
@@ -97,9 +89,24 @@ Style/BlockDelimiters:
97
89
  Style/ClassAndModuleChildren:
98
90
  Enabled: false
99
91
 
92
+ Style/ExplicitBlockArgument:
93
+ AutoCorrect: false
94
+
100
95
  Style/Documentation:
101
96
  Enabled: false
102
97
 
98
+ Style/TrailingCommaInArguments:
99
+ Enabled: true
100
+ EnforcedStyleForMultiline: comma
101
+
102
+ Style/TrailingCommaInArrayLiteral:
103
+ Enabled: true
104
+ EnforcedStyleForMultiline: comma
105
+
106
+ Style/TrailingCommaInHashLiteral:
107
+ Enabled: true
108
+ EnforcedStyleForMultiline: comma
109
+
103
110
  Style/IfUnlessModifier:
104
111
  Enabled: true
105
112
  AutoCorrect: false
@@ -135,6 +142,11 @@ RSpec/AnyInstance:
135
142
 
136
143
  RSpec/DescribedClass:
137
144
  EnforcedStyle: explicit
145
+ Exclude:
146
+ - spec/lib/tasks/deployment/**/*
147
+
148
+ RSpec/EmptyExampleGroup:
149
+ Enabled: false
138
150
 
139
151
  RSpec/ExampleLength:
140
152
  Enabled: false
@@ -148,8 +160,11 @@ RSpec/LetSetup:
148
160
  RSpec/MultipleExpectations:
149
161
  Enabled: false
150
162
 
163
+ RSpec/MultipleMemoizedHelpers:
164
+ Enabled: false
165
+
151
166
  RSpec/NestedGroups:
152
- Max: 5
167
+ Enabled: false
153
168
 
154
169
  RSpec/NotToNot:
155
170
  EnforcedStyle: to_not
@@ -3,7 +3,7 @@
3
3
  module Lifen
4
4
  module RubyStyle
5
5
 
6
- VERSION = '1.0.4'
6
+ VERSION = '1.1.1'
7
7
 
8
8
  end
9
9
  end
@@ -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', '0.81'
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', '~> 1.38'
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.0.4
4
+ version: 1.1.1
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-04-06 00:00:00.000000000 Z
11
+ date: 2020-12-07 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: '0.81'
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: '0.81'
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: '1.38'
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: '1.38'
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.0.6
167
+ rubygems_version: 3.0.3
154
168
  signing_key:
155
169
  specification_version: 4
156
170
  summary: Lifen style guides and shared style configs.