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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/todoist/diff_todo_finder.rb +1 -1
- data/lib/todoist/gem_version.rb +1 -1
- data/spec/diff_todo_finder_spec.rb +26 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1e9980c94b66c3424c2c4229d33003af8ac52e4
|
4
|
+
data.tar.gz: 59d1fb67dfdfdcf71d4fd6dafdc3650f09e8e686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fc3677d54b4ea66ea5b34a3d07fe0dd619ec6883279a6db30b06a5f3b6aec96000fae6d3109e477184e418c789f4967923015ab16e3064f3c2d3fd600ce00c0
|
7
|
+
data.tar.gz: 17317745f04f1c8afc2747d2f2c671e6a5ce86d9614d973daba9a755bdd77d0f0d566dd8fddfb0123f99ee8625f8e872ad4c1cb7b7eb84315836771163d9b659
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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
|
data/lib/todoist/gem_version.rb
CHANGED
@@ -21,7 +21,8 @@ module Danger
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
|
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
|