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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 482dc2edd6a4f700400f2c4d09462df5228f0ab2a3d61a17eea5a552a78cd241
4
- data.tar.gz: 9bdb741852c40ac8d268334190f413d01f9d17613ec718b989292664dbcb317c
3
+ metadata.gz: e924931c31832ddb5a46cca1f501df6f47bb54e72d6f4b3fb431b635ace4eded
4
+ data.tar.gz: c59d277064b596613540fdbf37667a89898d3ee87c0d81a4915400ecb034a14c
5
5
  SHA512:
6
- metadata.gz: 940f20bab43a72603c98afbe43199556fd006abcae65598e0eca8fc1b8631bef6666ed81dfbecdbe5ec6b483864881986b6f0a4999b26dac448c90703cf41cdc
7
- data.tar.gz: 16c654ae13cae9bcd4bb339fa0e2020ea3f35ea9f16be1ee29e5cfb74acf12f84d48147bde9f4eaa782e3842c851b9b4cfb83ec89a0678ab0e93537f0cbb3648
6
+ metadata.gz: 50813eedf382a9fbbb6659f5a1a90a8a563d7a3d14588d0050b4ccc47159e9f1fd1b0a093c829789572fa5e7e4ec53f841a262fb1ebd95b901d3358ab12c2907
7
+ data.tar.gz: e8a27dd4c356f6f6a99158a818bf6265bc505c91e782b7a7b0d6c48ab8e8ca7b878f39d584836d545fa1bbc12e090ee5ccc78fcc1c23ded9c5bb5e5c52e4c40b
@@ -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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DangerSwiftlint
4
- VERSION = '0.24.2'
4
+ VERSION = '0.24.3'
5
5
  SWIFTLINT_VERSION = '0.39.1'
6
6
  end
@@ -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(23)
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.2
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-03-10 00:00:00.000000000 Z
15
+ date: 2020-06-08 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: danger