dependabot-common 0.143.0 → 0.143.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependabot/config/file.rb +25 -1
- data/lib/dependabot/config/update_config.rb +33 -29
- data/lib/dependabot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04061b64d2ec9c8ff56b799d8ea0c7426dadcca2701581f1917faa494ba3f76d
|
4
|
+
data.tar.gz: 1129318553b00a3e77274d84cff91987b9c2d20f69a57deb3f171eee4729555a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81049fffec22a52e685fd08d7f8afc8947f6cd66532491d4e16eb6420cd46ba0d65e863f5f11659968572c8bc6b8d3339601fffa57631ffeb0503823ba53e03d
|
7
|
+
data.tar.gz: '0955f36ca302e038b4dae7d97fd4f83d4ffa3a1cb1668eb353e16f7501851ba567c6b7eebf2bed72776343cf39a54116d326c45e2261320514a0c53d3e360aba'
|
@@ -20,7 +20,10 @@ module Dependabot
|
|
20
20
|
u[:"package-ecosystem"] == package_ecosystem && u[:directory] == dir &&
|
21
21
|
(target_branch.nil? || u[:"target-branch"] == target_branch)
|
22
22
|
end
|
23
|
-
Dependabot::Config::UpdateConfig.new(
|
23
|
+
Dependabot::Config::UpdateConfig.new(
|
24
|
+
ignore_conditions: ignore_conditions(cfg),
|
25
|
+
commit_message_options: commit_message_options(cfg)
|
26
|
+
)
|
24
27
|
end
|
25
28
|
|
26
29
|
PACKAGE_MANAGER_LOOKUP = {
|
@@ -49,6 +52,27 @@ module Dependabot
|
|
49
52
|
|
50
53
|
File.new(updates: parsed[:updates], registries: parsed[:registries])
|
51
54
|
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def ignore_conditions(cfg)
|
59
|
+
ignores = cfg&.dig(:ignore) || []
|
60
|
+
ignores.map do |ic|
|
61
|
+
Dependabot::Config::UpdateConfig::IgnoreCondition.new(
|
62
|
+
dependency_name: ic[:"dependency-name"],
|
63
|
+
versions: ic[:versions]
|
64
|
+
)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def commit_message_options(cfg)
|
69
|
+
commit_message = cfg&.dig(:"commit-message") || {}
|
70
|
+
Dependabot::Config::UpdateConfig::CommitMessageOptions.new(
|
71
|
+
prefix: commit_message[:prefix],
|
72
|
+
prefix_development: commit_message[:"prefix-development"],
|
73
|
+
include: commit_message[:include]
|
74
|
+
)
|
75
|
+
end
|
52
76
|
end
|
53
77
|
end
|
54
78
|
end
|
@@ -4,44 +4,48 @@ module Dependabot
|
|
4
4
|
module Config
|
5
5
|
# Configuration for a single ecosystem
|
6
6
|
class UpdateConfig
|
7
|
-
|
8
|
-
DAILY = "daily"
|
9
|
-
WEEKLY = "weekly"
|
10
|
-
MONTHLY = "monthly"
|
11
|
-
end
|
7
|
+
attr_reader :commit_message_options
|
12
8
|
|
13
|
-
def initialize(
|
14
|
-
@
|
9
|
+
def initialize(ignore_conditions: nil, commit_message_options: nil)
|
10
|
+
@ignore_conditions = ignore_conditions || []
|
11
|
+
@commit_message_options = commit_message_options
|
15
12
|
end
|
16
13
|
|
17
14
|
def ignored_versions_for(dep)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
flatten
|
15
|
+
@ignore_conditions.
|
16
|
+
select { |ic| ic.dependency_name == dep.name }. # FIXME: wildcard support
|
17
|
+
map(&:versions).
|
18
|
+
flatten.
|
19
|
+
compact
|
24
20
|
end
|
25
21
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
22
|
+
class IgnoreCondition
|
23
|
+
attr_reader :dependency_name, :versions
|
24
|
+
def initialize(dependency_name:, versions:)
|
25
|
+
@dependency_name = dependency_name
|
26
|
+
@versions = versions
|
27
|
+
end
|
33
28
|
end
|
34
29
|
|
35
|
-
|
36
|
-
|
37
|
-
|
30
|
+
class CommitMessageOptions
|
31
|
+
attr_reader :prefix, :prefix_development, :include
|
32
|
+
|
33
|
+
def initialize(prefix:, prefix_development:, include:)
|
34
|
+
@prefix = prefix
|
35
|
+
@prefix_development = prefix_development
|
36
|
+
@include = include
|
37
|
+
end
|
38
|
+
|
39
|
+
def include_scope?
|
40
|
+
@include == "scope"
|
41
|
+
end
|
38
42
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
def to_h
|
44
|
+
{
|
45
|
+
prefix: @prefix,
|
46
|
+
prefix_development: @prefix_development,
|
47
|
+
include_scope: include_scope?
|
48
|
+
}
|
45
49
|
end
|
46
50
|
end
|
47
51
|
end
|
data/lib/dependabot/version.rb
CHANGED