danger-swiftlint 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changelog.md +4 -0
- data/README.md +1 -1
- data/lib/danger_plugin.rb +3 -0
- data/lib/version.rb +1 -1
- data/spec/danger_plugin_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 724a5435fe3b3b09ef18f15e76407a5f9d2deea0
|
4
|
+
data.tar.gz: ad2d97395e8578039090fdf1898b8f290f6b1ff8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c181f89260aa3c63f1efae0b2a63312025a0bc23cf6471a207c8a6c6f0296129bcc5434c3129211d661e729d75cdcc89a88c99a63bd7da07762644673cd9cbb8
|
7
|
+
data.tar.gz: 5b6916bb7e8011aaff00bb19b96ccf30cd80c7f8cdd9572ee9ac4a92a53908e4e7a340511155c778831e77fb1937b19962b971a3b67326a1e216daf1a4e592c6
|
data/Changelog.md
CHANGED
@@ -4,6 +4,10 @@
|
|
4
4
|
|
5
5
|
- Nothing yet!
|
6
6
|
|
7
|
+
## 0.1.2
|
8
|
+
|
9
|
+
- Adds support for files with spaces in their names. See [#9](https://github.com/ashfurrow/danger-swiftlint/issues/9).
|
10
|
+
|
7
11
|
## 0.1.1
|
8
12
|
|
9
13
|
- Fixes double-escaped newline characters. See [#11](https://github.com/ashfurrow/danger-swiftlint/issues/11).
|
data/README.md
CHANGED
@@ -30,7 +30,7 @@ swiftlint.lint_files
|
|
30
30
|
And finally, you can provide a list of files manually:
|
31
31
|
|
32
32
|
``` ruby
|
33
|
-
# Look through all changed
|
33
|
+
# Look through all changed Swift files
|
34
34
|
swift_files = (modified_files + added_files).select do |file|
|
35
35
|
file.end_with?(".swift")
|
36
36
|
end
|
data/lib/danger_plugin.rb
CHANGED
@@ -40,6 +40,9 @@ module Danger
|
|
40
40
|
swift_files = files ? Dir.glob(files) : (modified_files + added_files)
|
41
41
|
swift_files.select! do |line| line.end_with?(".swift") end
|
42
42
|
|
43
|
+
# Make sure we don't fail when paths have spaces
|
44
|
+
swift_files = swift_files.map { |file| "\"#{file}\"" }
|
45
|
+
|
43
46
|
swiftlint_command = "swiftlint lint --quiet --reporter json"
|
44
47
|
swiftlint_command += " --config #{config_file}" if config_file
|
45
48
|
|
data/lib/version.rb
CHANGED
data/spec/danger_plugin_spec.rb
CHANGED
@@ -5,7 +5,7 @@ module Danger
|
|
5
5
|
it 'is a plugin' do
|
6
6
|
expect(Danger::DangerSwiftlint < Danger::Plugin).to be_truthy
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
describe 'with Dangerfile' do
|
10
10
|
before do
|
11
11
|
@dangerfile = testing_dangerfile
|
@@ -34,7 +34,7 @@ module Danger
|
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'handles a known SwiftLint report' do
|
37
|
-
allow(@swiftlint).to receive(:`).with('swiftlint lint --quiet --reporter json --path spec/fixtures/SwiftFile.swift').and_return(@swiftlint_response)
|
37
|
+
allow(@swiftlint).to receive(:`).with('swiftlint lint --quiet --reporter json --path "spec/fixtures/SwiftFile.swift"').and_return(@swiftlint_response)
|
38
38
|
|
39
39
|
# Do it
|
40
40
|
@swiftlint.lint_files("spec/fixtures/*.swift")
|
@@ -52,7 +52,7 @@ module Danger
|
|
52
52
|
it 'handles no files' do
|
53
53
|
allow(@swiftlint).to receive(:modified_files).and_return(['spec/fixtures/SwiftFile.swift'])
|
54
54
|
allow(@swiftlint).to receive(:added_files).and_return([])
|
55
|
-
allow(@swiftlint).to receive(:`).with('swiftlint lint --quiet --reporter json --path spec/fixtures/SwiftFile.swift').and_return(@swiftlint_response)
|
55
|
+
allow(@swiftlint).to receive(:`).with('swiftlint lint --quiet --reporter json --path "spec/fixtures/SwiftFile.swift"').and_return(@swiftlint_response)
|
56
56
|
|
57
57
|
@swiftlint.lint_files
|
58
58
|
|
@@ -61,7 +61,7 @@ module Danger
|
|
61
61
|
|
62
62
|
it 'uses a config file' do
|
63
63
|
@swiftlint.config_file = 'some_config.yml'
|
64
|
-
allow(@swiftlint).to receive(:`).with('swiftlint lint --quiet --reporter json --config some_config.yml --path spec/fixtures/SwiftFile.swift').and_return(@swiftlint_response)
|
64
|
+
allow(@swiftlint).to receive(:`).with('swiftlint lint --quiet --reporter json --config some_config.yml --path "spec/fixtures/SwiftFile.swift"').and_return(@swiftlint_response)
|
65
65
|
|
66
66
|
@swiftlint.lint_files("spec/fixtures/*.swift")
|
67
67
|
|
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.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ash Furrow
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-07-
|
13
|
+
date: 2016-07-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: danger
|