danger-todoist 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1e9980c94b66c3424c2c4229d33003af8ac52e4
4
- data.tar.gz: 59d1fb67dfdfdcf71d4fd6dafdc3650f09e8e686
3
+ metadata.gz: 6a9300d0182df857bcceb2f773095c36924e04dc
4
+ data.tar.gz: 89cb101a4effda323f9fa5e8937ee1d8c4809a4e
5
5
  SHA512:
6
- metadata.gz: 3fc3677d54b4ea66ea5b34a3d07fe0dd619ec6883279a6db30b06a5f3b6aec96000fae6d3109e477184e418c789f4967923015ab16e3064f3c2d3fd600ce00c0
7
- data.tar.gz: 17317745f04f1c8afc2747d2f2c671e6a5ce86d9614d973daba9a755bdd77d0f0d566dd8fddfb0123f99ee8625f8e872ad4c1cb7b7eb84315836771163d9b659
6
+ metadata.gz: 1135e1b4d7a58c5a49c8d071719f7a088a63c49bcd8da113558799e2af3b860e8fd97bc6504307076cef47f7c24ff6a97fdb61afc8ece63a44bde34de0559ebd
7
+ data.tar.gz: 558aac3afe414446e3730bdeb8229793b88612c1f2cc073f4ec8c7e0b34d68bf7b61891a2bc5aa7593258ef3859a45ebd1425c1b1003677ed83a86a59bf1a0c8
@@ -1,5 +1,9 @@
1
1
  ## master
2
2
 
3
+ ## 1.1.0
4
+
5
+ * add support for multiline comments - hanneskaeufler
6
+
3
7
  ## 1.0.1
4
8
 
5
9
  * fix bug where `+ TODO` would be identified as todo - hanneskaeufler
data/Dangerfile CHANGED
@@ -4,6 +4,11 @@ warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]"
4
4
  # Warn when there is a big PR
5
5
  warn("Big PR") if git.lines_of_code > 500
6
6
 
7
+ # Reminder to add changelog entry
8
+ unless git.modified_files.include?("CHANGELOG.md")
9
+ fail("Please include a CHANGELOG entry.", sticky: false)
10
+ end
11
+
7
12
  # Identify leftover todos
8
13
  todoist.message = "There are still some things to do in this PR."
9
14
  todoist.warn_for_todos
@@ -5,6 +5,7 @@ module Danger
5
5
  ^\+ # we only look at additions, marked by + in diffs
6
6
  \s* # followed by optional space
7
7
  [^a-z0-9\+\s]+ # anything looking like a comment indicator
8
+ (\n\+)? # allow multiline comment markers
8
9
  \s+ # followed by at least one space
9
10
  (TODO|FIXME) # our todo indicator
10
11
  [\s:]{1} # followed by a space or colon
@@ -1,3 +1,3 @@
1
1
  module Todoist
2
- VERSION = "1.0.1".freeze
2
+ VERSION = "1.1.0".freeze
3
3
  end
@@ -7,15 +7,9 @@ module Danger
7
7
  describe "#find_diffs_containing_todos" do
8
8
  %w(TODO TODO: todo todo: FIXME fixme FIXME: fixme).each do |marker|
9
9
  it "identifies a new '#{marker}' as a todo" do
10
- diffs = [
11
- Git::Diff::DiffFile.new(
12
- "base",
13
- path: "some/file.rb",
14
- patch: "+ # #{marker} some todo"
15
- )
16
- ]
10
+ diff = sample_diff("+ # #{marker} some todo")
17
11
 
18
- todos = subject.find_diffs_containing_todos(diffs)
12
+ todos = subject.find_diffs_containing_todos([diff])
19
13
 
20
14
  expect(todos).to_not be_empty
21
15
  end
@@ -24,30 +18,18 @@ module Danger
24
18
  # those comment indicators are ripped off https://github.com/pgilad/leasot
25
19
  %w(# {{ -- // /* <!-- <%# % / -# {{! {{!-- {# <%--).each do |comment|
26
20
  it "identifies todos in languages with '#{comment}' as comments" do
27
- diffs = [
28
- Git::Diff::DiffFile.new(
29
- "base",
30
- path: "some/file.rb",
31
- patch: "+ #{comment} TODO: some todo"
32
- )
33
- ]
21
+ diff = sample_diff("+ #{comment} TODO: some todo")
34
22
 
35
- todos = subject.find_diffs_containing_todos(diffs)
23
+ todos = subject.find_diffs_containing_todos([diff])
36
24
 
37
25
  expect(todos).to_not be_empty
38
26
  end
39
27
  end
40
28
 
41
29
  it "does not identify removed todos as a todo" do
42
- diffs = [
43
- Git::Diff::DiffFile.new(
44
- "base",
45
- path: "some/file.rb",
46
- patch: "- TODO: some todo"
47
- )
48
- ]
30
+ diff = sample_diff("- TODO: some todo")
49
31
 
50
- todos = subject.find_diffs_containing_todos(diffs)
32
+ todos = subject.find_diffs_containing_todos([diff])
51
33
 
52
34
  expect(todos).to be_empty
53
35
  end
@@ -66,30 +48,18 @@ module Danger
66
48
  "+ TODO: something"
67
49
  ].each do |patch|
68
50
  it "does not identify occurences in '#{patch}'" do
69
- diffs = [
70
- Git::Diff::DiffFile.new(
71
- "base",
72
- path: "some/file.rb",
73
- patch: patch
74
- )
75
- ]
51
+ diff = sample_diff("some/file.rb")
76
52
 
77
- todos = subject.find_diffs_containing_todos(diffs)
53
+ todos = subject.find_diffs_containing_todos([diff])
78
54
 
79
55
  expect(todos).to be_empty
80
56
  end
81
57
  end
82
58
 
83
59
  it "identifies the todo text as well" do
84
- diffs = [
85
- Git::Diff::DiffFile.new(
86
- "base",
87
- path: "some/file.rb",
88
- patch: "+ # TODO: practice you must"
89
- )
90
- ]
60
+ diff = sample_diff("+ # TODO: practice you must")
91
61
 
92
- todos = subject.find_diffs_containing_todos(diffs)
62
+ todos = subject.find_diffs_containing_todos([diff])
93
63
 
94
64
  expect(todos.first.text).to eql("practice you must")
95
65
  end
@@ -103,15 +73,9 @@ module Danger
103
73
  + # FIXME: with you the force is
104
74
  PATCH
105
75
 
106
- diffs = [
107
- Git::Diff::DiffFile.new(
108
- "base",
109
- path: "some/file.rb",
110
- patch: patch
111
- )
112
- ]
76
+ diff = sample_diff(patch)
113
77
 
114
- todos = subject.find_diffs_containing_todos(diffs)
78
+ todos = subject.find_diffs_containing_todos([diff])
115
79
 
116
80
  expect(todos.map(&:text))
117
81
  .to eql(["practice you must", "with you the force is"])
@@ -122,19 +86,17 @@ PATCH
122
86
  + /*
123
87
  + TODO: something
124
88
  + */
89
+ + function bla() {};
90
+ + /**
91
+ + * TODO: another
92
+ + */
125
93
  PATCH
126
94
 
127
- diffs = [
128
- Git::Diff::DiffFile.new(
129
- "base",
130
- path: "some/file.rb",
131
- patch: patch
132
- )
133
- ]
95
+ diff = sample_diff(patch)
134
96
 
135
- todos = subject.find_diffs_containing_todos(diffs)
97
+ todos = subject.find_diffs_containing_todos([diff])
136
98
 
137
- expect(todos.map(&:text)).to eql(["something"])
99
+ expect(todos.map(&:text)).to eql(%w(something another))
138
100
  end
139
101
  end
140
102
  end
@@ -54,7 +54,7 @@ end
54
54
 
55
55
  # A stubbed out Dangerfile for use in tests
56
56
  def testing_dangerfile
57
- env = Danger::EnvironmentManager.new(testing_env)
57
+ env = Danger::EnvironmentManager.new(testing_env, testing_ui)
58
58
  Danger::Dangerfile.new(env, testing_ui)
59
59
  end
60
60
 
@@ -69,3 +69,11 @@ end
69
69
  def markdowns
70
70
  @dangerfile.status_report[:markdowns].map(&:message)
71
71
  end
72
+
73
+ def sample_diff(patch)
74
+ Git::Diff::DiffFile.new(
75
+ "base",
76
+ path: "some/file.rb",
77
+ patch: patch
78
+ )
79
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-todoist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hannes Käufler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-10 00:00:00.000000000 Z
11
+ date: 2016-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api