danger-todoist 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd9c28016359b27e3cc65bfee31b76086743db32
4
- data.tar.gz: 6f24675207d0aef9ce0ef092fca5b8431d91327c
3
+ metadata.gz: f1e9980c94b66c3424c2c4229d33003af8ac52e4
4
+ data.tar.gz: 59d1fb67dfdfdcf71d4fd6dafdc3650f09e8e686
5
5
  SHA512:
6
- metadata.gz: d67dc9615ec24a7e81100f9855194a0d07c97ff6fbae3cf9f4a4582486a310c7e86ece35d497a31f9dbe9d0d445bfe3c77c79b3c6ff880a6defeeda2f8a4e697
7
- data.tar.gz: 82c158c181261b48cdefa2d5918aa999be4514ec4ca5f3edadfc0c0014b773855818b66e0187e3dc3764defa80e0140565e90c9800fc3ab05ac0b6022d81175d
6
+ metadata.gz: 3fc3677d54b4ea66ea5b34a3d07fe0dd619ec6883279a6db30b06a5f3b6aec96000fae6d3109e477184e418c789f4967923015ab16e3064f3c2d3fd600ce00c0
7
+ data.tar.gz: 17317745f04f1c8afc2747d2f2c671e6a5ce86d9614d973daba9a755bdd77d0f0d566dd8fddfb0123f99ee8625f8e872ad4c1cb7b7eb84315836771163d9b659
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## master
2
2
 
3
+ ## 1.0.1
4
+
5
+ * fix bug where `+ TODO` would be identified as todo - hanneskaeufler
6
+
3
7
  ## 1.0.0
4
8
 
5
9
  * group todos by file - hanneskaeufler
@@ -4,7 +4,7 @@ module Danger
4
4
  TODO_REGEXP = /
5
5
  ^\+ # we only look at additions, marked by + in diffs
6
6
  \s* # followed by optional space
7
- [^a-z0-9\+]* # anything looking like a comment indicator, not a +
7
+ [^a-z0-9\+\s]+ # anything looking like a comment indicator
8
8
  \s+ # followed by at least one space
9
9
  (TODO|FIXME) # our todo indicator
10
10
  [\s:]{1} # followed by a space or colon
@@ -1,3 +1,3 @@
1
1
  module Todoist
2
- VERSION = "1.0.0".freeze
2
+ VERSION = "1.0.1".freeze
3
3
  end
@@ -21,7 +21,8 @@ module Danger
21
21
  end
22
22
  end
23
23
 
24
- %w(# {{ -- //).each do |comment|
24
+ # those comment indicators are ripped off https://github.com/pgilad/leasot
25
+ %w(# {{ -- // /* <!-- <%# % / -# {{! {{!-- {# <%--).each do |comment|
25
26
  it "identifies todos in languages with '#{comment}' as comments" do
26
27
  diffs = [
27
28
  Git::Diff::DiffFile.new(
@@ -59,7 +60,10 @@ module Danger
59
60
  "+ * this looks like a todo but isnt",
60
61
  "+ TODO_REGEXP = /",
61
62
  "+ todos = subject.find_diffs_containing_todos(diffs)",
62
- "++ # FIXME: with you the force is"
63
+ "++ # FIXME: with you the force is",
64
+ "+ TODO: foo",
65
+ "+ TODO",
66
+ "+ TODO: something"
63
67
  ].each do |patch|
64
68
  it "does not identify occurences in '#{patch}'" do
65
69
  diffs = [
@@ -112,6 +116,26 @@ PATCH
112
116
  expect(todos.map(&:text))
113
117
  .to eql(["practice you must", "with you the force is"])
114
118
  end
119
+
120
+ it "finds todos in multiline comments" do
121
+ patch = <<PATCH
122
+ + /*
123
+ + TODO: something
124
+ + */
125
+ PATCH
126
+
127
+ diffs = [
128
+ Git::Diff::DiffFile.new(
129
+ "base",
130
+ path: "some/file.rb",
131
+ patch: patch
132
+ )
133
+ ]
134
+
135
+ todos = subject.find_diffs_containing_todos(diffs)
136
+
137
+ expect(todos.map(&:text)).to eql(["something"])
138
+ end
115
139
  end
116
140
  end
117
141
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-todoist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hannes Käufler