dependabot-gradle 0.142.1 → 0.143.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5b6fa770d8e9599a20a080b3e22415f6a0e209e24966ef047e6b9e6ed6c9ef4
4
- data.tar.gz: b6c8a40691d1676ae740596ff973875345306e59650faeb222f8fe1671c466b7
3
+ metadata.gz: fe82135e1b9a5f057f19535714251cbd5990df27d1a6a90707fa1a73dc24a2e0
4
+ data.tar.gz: f2104c23e6638dc6eb24480bceefb9283e09c8a18420fdede81bfdcfdec1f655
5
5
  SHA512:
6
- metadata.gz: e3b7a3d703fe107086bdf6277654cf13d2adfa1ea33414977d2f1a97d6eac5499b9982b5d0a9a5e2bf9b81644a09fb8f98ebd8c3543314eb0f3c4b580c7875b3
7
- data.tar.gz: 94e957eb4160eb1a20f9faeef7ef5f58e4d1adb4d6d2982878a2662247ffb17747aaa73e307121a9af3c4acebea6a624d2c644161f483a797910a90bd0f9d601
6
+ metadata.gz: 9d28379fdef18fd4422cf5a7e84b505a33e8e75987cd502751273b8c0bac17da51765fa7b2449c62a30e3ae366b0f88aecd9ff9828cf439c7d0c8c8778b15904
7
+ data.tar.gz: 2c2687d3df7d0bd9bf576fd4c34c4b09b5fb4dcdf626e7c4efeadc2f4de1fc898a9d313d458c51b47eb6e89476b5e2b3705b048ef0d8f21d303e5f32d9fb648b
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "dependabot/utils"
4
+ require "dependabot/maven/requirement"
4
5
  require "dependabot/gradle/version"
5
6
 
6
7
  module Dependabot
@@ -46,7 +47,9 @@ module Dependabot
46
47
  private
47
48
 
48
49
  def self.split_java_requirement(req_string)
49
- req_string.split(/(?<=\]|\)),/).flat_map do |str|
50
+ return [req_string] unless req_string.match?(Maven::Requirement::OR_SYNTAX)
51
+
52
+ req_string.split(Maven::Requirement::OR_SYNTAX).flat_map do |str|
50
53
  next str if str.start_with?("(", "[")
51
54
 
52
55
  exacts, *rest = str.split(/,(?=\[|\()/)
@@ -62,9 +65,14 @@ module Dependabot
62
65
  raise "Can't convert multiple Java reqs to a single Ruby one"
63
66
  end
64
67
 
65
- return convert_java_range_to_ruby_range(req_string) if req_string&.include?(",")
66
-
67
- convert_java_equals_req_to_ruby(req_string)
68
+ # NOTE: Support ruby-style version requirements that are created from
69
+ # PR ignore conditions
70
+ version_reqs = req_string.split(",").map(&:strip)
71
+ if req_string.include?(",") && !version_reqs.all? { |s| PATTERN.match?(s) }
72
+ convert_java_range_to_ruby_range(req_string) if req_string.include?(",")
73
+ else
74
+ version_reqs.map { |r| convert_java_equals_req_to_ruby(r) }
75
+ end
68
76
  end
69
77
 
70
78
  def convert_java_range_to_ruby_range(req_string)
@@ -17,8 +17,6 @@ module Dependabot
17
17
  KOTLIN_PLUGIN_REPO_PREFIX = "org.jetbrains.kotlin"
18
18
  TYPE_SUFFICES = %w(jre android java).freeze
19
19
 
20
- GRADLE_RANGE_REGEX = /[\(\[].*,.*[\)\]]/.freeze
21
-
22
20
  def initialize(dependency:, dependency_files:, credentials:,
23
21
  ignored_versions:, raise_on_ignored: false,
24
22
  security_advisories:)
@@ -99,10 +97,10 @@ module Dependabot
99
97
  filtered = possible_versions
100
98
 
101
99
  ignored_versions.each do |req|
102
- ignore_req = Gradle::Requirement.new(parse_requirement_string(req))
100
+ ignore_requirements = Gradle::Requirement.requirements_array(req)
103
101
  filtered =
104
102
  filtered.
105
- reject { |v| ignore_req.satisfied_by?(v.fetch(:version)) }
103
+ reject { |v| ignore_requirements.any? { |r| r.satisfied_by?(v.fetch(:version)) } }
106
104
  end
107
105
 
108
106
  raise AllVersionsIgnored if @raise_on_ignored && filtered.empty? && possible_versions.any?
@@ -128,12 +126,6 @@ module Dependabot
128
126
  end
129
127
  end
130
128
 
131
- def parse_requirement_string(string)
132
- return string if string.match?(GRADLE_RANGE_REGEX)
133
-
134
- string.split(",").map(&:strip)
135
- end
136
-
137
129
  def wants_prerelease?
138
130
  return false unless dependency.version
139
131
  return false unless version_class.correct?(dependency.version)
@@ -28,7 +28,7 @@ module Dependabot
28
28
  VERSION_PATTERN =
29
29
  "[0-9a-zA-Z]+"\
30
30
  '(?>\.[0-9a-zA-Z]*)*'\
31
- '([_-][0-9A-Za-z_-]*(\.[0-9A-Za-z_-]*)*)?'
31
+ '([_\-\+][0-9A-Za-z_-]*(\.[0-9A-Za-z_-]*)*)?'
32
32
  ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/.freeze
33
33
 
34
34
  def self.correct?(version)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-gradle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.142.1
4
+ version: 0.143.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-16 00:00:00.000000000 Z
11
+ date: 2021-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.142.1
19
+ version: 0.143.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.142.1
26
+ version: 0.143.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: dependabot-maven
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.142.1
33
+ version: 0.143.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.142.1
40
+ version: 0.143.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: byebug
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.12.0
117
+ version: 1.13.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.12.0
124
+ version: 1.13.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: simplecov
127
127
  requirement: !ruby/object:Gem::Requirement