dependabot-gradle 0.142.0 → 0.143.3

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: beb342b640afaeffca92563f48a6200bb7348c7657e31b024045fca2cac1bae6
4
- data.tar.gz: 8d7519767a02a6704b89039cd8d6f153297716c9a89f184cf7e42a01e75a7170
3
+ metadata.gz: 4db986dd87653799a9a5f1c1f8372453578b67b283d06b09341ecf8bebe7c78f
4
+ data.tar.gz: 0fb15316e6f42d7007894a678c5b5c3db0324a947c8d7c7d620e2bb22ee72c1b
5
5
  SHA512:
6
- metadata.gz: cf6ac97429d03ae4db2db514ca10df4957ee17569a25a439fc9b2628edd485f31a2c2dec27defca86187985fe61e5203ca29000d096266ccc85bd3bdcc910cea
7
- data.tar.gz: 9f0d28a88910409b1c0751985019bf29ac1a6c3cc57d35cbb22784003d2af8088dd515ebb67589fc939f4b8115c0edd3135ecf7fcfce0fd53de72cc0009fbe4c
6
+ metadata.gz: 4e20eff2d8c390f9b7b0f7153547d36c4af0846e8e65b25461ca1231ba61e4a8fc8f4f517dffdcf439ef5b16a4035f17c567751d70ed1db9caadc4bc8bf0e272
7
+ data.tar.gz: 930688a600b197c138c3603de1ecaaf312877f3237faf246bd3742161b2a4cc63da06e5b1a332a0de9f7c21c36e8cf9e26c562c3f4f81a4eaa347aebf5c496fc
@@ -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.0
4
+ version: 0.143.3
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-15 00:00:00.000000000 Z
11
+ date: 2021-04-23 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.0
19
+ version: 0.143.3
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.0
26
+ version: 0.143.3
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.0
33
+ version: 0.143.3
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.0
40
+ version: 0.143.3
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