danger-swiftlint 0.24.2 → 0.24.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/danger_plugin.rb +2 -3
- data/lib/version.rb +1 -1
- data/spec/danger_plugin_spec.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e924931c31832ddb5a46cca1f501df6f47bb54e72d6f4b3fb431b635ace4eded
|
4
|
+
data.tar.gz: c59d277064b596613540fdbf37667a89898d3ee87c0d81a4915400ecb034a14c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50813eedf382a9fbbb6659f5a1a90a8a563d7a3d14588d0050b4ccc47159e9f1fd1b0a093c829789572fa5e7e4ec53f841a262fb1ebd95b901d3358ab12c2907
|
7
|
+
data.tar.gz: e8a27dd4c356f6f6a99158a818bf6265bc505c91e782b7a7b0d6c48ab8e8ca7b878f39d584836d545fa1bbc12e090ee5ccc78fcc1c23ded9c5bb5e5c52e4c40b
|
data/lib/danger_plugin.rb
CHANGED
@@ -354,8 +354,7 @@ module Danger
|
|
354
354
|
def git_modified_lines(file)
|
355
355
|
git_range_info_line_regex = /^@@ .+\+(?<line_number>\d+),/
|
356
356
|
git_modified_line_regex = /^\+(?!\+|\+)/
|
357
|
-
git_removed_line_regex =
|
358
|
-
git_not_removed_line_regex = /^[^-]/
|
357
|
+
git_removed_line_regex = /^\-(?!\-|\-)/
|
359
358
|
file_info = git.diff_for_file(file)
|
360
359
|
line_number = 0
|
361
360
|
lines = []
|
@@ -367,7 +366,7 @@ module Danger
|
|
367
366
|
when git_modified_line_regex
|
368
367
|
lines << line_number
|
369
368
|
end
|
370
|
-
line_number += 1 if line_number > 0
|
369
|
+
line_number += 1 if line_number > 0 && !git_removed_line_regex.match?(line)
|
371
370
|
line_number = starting_line_number if line_number == 0 && starting_line_number > 0
|
372
371
|
end
|
373
372
|
lines
|
data/lib/version.rb
CHANGED
data/spec/danger_plugin_spec.rb
CHANGED
@@ -419,7 +419,8 @@ module Danger
|
|
419
419
|
allow(@swiftlint.git.diff_for_file).to receive(:patch).and_return(git_diff)
|
420
420
|
modified_lines = @swiftlint.git_modified_lines("spec/fixtures/SwiftFile.swift")
|
421
421
|
expect(modified_lines).to_not be_empty
|
422
|
-
expect(modified_lines.length).to eql(
|
422
|
+
expect(modified_lines.length).to eql(24)
|
423
|
+
expect(modified_lines).to eql([15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 42])
|
423
424
|
end
|
424
425
|
|
425
426
|
it 'Get git modified files info' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-swiftlint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.24.
|
4
|
+
version: 0.24.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ash Furrow
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2020-
|
15
|
+
date: 2020-06-08 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: danger
|