lifen-ruby-style 1.0.0 → 1.0.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 +4 -4
- data/.overcommit.yml +2 -5
- data/README.md +30 -58
- data/default_overcommit.yml +2 -5
- data/lib/lifen/ruby_style/version.rb +1 -1
- data/lifen-ruby-style.gemspec +0 -2
- metadata +2 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9380924908467fe4fe452a0755c80569b75475e8b166cd042a0eb593739dfa39
|
4
|
+
data.tar.gz: 1c76b423b5b15c06539baf770e4a291d13aba7f9d04ab82fdb97c826208aec13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 743a7c56568a5e721006fff6080377ecb53dfad03b91e11085122df8b1be243235350477699d43fce47e594fa4eef9b9e997386c5a5c17462a57928fa972566a
|
7
|
+
data.tar.gz: e4000d1f5fe3d49347c90cbede0e5b8264ea02551784abf699212018c5f969fa6195216ffa76c6b43166e3b777d9ee3d35a3c11fda9a86723b4d892b367f59dd
|
data/.overcommit.yml
CHANGED
@@ -16,8 +16,9 @@
|
|
16
16
|
# Uncomment the following lines to make the configuration take effect.
|
17
17
|
|
18
18
|
PreCommit:
|
19
|
-
|
19
|
+
RuboCop:
|
20
20
|
enabled: true
|
21
|
+
command: ["bundle", "exec", "rubocop"]
|
21
22
|
|
22
23
|
GoFmt:
|
23
24
|
enabled: false
|
@@ -38,10 +39,6 @@ CommitMsg:
|
|
38
39
|
enabled: true
|
39
40
|
on_warn: fail
|
40
41
|
#PreCommit:
|
41
|
-
# RuboCop:
|
42
|
-
# enabled: true
|
43
|
-
# on_warn: fail # Treat all warnings as failures
|
44
|
-
#
|
45
42
|
# TrailingWhitespace:
|
46
43
|
# enabled: true
|
47
44
|
# exclude:
|
data/README.md
CHANGED
@@ -10,17 +10,14 @@
|
|
10
10
|
- [Rubocop-rspec](https://github.com/rubocop-hq/rubocop-rspec) pour l'analyse des tests RSpec
|
11
11
|
- [Rubocop-rails](https://github.com/rubocop-hq/rubocop-rails) pour les vérifications spécifiques à Rails.
|
12
12
|
|
13
|
-
3. [
|
14
|
-
|
15
|
-
4. [Overcommit](https://github.com/sds/overcommit) permet de gérer et paramétrer les hooks Git.
|
13
|
+
3. [Overcommit](https://github.com/sds/overcommit) permet de gérer et paramétrer les hooks Git.
|
16
14
|
|
17
15
|
## Sommaire
|
18
16
|
|
19
17
|
- [Installation](#installation)
|
20
18
|
- [Usage](#usage)
|
21
|
-
- [Rubocop](#rubocop)
|
22
|
-
- [
|
23
|
-
- [Overcommit](#overcommit)
|
19
|
+
- [Rubocop](#commandes-rubocop)
|
20
|
+
- [Overcommit](#commandes-overcommit)
|
24
21
|
- [Utilisation d'une version locale](#utilisation-dune-version-locale)
|
25
22
|
- [Contributions](#contributions)
|
26
23
|
- [TODO](#todo)
|
@@ -28,10 +25,6 @@
|
|
28
25
|
|
29
26
|
## Installation
|
30
27
|
|
31
|
-
<details>
|
32
|
-
|
33
|
-
<summary>Pour un nouveau projet ou un repo Lifen non configuré</summary>
|
34
|
-
|
35
28
|
### 1. Ajout de la gem au projet
|
36
29
|
|
37
30
|
Ajouter dans le `Gemfile` :
|
@@ -58,36 +51,31 @@ inherit_gem:
|
|
58
51
|
- default_rubocop.yml
|
59
52
|
```
|
60
53
|
|
61
|
-
|
62
|
-
|
63
|
-
Créer le fichier `.overcommit.yml` à partir du contenu de [ce fichier](./default_overcommit.yml).
|
64
|
-
|
65
|
-
Note : Il n'est pas nécessaire d'ajouter Rubocop dans les dépendances de l'application.
|
54
|
+
Forcer rubocop à respecter les exclusions définies dans le fichier de paramétrage :
|
66
55
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
56
|
+
```bash
|
57
|
+
$ cd my_project # aller à la racine du projet
|
58
|
+
$ echo '--force-exclusion' > .rubocop
|
59
|
+
```
|
71
60
|
|
72
|
-
###
|
61
|
+
### 3. Config Overcommit
|
73
62
|
|
74
63
|
```bash
|
75
|
-
$
|
64
|
+
$ curl https://raw.githubusercontent.com/honestica/lifen-ruby-style/master/default_overcommit.yml > .overcommit_test.yml
|
76
65
|
```
|
77
66
|
|
78
|
-
|
67
|
+
### 4. Installer les dépendances
|
68
|
+
|
79
69
|
```bash
|
80
|
-
|
70
|
+
$ bundle install
|
81
71
|
```
|
82
72
|
|
83
|
-
###
|
73
|
+
### 5. Installer les hooks Git
|
84
74
|
|
85
75
|
```bash
|
86
76
|
$ bundle exec overcommit --install
|
87
77
|
```
|
88
78
|
|
89
|
-
</details>
|
90
|
-
|
91
79
|
<details>
|
92
80
|
<summary>Recommandations spécifiques pour VSCode</summary>
|
93
81
|
|
@@ -128,6 +116,7 @@ $ bundle exec overcommit --install
|
|
128
116
|
- **FORCER RUBOCOP À RESPECTER LES EXCLUSIONS DÉFINIES DANS LE FICHIER DE PARAMÉTRAGE :**
|
129
117
|
|
130
118
|
```bash
|
119
|
+
$ cd my_project # aller à la racine du projet
|
131
120
|
$ echo '--force-exclusion' > .rubocop
|
132
121
|
```
|
133
122
|
|
@@ -161,7 +150,9 @@ $ bundle exec overcommit --install
|
|
161
150
|
<summary>Recommandations spécifiques pour Sublime Text</summary>
|
162
151
|
|
163
152
|
### Configuration de Sublime Text
|
153
|
+
|
164
154
|
Il faut aller dans `Preferences > Settings` et modifier le fichier `Preferences.sublime-settings -- User` et y ajouter les paramètres suivants :
|
155
|
+
|
165
156
|
```json
|
166
157
|
{
|
167
158
|
...,
|
@@ -179,10 +170,13 @@ Il faut aller dans `Preferences > Settings` et modifier le fichier `Preferences.
|
|
179
170
|
```
|
180
171
|
|
181
172
|
### Configuration de Rubocop
|
173
|
+
|
182
174
|
#### 1. Installation du plugin
|
175
|
+
|
183
176
|
Il faut installer l'extension [sublime_rubocop](https://packagecontrol.io/packages/RuboCop)
|
184
177
|
|
185
178
|
Et tout devrait marcher par défaut si votre système n'utilise pas rvm ou rbenv. Le cas échéant il faut personnaliser la configuration en allant dans `Preferences > Package Settings > Rubocop > Settings - User` et mettre la configuration qui va bien dans le fichier, par exemple ceci si vous utilisez Rbenv :
|
179
|
+
|
186
180
|
```
|
187
181
|
{
|
188
182
|
"check_for_rvm": false,
|
@@ -192,7 +186,9 @@ Et tout devrait marcher par défaut si votre système n'utilise pas rvm ou rbenv
|
|
192
186
|
```
|
193
187
|
|
194
188
|
#### 2. Utilisation
|
189
|
+
|
195
190
|
Une fois le plugin installé vous accéderez à des commandes supplémentaires liées à Rubocop et vous pourrez par exemple :
|
191
|
+
|
196
192
|
- Corriger automatiquement des fichiers
|
197
193
|
- Activer/Désactiver l'auto-check des fichiers
|
198
194
|
|
@@ -255,10 +251,10 @@ https://github.com/dense-analysis/ale
|
|
255
251
|
|
256
252
|
- Je code ma feature en local. Mon environnement (projet + IDE) étant configuré, je suis alerté en direct des règles de style que j'enfreins. Certaines sont mêmes corrigées automatiquement, lors de la sauvegarde du fichier.
|
257
253
|
- Je commit :
|
258
|
-
- Un hook de pre-commit lance une analyse
|
254
|
+
- Un hook de pre-commit lance une analyse RuboCop sur les fichiers "staged". Si l'analye renvoie des erreurs, le commit est bloqué.
|
259
255
|
- Un hook vérifie le message de commit
|
260
256
|
- Si je veux bypasser les hooks (déconseillé) : `OVERCOMMIT_DISABLE=1 git commit ...`
|
261
|
-
- Je push (pas de hooks paramétrés pour l'instant)
|
257
|
+
- Je push (pas de hooks de pre-push paramétrés pour l'instant)
|
262
258
|
|
263
259
|
### Commandes Rubocop
|
264
260
|
|
@@ -286,28 +282,6 @@ Liste des commandes disponibles :
|
|
286
282
|
$ bundle exec rubocop --help
|
287
283
|
```
|
288
284
|
|
289
|
-
### Commandes Pronto
|
290
|
-
|
291
|
-
```bash
|
292
|
-
$ bundle exec pronto run [PATH] # Runs Pronto on the diff between last commit and master
|
293
|
-
```
|
294
|
-
|
295
|
-
Vous pouvez ajouter les options suivantes :
|
296
|
-
|
297
|
-
```bash
|
298
|
-
-c, [--commit=COMMIT] # Runs Pronto on the diff between last commit and specified commit
|
299
|
-
-i, --index # Analyze changes not staged for commit (does not include untracked files)
|
300
|
-
--unstaged, --no-unstaged # Analyze only untracked files
|
301
|
-
--staged, --no-staged # Analyze changes to be committed (git staging area)
|
302
|
-
```
|
303
|
-
|
304
|
-
Liste des commandes disponibles :
|
305
|
-
|
306
|
-
```bash
|
307
|
-
$ bundle exec pronto --help
|
308
|
-
$ bundle exec pronto help run
|
309
|
-
```
|
310
|
-
|
311
285
|
### Commandes Overcommit
|
312
286
|
|
313
287
|
```bash
|
@@ -352,7 +326,7 @@ Pour utiliser une version locale de la gem `lifen-ruby-style` :
|
|
352
326
|
|
353
327
|
- Créer le fichier `.overcommit.yml` et coller le contenu du fichier `lifen-ruby-style/default_overcommit.yml`
|
354
328
|
|
355
|
-
- Installer les
|
329
|
+
- Installer les dépendances et les hooks Git :
|
356
330
|
|
357
331
|
```bash
|
358
332
|
$ bundle install
|
@@ -377,14 +351,12 @@ Vous allez vouloir tester localement les modifications de règle de style que vo
|
|
377
351
|
|
378
352
|
## TODO
|
379
353
|
|
380
|
-
[ ] Recommandations spécifiques pour Sublime Text
|
381
|
-
[ ] Lier la configuration d'overcommit aux repos
|
382
|
-
[ ] Ajouter un hook de pre-push ?
|
383
354
|
[ ] Ajouter le hook de pre-commit au CI
|
384
|
-
[ ] Ajouter
|
385
|
-
[ ] Ajouter `
|
386
|
-
[ ] Ajouter `
|
387
|
-
[ ] Ajouter `
|
355
|
+
[ ] Ajouter un hook de pre-push ?
|
356
|
+
[ ] Ajouter `fasterer` si pertinent
|
357
|
+
[ ] Ajouter `reek` si pertinent
|
358
|
+
[ ] Ajouter `slim_lint` si pertinent
|
359
|
+
[ ] Ajouter `scss` si pertinent
|
388
360
|
|
389
361
|
## Archives
|
390
362
|
|
data/default_overcommit.yml
CHANGED
@@ -16,8 +16,9 @@
|
|
16
16
|
# Uncomment the following lines to make the configuration take effect.
|
17
17
|
|
18
18
|
PreCommit:
|
19
|
-
|
19
|
+
RuboCop:
|
20
20
|
enabled: true
|
21
|
+
command: ["bundle", "exec", "rubocop"]
|
21
22
|
|
22
23
|
GoFmt:
|
23
24
|
enabled: false
|
@@ -38,10 +39,6 @@ CommitMsg:
|
|
38
39
|
enabled: true
|
39
40
|
on_warn: fail
|
40
41
|
#PreCommit:
|
41
|
-
# RuboCop:
|
42
|
-
# enabled: true
|
43
|
-
# on_warn: fail # Treat all warnings as failures
|
44
|
-
#
|
45
42
|
# TrailingWhitespace:
|
46
43
|
# enabled: true
|
47
44
|
# exclude:
|
data/lifen-ruby-style.gemspec
CHANGED
@@ -30,8 +30,6 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.require_paths = ['lib']
|
31
31
|
|
32
32
|
spec.add_dependency 'overcommit'
|
33
|
-
spec.add_dependency 'pronto', '~> 0.1'
|
34
|
-
spec.add_dependency 'pronto-rubocop', '~> 0.1'
|
35
33
|
spec.add_dependency 'rubocop', '~> 0.8'
|
36
34
|
spec.add_dependency 'rubocop-performance', '~> 1.5'
|
37
35
|
spec.add_dependency 'rubocop-rails', '~> 2.4'
|
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
|
+
version: 1.0.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-03-
|
11
|
+
date: 2020-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: overcommit
|
@@ -24,34 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: pronto
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0.1'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0.1'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: pronto-rubocop
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0.1'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0.1'
|
55
27
|
- !ruby/object:Gem::Dependency
|
56
28
|
name: rubocop
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|