gitlab-dangerfiles 2.3.0 → 2.3.1

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: 9514e55b5f6bd5a29333c3d08cd1cb2b6a0a61dc3f07a363625a60e52708095a
4
- data.tar.gz: '05359002275ba7bf06b2aca1d6a9a0acc8f149765ff87970bf12ebcb29b3f796'
3
+ metadata.gz: 1f4f4363298e91b36384ef61e96ea5c3ff8dfa81ee3c768e60d24349ad2df7ce
4
+ data.tar.gz: cac0bdb7f5bea8b30afca63a9d70ed1c081abf0e5d16101f08fbc9276764698d
5
5
  SHA512:
6
- metadata.gz: 6309c8416ef0952e275acce5ec3fe12bbc72658857ad253e6fd92c86acc5d2d6a952cbb87f80b5d32073d6d9c5eb521482417e7ecfcfc1c93502107a11fbfa62
7
- data.tar.gz: 99c591108c94959166847f6bc11f2b0f7bcf7a1114c4176d982ecdbbc8c5cd6c3bef6edca889a6cd3dc0d5902077fcaa117835a521e9eb9d4bfd590a16161cbf
6
+ metadata.gz: 3b201247f2fa32c72063c18db9533be9a2244b090dfe64bfe825497f298e747f1b511e91f83cfe58c51c79673283c174ccbfc419acd85d766b21b38c321f5e54
7
+ data.tar.gz: c84b0389e48d61c4c686049a55c94edffb5d30c400195411a829857711110ea3cc98ef53d7c6a37267725e667bc7618ecc17d6264258cef091302bfdf5c4be4c
@@ -28,6 +28,10 @@ module Gitlab
28
28
  @problems = {}
29
29
  end
30
30
 
31
+ def inspect
32
+ "#{self.class}:#{object_id} @commit=#{@commit} @problems=#{@problems}"
33
+ end
34
+
31
35
  def failed?
32
36
  problems.any?
33
37
  end
@@ -9,9 +9,9 @@ module Gitlab
9
9
  MAX_CHANGED_FILES_IN_COMMIT = 3
10
10
  MAX_CHANGED_LINES_IN_COMMIT = 30
11
11
  # Issue, MR, Epic
12
- SHORT_REFERENCE_REGEX = %r{([\w\-\/]+)?(?<!`)(#|!|&)\d+(?<!`)}.freeze
12
+ SHORT_REFERENCE_REGEX = %r{(\S*([\w\-\/]+)?(?<!`)(#|!|&)\d+(?<!`))}.freeze
13
13
  # Milestone
14
- MS_SHORT_REFERENCE_REGEX = %r{([\w\-\/]+)?(?<!`)%"?\d{1,3}\.\d{1,3}"?(?<!`)}.freeze
14
+ MS_SHORT_REFERENCE_REGEX = %r{(\S*([\w\-\/]+)?(?<!`)%"?\d{1,3}\.\d{1,3}"?(?<!`))}.freeze
15
15
  SUGGESTIONS_APPLIED_COMMIT_REGEX = /Apply \d+ suggestion\(s\) to \d+ file\(s\)/.freeze
16
16
 
17
17
  def self.problems_mapping
@@ -143,8 +143,13 @@ module Gitlab
143
143
  end
144
144
 
145
145
  def message_contains_short_reference?
146
- commit.message.match?(SHORT_REFERENCE_REGEX) ||
147
- commit.message.match?(MS_SHORT_REFERENCE_REGEX)
146
+ match_data = commit.message.match(SHORT_REFERENCE_REGEX) ||
147
+ commit.message.match(MS_SHORT_REFERENCE_REGEX)
148
+
149
+ return false unless match_data
150
+
151
+ # Any URL would include "//". This works for http/https/ftp etc.
152
+ !match_data[1].include?("//")
148
153
  end
149
154
 
150
155
  def emoji_checker
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module Dangerfiles
3
- VERSION = "2.3.0"
3
+ VERSION = "2.3.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-dangerfiles
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-22 00:00:00.000000000 Z
11
+ date: 2021-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-gitlab