dependabot-common 0.113.8 → 0.113.9
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: 60e3f6c2910095cf1e21ab00b6d1336c09c21cc90b570726e78c9960247c3967
|
4
|
+
data.tar.gz: 455b12c4441a1f7fb9c02cbbb2f09c97ed6062f469a65fef0f3f14cd22c5896f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdd202276dd4fd64fde6eefb90cba469cd6664b3fc08980034aff0ee0c6c9e0b9d979ef0e8df321034a818c768b94a03c8dde71762919f062f2a3df2a71d6692
|
7
|
+
data.tar.gz: 8948467061cc76c797e9ca2697d26cb143766eee9f54aed8a0e5adefa7e61296148943987ddcbf9f9d01f6d9436aa8392bce189ea52481827fa19ad15fc503c2
|
@@ -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.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-codecommit
|