danger-changelog 0.2.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62a09a0c16544a38bdb2f23068ddb753f1a24703
4
- data.tar.gz: 077e72cdb5c66ce5d29643b032e06ba438547a16
3
+ metadata.gz: 2c5eeec21291e0eb25ee5e280fe7393a66252c67
4
+ data.tar.gz: 8510e7675961b8f22d4f699f10265e5be96f5fa8
5
5
  SHA512:
6
- metadata.gz: 414bd4bb565ccf6600026349257d196535085eaa323720684c829096a1ee212bb4ca85c929f7260ddf040154dc5535aee90a9da9399b8a66cde9d4bd14d333f6
7
- data.tar.gz: 434139ee0112b04ff2696113f71750f116010a7d29b70b72ae0217399fb063b659f2f2156300e2cd1c8abf8170bd7becaa3c97bf2919e993d2a301fa0a717085
6
+ metadata.gz: f60db0f98dd9fc1d2f1162e5887c155cc29fb46cc34feaa6ee9e271f899524cd5948645d909d415fa3d75a7a700269085eaf84c670a2aba43aa6a5cf20ef1284
7
+ data.tar.gz: ee1d7eb7daec2871f844c4620c0f04c5b35a4a34053aef19946d147826599de335397d35b47ddaa19557600bac259a34b32b3dc52a48d0cb2822697b5de1282b
@@ -4,4 +4,10 @@ AllCops:
4
4
  Exclude:
5
5
  - vendor/**/*
6
6
 
7
+ Metrics/BlockLength:
8
+ Exclude:
9
+ - 'Rakefile'
10
+ - '**/*.rake'
11
+ - 'spec/**/*.rb'
12
+
7
13
  inherit_from: .rubocop_todo.yml
@@ -1,31 +1,65 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2016-11-21 18:59:46 -0500 using RuboCop version 0.43.0.
3
+ # on 2018-02-06 12:42:54 -0500 using RuboCop version 0.52.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
+ # Offense count: 2
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: EnforcedStyle.
12
+ # SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
13
+ Layout/IndentHeredoc:
14
+ Exclude:
15
+ - 'lib/changelog/plugin.rb'
16
+
9
17
  # Offense count: 1
10
- Metrics/AbcSize:
11
- Max: 19
18
+ Lint/DuplicateMethods:
19
+ Exclude:
20
+ - 'lib/changelog/config.rb'
12
21
 
13
- # Offense count: 40
14
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
15
- # URISchemes: http, https
16
- Metrics/LineLength:
17
- Max: 254
22
+ # Offense count: 1
23
+ Lint/InterpolationCheck:
24
+ Exclude:
25
+ - 'lib/changelog/changelog_line/changelog_header_line.rb'
26
+
27
+ # Offense count: 1
28
+ Metrics/AbcSize:
29
+ Max: 25
18
30
 
19
31
  # Offense count: 3
20
32
  # Configuration parameters: CountComments.
21
33
  Metrics/MethodLength:
22
34
  Max: 14
23
35
 
24
- # Offense count: 1
36
+ # Offense count: 4
37
+ # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
38
+ # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
39
+ Naming/FileName:
40
+ Exclude:
41
+ - 'Dangerfile'
42
+ - 'Gemfile'
43
+ - 'Guardfile'
44
+ - 'danger-changelog.gemspec'
45
+
46
+ # Offense count: 2
47
+ # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros.
48
+ # NamePrefix: is_, has_, have_
49
+ # NamePrefixBlacklist: is_, has_, have_
50
+ # NameWhitelist: is_a?
51
+ # MethodDefinitionMacros: define_method, define_singleton_method
52
+ Naming/PredicateName:
53
+ Exclude:
54
+ - 'spec/**/*'
55
+ - 'lib/changelog/plugin.rb'
56
+
57
+ # Offense count: 3
25
58
  Style/Documentation:
26
59
  Exclude:
27
60
  - 'spec/**/*'
28
61
  - 'test/**/*'
62
+ - 'lib/changelog/config.rb'
29
63
  - 'lib/changelog/plugin.rb'
30
64
 
31
65
  # Offense count: 3
@@ -33,12 +67,15 @@ Style/DoubleNegation:
33
67
  Exclude:
34
68
  - 'lib/changelog/changelog_file.rb'
35
69
 
36
- # Offense count: 2
37
- # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
38
- # NamePrefix: is_, has_, have_
39
- # NamePrefixBlacklist: is_, has_, have_
40
- # NameWhitelist: is_a?
41
- Style/PredicateName:
70
+ # Offense count: 1
71
+ # Configuration parameters: EnforcedStyle.
72
+ # SupportedStyles: module_function, extend_self
73
+ Style/ModuleFunction:
42
74
  Exclude:
43
- - 'spec/**/*'
44
- - 'lib/changelog/plugin.rb'
75
+ - 'lib/changelog/config.rb'
76
+
77
+ # Offense count: 112
78
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
79
+ # URISchemes: http, https
80
+ Metrics/LineLength:
81
+ Max: 254
@@ -1,5 +1,12 @@
1
1
  ## Changelog
2
2
 
3
+ ### 0.3.0 (5/17/2018)
4
+
5
+ * [#25](https://github.com/dblock/danger-changelog/pull/25): Add information how to configure the plugin in README.md - [@antondomashnev](https://github.com/antondomashnev).
6
+ * [#24](https://github.com/dblock/danger-changelog/pull/24): Added support for custom '* Your contribution here.' line - [@antondomashnev](https://github.com/antondomashnev).
7
+ * [#31](https://github.com/dblock/danger-changelog/pull/31): Stop checking for placeholder line when `Danger::Changelog.config.placeholder_line` is set to `nil` - [@dblock](https://github.com/dblock).
8
+ * [#28](https://github.com/dblock/danger-changelog/issues/28): Improve wording suggesting that CHANGELOG should be updated unless one is improving documentation - [@dblock](https://github.com/dblock).
9
+
3
10
  ### 0.2.1 (12/04/2016)
4
11
 
5
12
  * [#17](https://github.com/dblock/danger-changelog/pull/17): Fix: handle CHANGELOG lines that mistakenly start with a symbol other than * - [@antondomashnev](https://github.com/antondomashnev).
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # danger-changelog
2
2
 
3
- A pull request linter plugin to [danger.systems](http://danger.systems) that enforces CHANGELOG.md O.C.D. in your projects.
4
- This plugin can, for example, make sure the changes are attributes properly and that they are always terminated with a period.
3
+ A plugin for [danger.systems](http://danger.systems) that obsessive-compulsively lints your project’s `CHANGELOG.md`.
4
+ It can make sure, for example, that changes are attributed properly, and that they’re always terminated with a period.
5
5
 
6
6
  [![Gem Version](https://badge.fury.io/rb/danger-changelog.svg)](https://badge.fury.io/rb/danger-changelog)
7
7
  [![Build Status](https://travis-ci.org/dblock/danger-changelog.svg?branch=master)](https://travis-ci.org/dblock/danger-changelog)
@@ -11,15 +11,31 @@ This plugin can, for example, make sure the changes are attributes properly and
11
11
  Add `danger-changelog` to your Gemfile.
12
12
 
13
13
  ```
14
- gem 'danger-changelog', '~> 0.1'
14
+ gem 'danger-changelog', '~> 0.3.0'
15
15
  ```
16
16
 
17
- Add `changelog.check` to your Dangerfile. Make a pull request and see this plugin in action.
17
+ Add `changelog.check` to your `Dangerfile`. Make a pull request and see this plugin in action.
18
18
 
19
19
  ## Usage
20
20
 
21
21
  Methods and attributes from this plugin are available in your `Dangerfile` under the `changelog` namespace.
22
22
 
23
+ ### Configuration
24
+
25
+ You can configure the plugin in `Dangerfile`.
26
+
27
+ ```ruby
28
+ Danger::Changelog.configure do |config|
29
+ config.placeholder_line = "Nothing yet."
30
+ end
31
+ ```
32
+
33
+ The following options are supported.
34
+
35
+ #### placeholder_line
36
+
37
+ Customize the `* Your contribution here.` line. Set the value to `nil` to stop checking for one.
38
+
23
39
  ### changelog.filename
24
40
 
25
41
  Set the CHANGELOG file name, defaults to `CHANGELOG.md`.
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'rubocop/rake_task'
4
4
 
5
5
  RSpec::Core::RakeTask.new(:specs)
6
6
 
7
- task default: [:rubocop, :specs]
7
+ task default: %i[rubocop specs]
8
8
 
9
9
  task :spec do
10
10
  Rake::Task['specs'].invoke
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  lib = File.expand_path('../lib', __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'changelog/gem_version.rb'
@@ -21,12 +20,12 @@ Gem::Specification.new do |spec|
21
20
  spec.add_runtime_dependency 'danger-plugin-api', '~> 1.0'
22
21
 
23
22
  spec.add_development_dependency 'bundler', '~> 1.3'
24
- spec.add_development_dependency 'rake', '~> 10.0'
25
- spec.add_development_dependency 'rspec', '~> 3.4'
26
- spec.add_development_dependency 'rubocop', '~> 0.41'
27
- spec.add_development_dependency 'yard', '~> 0.8'
28
23
  spec.add_development_dependency 'guard', '~> 2.14'
29
24
  spec.add_development_dependency 'guard-rspec', '~> 4.7'
30
25
  spec.add_development_dependency 'listen', '3.0.7'
31
26
  spec.add_development_dependency 'pry'
27
+ spec.add_development_dependency 'rake', '~> 10.0'
28
+ spec.add_development_dependency 'rspec', '~> 3.4'
29
+ spec.add_development_dependency 'rubocop', '~> 0.52.1'
30
+ spec.add_development_dependency 'yard', '~> 0.9.11'
32
31
  end
@@ -24,7 +24,7 @@ module Danger
24
24
  end
25
25
 
26
26
  def bad?
27
- bad_lines? || !your_contribution_here?
27
+ bad_lines? || !(your_contribution_here? || !Danger::Changelog.config.placeholder_line?)
28
28
  end
29
29
 
30
30
  def good?
@@ -7,7 +7,7 @@ module Danger
7
7
  end
8
8
 
9
9
  def self.validates_as_changelog_line?(line)
10
- return true if line == "* Your contribution here.\n"
10
+ return true if line == Danger::Changelog.config.placeholder_line
11
11
  false
12
12
  end
13
13
  end
@@ -0,0 +1,40 @@
1
+ module Danger
2
+ module Changelog
3
+ module Config
4
+ extend self
5
+
6
+ attr_accessor :placeholder_line
7
+
8
+ def placeholder_line=(value)
9
+ if value
10
+ new_value = value
11
+ new_value = "* #{new_value}" unless new_value.start_with?('* ')
12
+ new_value = "#{new_value}\n" unless new_value.end_with?("\n")
13
+ @placeholder_line = new_value
14
+ else
15
+ @placeholder_line = nil
16
+ end
17
+ end
18
+
19
+ def placeholder_line?
20
+ !@placeholder_line.nil?
21
+ end
22
+
23
+ def reset
24
+ self.placeholder_line = "* Your contribution here.\n"
25
+ end
26
+
27
+ reset
28
+ end
29
+
30
+ class << self
31
+ def configure
32
+ block_given? ? yield(Config) : Config
33
+ end
34
+
35
+ def config
36
+ Config
37
+ end
38
+ end
39
+ end
40
+ end
@@ -1,3 +1,3 @@
1
1
  module Changelog
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
@@ -51,12 +51,13 @@ Here's an example of a #{filename} entry:
51
51
  #{Danger::Changelog::ChangelogEntryLine.example(github)}
52
52
  ```
53
53
  MARKDOWN
54
- warn "Unless you're refactoring existing code, please update #{filename}.", sticky: false
54
+ warn "Unless you're refactoring existing code or improving documentation, please update #{filename}.", sticky: false
55
55
  false
56
56
  end
57
57
  end
58
58
 
59
59
  # Is the CHANGELOG.md format correct?
60
+ # @return [boolean]
60
61
  def is_changelog_format_correct?
61
62
  changelog_file = Danger::Changelog::ChangelogFile.new(filename)
62
63
  if changelog_file.exists?
@@ -67,7 +68,7 @@ MARKDOWN
67
68
  MARKDOWN
68
69
  end
69
70
  messaging.fail("One of the lines below found in #{filename} doesn't match the expected format. Please make it look like the other lines, pay attention to periods and spaces.", sticky: false) if changelog_file.bad_lines?
70
- messaging.fail("Please put back the `* Your contribution here.` line into #{filename}.", sticky: false) unless changelog_file.your_contribution_here?
71
+ messaging.fail("Please put back the `#{Danger::Changelog.config.placeholder_line.chomp}` line into #{filename}.", sticky: false) unless changelog_file.your_contribution_here? || !Danger::Changelog.config.placeholder_line?
71
72
  changelog_file.good?
72
73
  else
73
74
  messaging.fail("The #{filename} file does not exist.", sticky: false)
@@ -4,4 +4,5 @@ require 'changelog/changelog_line/changelog_line_parser'
4
4
  require 'changelog/changelog_line/changelog_placeholder_line'
5
5
  require 'changelog/changelog_line/changelog_line'
6
6
  require 'changelog/changelog_file'
7
+ require 'changelog/config'
7
8
  require 'changelog/plugin'
@@ -1,56 +1,67 @@
1
1
  require File.expand_path('../spec_helper', __FILE__)
2
2
 
3
3
  describe Danger::Changelog::ChangelogPlaceholderLine do
4
- context 'changelog line' do
5
- it 'validates as changelog line' do
6
- expect(described_class.validates_as_changelog_line?("* Your contribution here.\n")).to be true
4
+ context 'with a custom placeholder line' do
5
+ before do
6
+ Danger::Changelog.configure do |config|
7
+ config.placeholder_line = "* Nothing yet here.\n"
8
+ end
7
9
  end
8
10
 
9
- it 'doesnt validate as changelog line' do
10
- expect(described_class.validates_as_changelog_line?('* Your contribution here.')).to be false
11
- expect(described_class.validates_as_changelog_line?("* Your contribution here\n")).to be false
12
- expect(described_class.validates_as_changelog_line?("* Put your contribution here.\n")).to be false
13
- expect(described_class.validates_as_changelog_line?("Your contribution here.\n")).to be false
11
+ describe 'validates_as_changelog_line?' do
12
+ context 'when line is equal to placeholder_line from config' do
13
+ it 'validates as changelog line' do
14
+ expect(described_class.validates_as_changelog_line?("* Nothing yet here.\n")).to be true
15
+ end
16
+ end
17
+
18
+ context 'when line is not equal to placeholder_line from config' do
19
+ it 'validates as changelog line' do
20
+ expect(described_class.validates_as_changelog_line?("* Put your contribution here.\n")).to be false
21
+ end
22
+ end
14
23
  end
15
24
 
16
- context 'changelog placeholder line' do
17
- context 'when exactly expected string' do
18
- subject { Danger::Changelog::ChangelogPlaceholderLine.new("* Your contribution here.\n") }
25
+ describe 'valid?' do
26
+ context 'when is equal to config placeholder line' do
27
+ subject { Danger::Changelog::ChangelogPlaceholderLine.new("* Nothing yet here.\n") }
19
28
 
20
29
  it 'is valid' do
21
30
  expect(subject.valid?).to be true
22
31
  end
23
32
  end
24
33
 
25
- context 'when without new line' do
26
- subject { Danger::Changelog::ChangelogPlaceholderLine.new('* Your contribution here.') }
34
+ context 'when is not equal to config placeholder line' do
35
+ subject { Danger::Changelog::ChangelogPlaceholderLine.new("* Your change here.\n") }
27
36
 
28
- it 'is invalid' do
29
- expect(subject.invalid?).to be true
37
+ it 'is not valid' do
38
+ expect(subject.valid?).to be false
30
39
  end
31
40
  end
41
+ end
42
+ end
32
43
 
33
- context 'when no final period' do
34
- subject { Danger::Changelog::ChangelogPlaceholderLine.new("* Your contribution here\n") }
35
-
36
- it 'is invalid' do
37
- expect(subject.invalid?).to be true
38
- end
44
+ context 'with a blank placeholder line' do
45
+ before do
46
+ Danger::Changelog.configure do |config|
47
+ config.placeholder_line = nil
39
48
  end
49
+ end
40
50
 
41
- context 'when text doesnt match' do
42
- subject { Danger::Changelog::ChangelogPlaceholderLine.new("* Put your contribution here.\n") }
43
-
44
- it 'is invalid' do
45
- expect(subject.invalid?).to be true
51
+ describe 'validates_as_changelog_line?' do
52
+ context 'when line is not blank' do
53
+ it 'validates as changelog line' do
54
+ expect(described_class.validates_as_changelog_line?("* Whatever.\n")).to be false
46
55
  end
47
56
  end
57
+ end
48
58
 
49
- context 'when there is not star' do
50
- subject { Danger::Changelog::ChangelogPlaceholderLine.new("Your contribution here.\n") }
59
+ describe 'valid?' do
60
+ context 'when is not blank' do
61
+ subject { Danger::Changelog::ChangelogPlaceholderLine.new("* Your change here.\n") }
51
62
 
52
- it 'is invalid' do
53
- expect(subject.invalid?).to be true
63
+ it 'is not valid' do
64
+ expect(subject.valid?).to be false
54
65
  end
55
66
  end
56
67
  end
@@ -41,7 +41,7 @@ describe Danger::Changelog do
41
41
  it 'complains when no CHANGELOG can be found' do
42
42
  expect(subject).to be false
43
43
  expect(status_report[:errors]).to eq []
44
- expect(status_report[:warnings]).to eq ["Unless you're refactoring existing code, please update #{filename}."]
44
+ expect(status_report[:warnings]).to eq ["Unless you're refactoring existing code or improving documentation, please update #{filename}."]
45
45
  expect(status_report[:markdowns].map(&:message)).to eq ["Here's an example of a #{filename} entry:\n\n```markdown\n* [#123](https://github.com/dblock/danger-changelog/pull/123): Being dangerous - [@dblock](https://github.com/dblock).\n```\n"]
46
46
  end
47
47
  end
@@ -101,16 +101,65 @@ describe Danger::Changelog do
101
101
  expect(status_report[:markdowns]).to eq []
102
102
  end
103
103
 
104
- context 'missing your contribution here' do
105
- let(:filename) { File.expand_path('../fixtures/changelogs/missing_your_contribution_here.md', __FILE__) }
106
- it 'complains' do
107
- expect(subject).to be false
108
- expect(status_report[:errors]).to eq ["Please put back the `* Your contribution here.` line into #{filename}."]
104
+ context 'customized' do
105
+ before do
106
+ Danger::Changelog.configure do |config|
107
+ config.placeholder_line = "* Nothing yet.\n"
108
+ end
109
+ end
110
+
111
+ let(:filename) { File.expand_path('../fixtures/changelogs/customized.md', __FILE__) }
112
+ it 'is ok' do
113
+ expect(subject).to be true
114
+ expect(status_report[:errors]).to eq []
109
115
  expect(status_report[:warnings]).to eq []
110
116
  expect(status_report[:markdowns]).to eq []
111
117
  end
112
118
  end
113
119
 
120
+ context 'missing your contribution here' do
121
+ let(:filename) { File.expand_path('../fixtures/changelogs/missing_your_contribution_here.md', __FILE__) }
122
+
123
+ context 'when placeholder line is customized' do
124
+ before do
125
+ Danger::Changelog.configure do |config|
126
+ config.placeholder_line = "* Nothing yet.\n"
127
+ end
128
+ end
129
+
130
+ it 'complains' do
131
+ expect(subject).to be false
132
+ expect(status_report[:errors]).to eq ["Please put back the `* Nothing yet.` line into #{filename}."]
133
+ expect(status_report[:warnings]).to eq []
134
+ expect(status_report[:markdowns]).to eq []
135
+ end
136
+ end
137
+
138
+ context 'when placeholder line is default' do
139
+ it 'complains' do
140
+ expect(subject).to be false
141
+ expect(status_report[:errors]).to eq ["Please put back the `* Your contribution here.` line into #{filename}."]
142
+ expect(status_report[:warnings]).to eq []
143
+ expect(status_report[:markdowns]).to eq []
144
+ end
145
+ end
146
+
147
+ context 'when placeholder line is nil' do
148
+ before do
149
+ Danger::Changelog.configure do |config|
150
+ config.placeholder_line = nil
151
+ end
152
+ end
153
+
154
+ it 'is ok' do
155
+ expect(subject).to be true
156
+ expect(status_report[:errors]).to eq []
157
+ expect(status_report[:warnings]).to eq []
158
+ expect(status_report[:markdowns]).to eq []
159
+ end
160
+ end
161
+ end
162
+
114
163
  context 'minimal example' do
115
164
  let(:filename) { File.expand_path('../fixtures/changelogs/minimal.md', __FILE__) }
116
165
  it 'is ok' do
@@ -119,6 +168,23 @@ describe Danger::Changelog do
119
168
  expect(status_report[:warnings]).to eq []
120
169
  expect(status_report[:markdowns]).to eq []
121
170
  end
171
+
172
+ context 'when placeholder line is nil' do
173
+ before do
174
+ Danger::Changelog.configure do |config|
175
+ config.placeholder_line = nil
176
+ end
177
+ end
178
+
179
+ it 'complains' do
180
+ expect(subject).to be false
181
+ expect(status_report[:errors]).to eq ["One of the lines below found in #{filename} doesn't match the expected format. Please make it look like the other lines, pay attention to periods and spaces."]
182
+ expect(status_report[:warnings]).to eq []
183
+ expect(status_report[:markdowns].map(&:message)).to eq [
184
+ "```markdown\n* Your contribution here.\n```\n"
185
+ ]
186
+ end
187
+ end
122
188
  end
123
189
 
124
190
  context 'with bad lines' do
@@ -0,0 +1,43 @@
1
+ require File.expand_path('../spec_helper', __FILE__)
2
+
3
+ describe Danger::Changelog::Config do
4
+ describe 'configure' do
5
+ describe 'placeholder_line' do
6
+ context 'when without markdown star' do
7
+ before do
8
+ Danger::Changelog.configure do |config|
9
+ config.placeholder_line = "Nothing yet.\n"
10
+ end
11
+ end
12
+
13
+ it 'ads missing star and saves configuration' do
14
+ expect(Danger::Changelog.config.placeholder_line).to eq "* Nothing yet.\n"
15
+ end
16
+ end
17
+
18
+ context 'when without trailing newline' do
19
+ before do
20
+ Danger::Changelog.configure do |config|
21
+ config.placeholder_line = '* Nothing yet.'
22
+ end
23
+ end
24
+
25
+ it 'ads missing trailing newline and saves configuration' do
26
+ expect(Danger::Changelog.config.placeholder_line).to eq "* Nothing yet.\n"
27
+ end
28
+ end
29
+
30
+ context 'when valid' do
31
+ before do
32
+ Danger::Changelog.configure do |config|
33
+ config.placeholder_line = "* Nothing yet.\n"
34
+ end
35
+ end
36
+
37
+ it 'saves configuration' do
38
+ expect(Danger::Changelog.config.placeholder_line).to eq "* Nothing yet.\n"
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,3 @@
1
+ ### Changelog
2
+
3
+ * Nothing yet.
@@ -13,6 +13,9 @@ RSpec.configure do |config|
13
13
  config.filter_gems_from_backtrace 'bundler'
14
14
  config.color = true
15
15
  config.tty = true
16
+ config.before do
17
+ Danger::Changelog::Config.reset
18
+ end
16
19
  end
17
20
 
18
21
  require 'danger_plugin'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dblock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-04 00:00:00.000000000 Z
11
+ date: 2018-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api
@@ -39,117 +39,117 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: guard
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '2.14'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '2.14'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rspec
56
+ name: guard-rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.4'
61
+ version: '4.7'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.4'
68
+ version: '4.7'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rubocop
70
+ name: listen
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: '0.41'
75
+ version: 3.0.7
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: '0.41'
82
+ version: 3.0.7
83
83
  - !ruby/object:Gem::Dependency
84
- name: yard
84
+ name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '0.8'
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '0.8'
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: guard
98
+ name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '2.14'
103
+ version: '10.0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '2.14'
110
+ version: '10.0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: guard-rspec
112
+ name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '4.7'
117
+ version: '3.4'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '4.7'
124
+ version: '3.4'
125
125
  - !ruby/object:Gem::Dependency
126
- name: listen
126
+ name: rubocop
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '='
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 3.0.7
131
+ version: 0.52.1
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '='
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 3.0.7
138
+ version: 0.52.1
139
139
  - !ruby/object:Gem::Dependency
140
- name: pry
140
+ name: yard
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: 0.9.11
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
152
+ version: 0.9.11
153
153
  description: A danger.systems plugin that is OCD about your CHANGELOG.
154
154
  email:
155
155
  - dblock@dblock.org
@@ -180,6 +180,7 @@ files:
180
180
  - lib/changelog/changelog_line/changelog_line.rb
181
181
  - lib/changelog/changelog_line/changelog_line_parser.rb
182
182
  - lib/changelog/changelog_line/changelog_placeholder_line.rb
183
+ - lib/changelog/config.rb
183
184
  - lib/changelog/gem_version.rb
184
185
  - lib/changelog/plugin.rb
185
186
  - lib/danger_changelog.rb
@@ -190,6 +191,8 @@ files:
190
191
  - spec/changelog_line_parser_spec.rb
191
192
  - spec/changelog_placeholder_line_spec.rb
192
193
  - spec/changelog_spec.rb
194
+ - spec/config_spec.rb
195
+ - spec/fixtures/changelogs/customized.md
193
196
  - spec/fixtures/changelogs/minimal.md
194
197
  - spec/fixtures/changelogs/missing_your_contribution_here.md
195
198
  - spec/fixtures/changelogs/with_bad_lines.md
@@ -214,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
217
  version: '0'
215
218
  requirements: []
216
219
  rubyforge_project:
217
- rubygems_version: 2.5.1
220
+ rubygems_version: 2.6.13
218
221
  signing_key:
219
222
  specification_version: 4
220
223
  summary: A danger.systems plugin that is OCD about your CHANGELOG.
@@ -225,6 +228,8 @@ test_files:
225
228
  - spec/changelog_line_parser_spec.rb
226
229
  - spec/changelog_placeholder_line_spec.rb
227
230
  - spec/changelog_spec.rb
231
+ - spec/config_spec.rb
232
+ - spec/fixtures/changelogs/customized.md
228
233
  - spec/fixtures/changelogs/minimal.md
229
234
  - spec/fixtures/changelogs/missing_your_contribution_here.md
230
235
  - spec/fixtures/changelogs/with_bad_lines.md