danger-samsao 0.2.0 → 0.3.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/.travis/danger.sh +7 -0
- data/.travis.yml +16 -7
- data/CHANGELOG.md +52 -0
- data/Dangerfile +5 -5
- data/Gemfile.lock +2 -2
- data/README.md +209 -56
- data/Rakefile +3 -1
- data/lib/samsao/actions.rb +130 -16
- data/lib/samsao/config.rb +13 -0
- data/lib/samsao/gem_version.rb +1 -1
- data/lib/samsao/helpers.rb +62 -13
- data/lib/samsao/plugin.rb +1 -0
- data/lib/samsao/regexp.rb +10 -6
- data/spec/matchers/have_message.rb +25 -0
- data/spec/matchers/have_no_message.rb +14 -0
- data/spec/samsao_acceptance_criteria_spec.rb +54 -0
- data/spec/samsao_branching_model_spec.rb +3 -3
- data/spec/samsao_changelog_updated_spec.rb +8 -8
- data/spec/samsao_config_spec.rb +28 -0
- data/spec/samsao_feature_jira_issue_number_spec.rb +72 -0
- data/spec/samsao_feature_single_commit_spec.rb +3 -3
- data/spec/samsao_fix_jira_issue_number_spec.rb +82 -0
- data/spec/samsao_jira_project_key_spec.rb +37 -0
- data/spec/samsao_label_pr_spec.rb +51 -0
- data/spec/samsao_merge_commit_detected_spec.rb +5 -17
- data/spec/samsao_report_spec.rb +45 -0
- data/spec/samsao_shorten_sha_spec.rb +26 -0
- data/spec/samsao_truncate_spec.rb +36 -0
- data/spec/samsao_work_in_progress_pr_spec.rb +4 -4
- data/spec/spec_helper.rb +15 -0
- metadata +24 -5
- data/bitrise.wrapper.yml +0 -51
- data/bitrise.yml +0 -80
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03220a151b794360af987c44251ffd233e149fa6
|
4
|
+
data.tar.gz: '081d457757e6ca7108968cbdf1c35656222e4b7e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cce010f0f2cc393b5be15c1e509988724903093eb85fd4128a2c4a53bb566c654dd19e056bb7c309b9c20bb628873c76f13db3a826f5ac9f580253f43996d1c
|
7
|
+
data.tar.gz: 931219f4890eaf3d817b1a29437987ed974c06dd3dcd6075ef8d10bc86a13b3d4c2d793a03e684f62b1b7591f5e74ff20a89926d60a055884664f4612ebe0d26
|
data/.travis/danger.sh
ADDED
data/.travis.yml
CHANGED
@@ -1,12 +1,21 @@
|
|
1
1
|
language: ruby
|
2
|
-
cache:
|
3
|
-
directories:
|
4
|
-
- bundle
|
2
|
+
cache: bundler
|
5
3
|
|
6
4
|
rvm:
|
7
|
-
- 2.
|
8
|
-
- 2.
|
9
|
-
- 2.
|
5
|
+
- 2.2.7
|
6
|
+
- 2.3.4
|
7
|
+
- 2.4.1
|
10
8
|
|
11
9
|
script:
|
12
|
-
|
10
|
+
- .travis/danger.sh
|
11
|
+
|
12
|
+
- echo 'Linting...'
|
13
|
+
- bundle exec rake lint
|
14
|
+
|
15
|
+
- echo 'Test...'
|
16
|
+
- bundle exec rake tests
|
17
|
+
|
18
|
+
branches:
|
19
|
+
only:
|
20
|
+
- master
|
21
|
+
- develop
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,55 @@
|
|
1
|
+
## 0.3.0 (August 23, 2017)
|
2
|
+
|
3
|
+
### Breaking Changes
|
4
|
+
|
5
|
+
* Renamed the following methods to match the `level` parameter they now optionally receive:
|
6
|
+
* `fail_when_wrong_branching_model` to `check_wrong_branching_model`
|
7
|
+
* `fail_when_non_single_commit_feature` to `check_non_single_commit_feature`
|
8
|
+
* `fail_when_changelog_update_missing` to `check_changelog_update_missing`
|
9
|
+
* `fail_when_merge_commit_detected` to `check_merge_commit_detected`
|
10
|
+
* `warn_when_work_in_progess_pr` to `check_work_in_progess_pr`
|
11
|
+
|
12
|
+
#### Features
|
13
|
+
|
14
|
+
* Added `level` parameter to all actions to personnalize the report level
|
15
|
+
(`:fail`, `:warn`, `:message`) if the check fails.
|
16
|
+
|
17
|
+
* Added `have_message` and `have_no_message` matchers.
|
18
|
+
|
19
|
+
* Added `check_label_pr` action.
|
20
|
+
|
21
|
+
* Added `check_acceptance_criteria` action.
|
22
|
+
|
23
|
+
* Added `check_feature_jira_issue_number` action.
|
24
|
+
|
25
|
+
* Added `check_fix_jira_issue_number` action.
|
26
|
+
|
27
|
+
* Added `contains_jira_issue_number?` helper.
|
28
|
+
|
29
|
+
* Added `jira_project_key?` helper.
|
30
|
+
|
31
|
+
* Added `shorten_sha` helper.
|
32
|
+
|
33
|
+
* Added `truncate` helper.
|
34
|
+
|
35
|
+
*
|
36
|
+
|
37
|
+
*
|
38
|
+
|
39
|
+
*
|
40
|
+
|
41
|
+
*
|
42
|
+
|
43
|
+
*
|
44
|
+
|
45
|
+
#### Support
|
46
|
+
|
47
|
+
* Fixed grammatical errors in the `README.md`.
|
48
|
+
|
49
|
+
#### Support
|
50
|
+
|
51
|
+
* Open source repository and now using Travis as the build system.
|
52
|
+
|
1
53
|
## 0.2.0 (May 9, 2017)
|
2
54
|
|
3
55
|
#### Breaking Changes
|
data/Dangerfile
CHANGED
@@ -7,13 +7,13 @@ samsao.config do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
## Errors
|
10
|
-
samsao.
|
11
|
-
samsao.
|
12
|
-
samsao.
|
13
|
-
samsao.
|
10
|
+
samsao.check_changelog_update_missing
|
11
|
+
samsao.check_merge_commit_detected
|
12
|
+
samsao.check_non_single_commit_feature
|
13
|
+
samsao.check_wrong_branching_model
|
14
14
|
|
15
15
|
## Warnings
|
16
|
-
samsao.
|
16
|
+
samsao.check_work_in_progess_pr
|
17
17
|
|
18
18
|
## Messages
|
19
19
|
unless status_report[:errors].empty?
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Danger Samsao
|
1
|
+
# Danger Samsao [](https://travis-ci.org/samsao/danger-samsao)
|
2
2
|
|
3
3
|
A Danger plugin bringing Samsao's PR guideline into code.
|
4
4
|
|
@@ -18,13 +18,13 @@ samsao.config do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
## Errors
|
21
|
-
samsao.
|
22
|
-
samsao.
|
23
|
-
samsao.
|
24
|
-
samsao.
|
21
|
+
samsao.check_changelog_update_missing
|
22
|
+
samsao.check_merge_commit_detected
|
23
|
+
samsao.check_non_single_commit_feature
|
24
|
+
samsao.check_wrong_branching_model
|
25
25
|
|
26
26
|
## Warnings
|
27
|
-
samsao.
|
27
|
+
samsao.check_work_in_progess_pr
|
28
28
|
|
29
29
|
## Messages
|
30
30
|
unless status_report[:errors].empty?
|
@@ -41,20 +41,34 @@ your `Dangerfile` under the `samsao` namespace.
|
|
41
41
|
### Table of Contents
|
42
42
|
|
43
43
|
* [Config](#config)
|
44
|
+
* [Changelogs](#changelogs)
|
45
|
+
* [Jira Project Key](#jira-project-key)
|
46
|
+
* [Project Type](#project-type)
|
47
|
+
* [Sources](#sources)
|
44
48
|
* [Actions](#actions)
|
45
|
-
* [
|
46
|
-
* [samsao.
|
47
|
-
* [samsao.
|
48
|
-
* [samsao.
|
49
|
-
* [samsao.
|
49
|
+
* [Report Levels](#report-levels)
|
50
|
+
* [samsao.check_acceptance_criteria](#acceptance-criteria)
|
51
|
+
* [samsao.check_changelog_update_missing](#changelog-update-missing)
|
52
|
+
* [samsao.check_feature_jira_issue_number](#feature-jira-issue-number)
|
53
|
+
* [samsao.check_fix_jira_issue_number](#fix-jira-issue-number)
|
54
|
+
* [samsao.check_label_pr](#label_pr)
|
55
|
+
* [samsao.check_merge_commit_detected](#merge-commits-detected)
|
56
|
+
* [samsao.check_non_single_commit_feature](#feature-branch-multiple-commits)
|
57
|
+
* [samsao.check_wrong_branching_model](#branching-model)
|
58
|
+
* [samsao.check_work_in_progess_pr](#when-work-in-progess-pr)
|
50
59
|
* [Helpers](#helpers)
|
51
60
|
* [samsao.changelog_modified?](#changelog-modified)
|
61
|
+
* [samsao.contains_any_jira_issue_number?](#contains-any-jira-issue-number)
|
62
|
+
* [samsao.contains_single_jira_issue_number?](#contains-single-jira-issue-number)
|
52
63
|
* [samsao.feature_branch?](#feature-branch)
|
53
64
|
* [samsao.fix_branch?](#fix-branch)
|
54
65
|
* [samsao.has_app_changes?](#has-app-changes)
|
66
|
+
* [samsao.jira_project_key?](#has-jira-project-key)
|
55
67
|
* [samsao.release_branch?](#release-branch)
|
68
|
+
* [samsao.shorten_sha](#shorten-sha)
|
56
69
|
* [samsao.support_branch?](#support-branch)
|
57
70
|
* [samsao.trivial_change?](#trivial-change)
|
71
|
+
* [samsao.truncate](#truncate)
|
58
72
|
|
59
73
|
### Config
|
60
74
|
|
@@ -63,7 +77,8 @@ easier. This is done by using the `config` attributes the plugin:
|
|
63
77
|
|
64
78
|
```
|
65
79
|
samsao.config do
|
66
|
-
changelogs 'CHANGELOG.
|
80
|
+
changelogs 'CHANGELOG.md'
|
81
|
+
jira_project_key 'VER'
|
67
82
|
project_type :library
|
68
83
|
sources 'app/src'
|
69
84
|
end
|
@@ -73,17 +88,30 @@ end
|
|
73
88
|
|
74
89
|
Defaults: `[CHANGELOG.md]`
|
75
90
|
|
76
|
-
Enable to change the CHANGELOG file paths looked upon when checking if
|
77
|
-
|
91
|
+
Enable to change the CHANGELOG file paths looked upon when checking if CHANGELOG
|
92
|
+
file has been modified or not.
|
93
|
+
|
94
|
+
#### Jira Project Key
|
95
|
+
|
96
|
+
Defaults: nil
|
97
|
+
|
98
|
+
Example: `VER`
|
99
|
+
|
100
|
+
This refers to the project key on Jira. This settings affects these actions and helpers:
|
101
|
+
|
102
|
+
* [samsao.check_feature_jira_issue_number](#feature-jira-issue-number)
|
103
|
+
* [samsao.check_fix_jira_issue_number](#fix-jira-issue-number)
|
104
|
+
|
105
|
+
See the exact actions or helpers for precise details about implications.
|
78
106
|
|
79
107
|
#### Project Type
|
80
108
|
|
81
109
|
Defaults: `:application`
|
82
110
|
|
83
|
-
Change the kind of project
|
84
|
-
|
111
|
+
Change the kind of project you are currently developing. This settings affects
|
112
|
+
these actions and helpers:
|
85
113
|
|
86
|
-
* [samsao.
|
114
|
+
* [samsao.check_when_changelog_update_missing](#changelog-update-missing)
|
87
115
|
|
88
116
|
See the exact actions or helpers for precise details about implications.
|
89
117
|
|
@@ -91,8 +119,8 @@ See the exact actions or helpers for precise details about implications.
|
|
91
119
|
|
92
120
|
Default: `[]`
|
93
121
|
|
94
|
-
Enable to change which paths are considered
|
95
|
-
|
122
|
+
Enable to change which paths are considered as being source files of the project.
|
123
|
+
Multiple entries can be passed. Accepts multiple entries to be passed:
|
96
124
|
|
97
125
|
```
|
98
126
|
samsao.config do
|
@@ -106,7 +134,7 @@ Each source entry can be a `Regexp`
|
|
106
134
|
sources /^(common|mobile|web|/src)/
|
107
135
|
```
|
108
136
|
|
109
|
-
Or a pure `String`. When a pure string, matches start of git modified files list:
|
137
|
+
Or a pure `String`. When a pure string, matches the start of git modified files list:
|
110
138
|
|
111
139
|
```
|
112
140
|
sources 'common/src'
|
@@ -116,18 +144,51 @@ Would match `common/src/a/b.txt` but not `other/common/src/a/b.txt`.
|
|
116
144
|
|
117
145
|
### Actions
|
118
146
|
|
119
|
-
Here all the actions you can call in your own `Dangerfile` and how to
|
120
|
-
|
147
|
+
Here all the actions you can call in your own `Dangerfile` and how to configure them.
|
148
|
+
|
149
|
+
#### Report Levels
|
150
|
+
|
151
|
+
Each action as a `level` parameter that can be set to fail, warn or simply write
|
152
|
+
a message if the check fails. Each action also has a default value for the check.
|
153
|
+
|
154
|
+
The possible values for `level` are the following:
|
155
|
+
* `:fail`
|
156
|
+
* `:warn`
|
157
|
+
* `:message`
|
158
|
+
|
159
|
+
For example since `check_wrong_branching_model` has the default value of `:fail`.
|
160
|
+
If you don't want this check to reject your PR, you can overwrite it by writing :
|
161
|
+
|
162
|
+
```
|
163
|
+
samsao.check_wrong_branching_model :warn
|
164
|
+
```
|
165
|
+
|
166
|
+
Note that only a `:fail` will reject the PR.
|
167
|
+
|
168
|
+
#### Acceptance Criteria
|
169
|
+
|
170
|
+
```
|
171
|
+
samsao.check_acceptance_criteria(level = :warn)
|
172
|
+
```
|
173
|
+
|
174
|
+
Parameters:
|
175
|
+
* `level` | The [report level](#report-levels) to use when the check does not pass.
|
176
|
+
|
177
|
+
Check if it's a feature branch (starts with `feature/`) and if the PR body contains
|
178
|
+
the string `acceptance criteria`.
|
121
179
|
|
122
180
|
#### Branching Model
|
123
181
|
|
124
182
|
```
|
125
|
-
samsao.
|
183
|
+
samsao.check_wrong_branching_model(level = :fail)
|
126
184
|
```
|
127
185
|
|
128
|
-
|
129
|
-
|
130
|
-
|
186
|
+
Parameters:
|
187
|
+
* `level` | The [report level](#report-levels) to use when the check does not pass.
|
188
|
+
|
189
|
+
Check if the branch does not respect the git branching model. We follow git flow
|
190
|
+
branching model and if the branch name does not start with one of the following
|
191
|
+
prefixes:
|
131
192
|
|
132
193
|
* `fix/`
|
133
194
|
* `bugfix/`
|
@@ -139,47 +200,96 @@ name does not start with one of the following prefixes:
|
|
139
200
|
#### CHANGELOG Update Missing
|
140
201
|
|
141
202
|
```
|
142
|
-
samsao.
|
203
|
+
samsao.check_changelog_update_missing(level = :fail)
|
204
|
+
```
|
205
|
+
|
206
|
+
Parameters:
|
207
|
+
* `level` | The [report level](#report-levels) to use when the check does not pass.
|
208
|
+
|
209
|
+
Check if when a PR is made that is not flagged as a [trivial change](#trivial-change)
|
210
|
+
and the changelog (based on `changelogs` config options) has not been modified.
|
211
|
+
|
212
|
+
When the project is of type `:application`, a change made to a [support branch]
|
213
|
+
(#support-branch) will pass even if the changelog is not updated.
|
214
|
+
|
215
|
+
#### Label PR
|
216
|
+
|
217
|
+
```
|
218
|
+
samsao.check_label_pr(level = :fail)
|
143
219
|
```
|
144
220
|
|
145
|
-
|
146
|
-
|
147
|
-
`changelogs` config options) has not been modified.
|
221
|
+
Parameters:
|
222
|
+
* `level` | The [report level](#report-levels) to use when the check does not pass.
|
148
223
|
|
149
|
-
|
150
|
-
branch](#support-branch) will not trigger a failure even if the changelog
|
151
|
-
is not updated.
|
224
|
+
Check if the PR has at least one label added to it.
|
152
225
|
|
153
226
|
#### Feature Branch Multiple Commits
|
154
227
|
|
155
228
|
```
|
156
|
-
samsao.
|
229
|
+
samsao.check_non_single_commit_feature(level = :fail)
|
157
230
|
```
|
158
231
|
|
159
|
-
|
160
|
-
|
232
|
+
Parameters:
|
233
|
+
* `level` | The [report level](#report-levels) to use when the check does not pass.
|
234
|
+
|
235
|
+
Check if it's a feature branch (starts with `feature/`) and the PR contains more
|
236
|
+
than one commit.
|
237
|
+
|
238
|
+
#### Feature Jira Issue Number
|
239
|
+
|
240
|
+
```
|
241
|
+
samsao.check_feature_jira_issue_number(level = :fail)
|
242
|
+
```
|
243
|
+
|
244
|
+
Parameters:
|
245
|
+
* `level` | The [report level](#report-levels) to use when the check does not pass.
|
246
|
+
|
247
|
+
Check if it's a feature branch (starts with `feature/`) and the PR title contains the
|
248
|
+
issue number using your configuration's [jira project key](#jira-project-key).
|
249
|
+
|
250
|
+
Example : `[VER-123] Adding new screen.`
|
251
|
+
|
252
|
+
#### Fix Jira Issue Number
|
253
|
+
|
254
|
+
```
|
255
|
+
samsao.check_fix_jira_issue_number(level = :warn)
|
256
|
+
```
|
257
|
+
|
258
|
+
Parameters:
|
259
|
+
* `level` | The [report level](#report-levels) to use when the check does not pass.
|
260
|
+
|
261
|
+
Check if it's a feature branch (starts with `fix/`, `bugfix/` or `hotfix/`.) and if every
|
262
|
+
commit message contains any issue number using your configuration's [jira project key](#jira-project-key).
|
263
|
+
|
264
|
+
Example : `[VER-123, VER-124, VER-125] Bug fixes.`
|
161
265
|
|
162
266
|
#### Merge Commit(s) Detected
|
163
267
|
|
164
268
|
```
|
165
|
-
samsao.
|
269
|
+
samsao.check_merge_commit_detected(level = :fail)
|
166
270
|
```
|
167
271
|
|
168
|
-
|
272
|
+
Parameters:
|
273
|
+
* `level` | The [report level](#report-levels) to use when the check does not pass.
|
274
|
+
|
275
|
+
Check if one or multiple merge commits are detected.
|
276
|
+
|
169
277
|
A merge commit is one created when merging two branches and matching the
|
170
278
|
regexp `^Merge branch '<base branch>'` where `<base branch>` is the branch
|
171
279
|
the PR is being merged into (usually `develop`).
|
172
280
|
|
173
|
-
Use a Git `rebase` to get rid of those commits and correctly sync up with
|
174
|
-
`develop` branch.
|
281
|
+
Use a Git `rebase` to get rid of those commits and correctly sync up with `develop` branch.
|
175
282
|
|
176
283
|
#### Work in Progress PR
|
177
284
|
|
178
285
|
```
|
179
|
-
samsao.
|
286
|
+
samsao.check_work_in_progess_pr(level = :warn)
|
180
287
|
```
|
181
288
|
|
182
|
-
|
289
|
+
Parameters:
|
290
|
+
* `level` | The [report level](#report-levels) to use when the check does not pass.
|
291
|
+
|
292
|
+
Check if the PR title contains the `[WIP]` marker
|
183
293
|
|
184
294
|
### Helpers
|
185
295
|
|
@@ -189,24 +299,22 @@ Going to mark PR as in warning state when PR title contains the `[WIP]` marker
|
|
189
299
|
samsao.changelog_modified?
|
190
300
|
```
|
191
301
|
|
192
|
-
When no arguments are given, returns true if any configured [changelogs](#changelogs)
|
193
|
-
been modified in this commit.
|
302
|
+
When no arguments are given, returns true if any configured [changelogs](#changelogs)
|
303
|
+
has been modified in this commit.
|
194
304
|
|
195
|
-
When one or more arguments
|
196
|
-
modified in this commit.
|
305
|
+
When one or more arguments are given, returns true if any given changelog entry
|
306
|
+
file has been modified in this commit.
|
197
307
|
|
198
|
-
####
|
308
|
+
#### Contains Jira Issue Number?
|
199
309
|
|
200
310
|
```
|
201
|
-
samsao.
|
311
|
+
samsao.contains_jira_issue_number?(input)
|
202
312
|
```
|
203
313
|
|
204
|
-
|
205
|
-
|
314
|
+
Return true if input contains the issue number using your configuration's
|
315
|
+
[jira project key](#jira-project-key). The input could be a PR title or a commit message.
|
206
316
|
|
207
|
-
|
208
|
-
section for details) and returns true if any given source entry files has been modified in this
|
209
|
-
commit.
|
317
|
+
Example : `[VER-123] Adding new screen.` or `[VER-123, VER-124, VER-125] Bug fixes.`
|
210
318
|
|
211
319
|
#### Feature Branch?
|
212
320
|
|
@@ -224,6 +332,27 @@ samsao.fix_branch?
|
|
224
332
|
|
225
333
|
Returns true if the PR branch starts with `fix/`, `bugfix/` or `hotfix/`.
|
226
334
|
|
335
|
+
#### Has App Changes?
|
336
|
+
|
337
|
+
```
|
338
|
+
samsao.has_app_changes?
|
339
|
+
```
|
340
|
+
|
341
|
+
When no arguments are given, returns true if any configured [source files](#sources)
|
342
|
+
has been modified in this commit.
|
343
|
+
|
344
|
+
When one or more arguments are given, uses same rules as for [source files](#sources)
|
345
|
+
(see section for details) and returns true if any given source entry files have
|
346
|
+
been modified in this commit.
|
347
|
+
|
348
|
+
#### Has Jira Project Key?
|
349
|
+
|
350
|
+
```
|
351
|
+
samsao.jira_project_key?
|
352
|
+
```
|
353
|
+
|
354
|
+
Return true if the config has a [jira project key](#jira-project-key).
|
355
|
+
|
227
356
|
#### Release Branch?
|
228
357
|
|
229
358
|
```
|
@@ -232,6 +361,17 @@ samsao.release_branch?
|
|
232
361
|
|
233
362
|
Returns true if the PR branch starts with `release/`.
|
234
363
|
|
364
|
+
#### Shorten Sha
|
365
|
+
|
366
|
+
```
|
367
|
+
samsao.shorten_sha(sha)
|
368
|
+
```
|
369
|
+
|
370
|
+
Parameters:
|
371
|
+
* `sha` | The sha to shorten.
|
372
|
+
|
373
|
+
Shorten the git sha to 8 characters mostly for readability.
|
374
|
+
|
235
375
|
#### Support Branch?
|
236
376
|
|
237
377
|
```
|
@@ -248,6 +388,19 @@ samsao.trivial_change?
|
|
248
388
|
|
249
389
|
Returns true if the PR title contains `#trivial`, `#typo` or `#typos`.
|
250
390
|
|
391
|
+
#### Truncate
|
392
|
+
|
393
|
+
```
|
394
|
+
samsao.truncate(input, max = 30)
|
395
|
+
```
|
396
|
+
|
397
|
+
Parameters:
|
398
|
+
* `input` | The input to truncate.
|
399
|
+
* `max` | The max length of the truncated input.
|
400
|
+
|
401
|
+
Truncate the input received to the max size passed as a parameter. the default value for
|
402
|
+
the max is 30 characters.
|
403
|
+
|
251
404
|
## Development
|
252
405
|
|
253
406
|
You must have `Ruby` and `Bundler` installed to develop this project as well
|
@@ -310,7 +463,7 @@ on the current commit of the current branch (should be the release commit
|
|
310
463
|
made earlier) named `v0.1.0`. And it will finally push the branch & tag to the
|
311
464
|
repository as well as building and publishing the gem on RubyGems.
|
312
465
|
|
313
|
-
|
466
|
+
The last thing to do is bumping to next development version. Edit back
|
314
467
|
`CHANGELOG.md` so that `## In progress` is the new section header and
|
315
468
|
add a bunch of empty lines (around 10, only 2 shown in the example for
|
316
469
|
brevity) into single `Features` section (add other sections when updating
|
@@ -333,7 +486,7 @@ Also edit `lib/samsao/gem_version.rb` so that next development version
|
|
333
486
|
value is used `VERSION = '0.1.1.pre1'.freeze`. The `.pre1` is the lowest
|
334
487
|
possible version before the official `0.1.1` one (or higher).
|
335
488
|
|
336
|
-
Commit all
|
489
|
+
Commit all these changes together in a new commit that has the following
|
337
490
|
message:
|
338
491
|
|
339
492
|
```
|
@@ -341,5 +494,5 @@ Bumped to next development version
|
|
341
494
|
```
|
342
495
|
|
343
496
|
Finally, create a PR with this branch and open a pull request and merge
|
344
|
-
right away (your
|
497
|
+
right away (your teammates should know in advance that a release is
|
345
498
|
happening and branch merged faster than other ones).
|
data/Rakefile
CHANGED
@@ -11,7 +11,9 @@ task :check => [:lint, :tests]
|
|
11
11
|
task :lint => [:lint_ruby, :lint_danger]
|
12
12
|
|
13
13
|
desc 'Run RuboCop on the lib/specs directory'
|
14
|
-
RuboCop::RakeTask.new(:lint_ruby)
|
14
|
+
RuboCop::RakeTask.new(:lint_ruby) do |task|
|
15
|
+
task.patterns = ['lib/**/*.rb', 'spec/**/*.rb', '*.gemspec', 'Dangerfile', 'Gemfile', 'Guardfile', 'Rakefile']
|
16
|
+
end
|
15
17
|
|
16
18
|
desc 'Ensure that the plugin passes `danger plugins lint`'
|
17
19
|
task :lint_danger do
|