dependabot-common 0.113.5 → 0.113.10
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d600a59386c6492eb9411615427693b6b15278a0a03ada2c0858cdb9492ba4a2
|
|
4
|
+
data.tar.gz: ab5c208f0e2c706d2a19c33a2950b409f8fbb843bc54725c22a22be909b10700
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 866c909e0f9217a229230b42de9012cb3e8f4bc12cca87aba57fe5c91412086065ae4fdc0bcb85494eb3292d4148661cebbf5ef7f1677c652b445ff2fdd97dd6
|
|
7
|
+
data.tar.gz: b0903cb5206f5eca16250d4b3d6a18cee962ba2487b2dbd640176a48320150f86435686d111ad332692ba448a67532fb2031df872bdeb43f8c457f551fc67f2b
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "strscan"
|
|
3
4
|
require "dependabot/pull_request_creator/message_builder"
|
|
4
5
|
|
|
5
6
|
module Dependabot
|
|
@@ -12,18 +13,9 @@ module Dependabot
|
|
|
12
13
|
github\.com/(?<repo>#{GITHUB_USERNAME}/[^/\s]+)/
|
|
13
14
|
(?:issue|pull)s?/(?<number>\d+)
|
|
14
15
|
}x.freeze
|
|
15
|
-
|
|
16
|
-
#
|
|
17
|
-
|
|
18
|
-
# doing so we err on the side of sanitizing, which is *much* better
|
|
19
|
-
# than accidentally not sanitizing.
|
|
20
|
-
#
|
|
21
|
-
# rubocop:disable Style/RegexpLiteral
|
|
22
|
-
CODEBLOCK_REGEX = %r{
|
|
23
|
-
(?=[\s]`{3}[^`])|(?=[\s]`{3}\Z)|(?=\A`{3}[^`])|
|
|
24
|
-
(?=[\s]~{3}[^~])|(?=[\s]~{3}\Z)|(?=\A~{3}[^~])
|
|
25
|
-
}x.freeze
|
|
26
|
-
# rubocop:enable Style/RegexpLiteral
|
|
16
|
+
CODEBLOCK_REGEX = /```|~~~/.freeze
|
|
17
|
+
# End of string
|
|
18
|
+
EOS_REGEX = /\z/.freeze
|
|
27
19
|
|
|
28
20
|
attr_reader :github_redirection_service
|
|
29
21
|
|
|
@@ -33,18 +25,20 @@ module Dependabot
|
|
|
33
25
|
|
|
34
26
|
def sanitize_links_and_mentions(text:)
|
|
35
27
|
# We don't want to sanitize any links or mentions that are contained
|
|
36
|
-
# within code blocks, so we split the text on "```"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
# within code blocks, so we split the text on "```" or "~~~"
|
|
29
|
+
lines = []
|
|
30
|
+
scan = StringScanner.new(text)
|
|
31
|
+
until scan.eos?
|
|
32
|
+
line = scan.scan_until(CODEBLOCK_REGEX) ||
|
|
33
|
+
scan.scan_until(EOS_REGEX)
|
|
34
|
+
delimiter = line.match(CODEBLOCK_REGEX)&.to_s
|
|
35
|
+
unless delimiter && lines.count { |l| l.include?(delimiter) }.odd?
|
|
36
|
+
line = sanitize_mentions(line)
|
|
37
|
+
line = sanitize_links(line)
|
|
38
|
+
end
|
|
39
|
+
lines << line
|
|
40
40
|
end
|
|
41
|
-
|
|
42
|
-
snippets.map.with_index do |snippet, index|
|
|
43
|
-
next snippet if index.odd?
|
|
44
|
-
|
|
45
|
-
snippet = sanitize_mentions(snippet)
|
|
46
|
-
sanitize_links(snippet)
|
|
47
|
-
end.join
|
|
41
|
+
lines.join
|
|
48
42
|
end
|
|
49
43
|
|
|
50
44
|
private
|
data/lib/dependabot/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dependabot-common
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.113.
|
|
4
|
+
version: 0.113.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dependabot
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-10-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aws-sdk-codecommit
|
|
@@ -230,14 +230,14 @@ dependencies:
|
|
|
230
230
|
requirements:
|
|
231
231
|
- - "~>"
|
|
232
232
|
- !ruby/object:Gem::Version
|
|
233
|
-
version: '
|
|
233
|
+
version: '13'
|
|
234
234
|
type: :development
|
|
235
235
|
prerelease: false
|
|
236
236
|
version_requirements: !ruby/object:Gem::Requirement
|
|
237
237
|
requirements:
|
|
238
238
|
- - "~>"
|
|
239
239
|
- !ruby/object:Gem::Version
|
|
240
|
-
version: '
|
|
240
|
+
version: '13'
|
|
241
241
|
- !ruby/object:Gem::Dependency
|
|
242
242
|
name: rspec
|
|
243
243
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -286,14 +286,14 @@ dependencies:
|
|
|
286
286
|
requirements:
|
|
287
287
|
- - "~>"
|
|
288
288
|
- !ruby/object:Gem::Version
|
|
289
|
-
version: 0.
|
|
289
|
+
version: 0.75.0
|
|
290
290
|
type: :development
|
|
291
291
|
prerelease: false
|
|
292
292
|
version_requirements: !ruby/object:Gem::Requirement
|
|
293
293
|
requirements:
|
|
294
294
|
- - "~>"
|
|
295
295
|
- !ruby/object:Gem::Version
|
|
296
|
-
version: 0.
|
|
296
|
+
version: 0.75.0
|
|
297
297
|
- !ruby/object:Gem::Dependency
|
|
298
298
|
name: vcr
|
|
299
299
|
requirement: !ruby/object:Gem::Requirement
|