danger-swiftlint 0.29.1 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/swiftlint/Rakefile +2 -1
- data/ext/swiftlint/downloadSwiftlint.sh +52 -0
- data/lib/version.rb +2 -2
- data/spec/danger_plugin_spec.rb +2 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fa52887f31bab6965b197dd6c9db017de701059dc53cb869ef6b995c1d5e8b8
|
4
|
+
data.tar.gz: 20fb5fe8b9837f15394d629e4556da56e851d14f41b8b7d4478602638e5bc10e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97ac4fd4183005accf2dcec0df94e2de34563cea7b16924a7adb90f93f1924eab734a374d328d78707ecc2fb4fe54bcaaf0cee3b8d5cc8be5c59e292b03149e0
|
7
|
+
data.tar.gz: eb785108b4887f040842302f7771b90c11674f23e21ef90c0975a4b66f6c85fd3871a8602ce693e76397c95e5e6d9d8051d243e82bbffa644cfa3578c13bcbfb
|
data/ext/swiftlint/Rakefile
CHANGED
@@ -12,10 +12,11 @@ namespace :swiftlint do
|
|
12
12
|
ASSET = 'portable_swiftlint.zip'
|
13
13
|
URL = "#{REPO}/releases/download/#{VERSION}/#{ASSET}"
|
14
14
|
DESTINATION = File.expand_path(File.join(File.dirname(__FILE__), 'bin'))
|
15
|
+
SCRIPT_PATH = File.expand_path(File.join(File.dirname(__FILE__)))
|
15
16
|
SWIFTLINT_MD5_HASH = DangerSwiftlint::SWIFTLINT_HASH
|
16
17
|
|
17
18
|
puts "Downloading swiftlint@#{VERSION}"
|
18
|
-
sh "
|
19
|
+
sh "#{SCRIPT_PATH}/downloadSwiftlint.sh -u #{URL} -d #{DESTINATION} -a #{ASSET} -dh #{SWIFTLINT_MD5_HASH}"
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
### Load arguments
|
4
|
+
while [[ $# > 0 ]]
|
5
|
+
do
|
6
|
+
case "$1" in
|
7
|
+
-u|--url)
|
8
|
+
url="$2"
|
9
|
+
shift;;
|
10
|
+
|
11
|
+
-d|--destination)
|
12
|
+
destination="$2"
|
13
|
+
shift;;
|
14
|
+
|
15
|
+
-a|--asset)
|
16
|
+
asset="$2"
|
17
|
+
shift;;
|
18
|
+
|
19
|
+
-dh|--default_hash)
|
20
|
+
default_hash="$2"
|
21
|
+
shift;;
|
22
|
+
|
23
|
+
--help|*)
|
24
|
+
echo "Usage:"
|
25
|
+
echo ' -u --url: URL for SwiftLint version to download'
|
26
|
+
echo ' -d --destination: Folder where SwiftLint will be downloaded'
|
27
|
+
echo " -a --asset: Temporary name for the zip file"
|
28
|
+
echo " -dh --default_hash: Default SwiftLint md5 hash to check for if no version specified"
|
29
|
+
exit 1;;
|
30
|
+
esac
|
31
|
+
shift
|
32
|
+
done
|
33
|
+
|
34
|
+
### Download
|
35
|
+
mkdir -p "${destination}"
|
36
|
+
curl -s -L "${url}" -o "${asset}"
|
37
|
+
|
38
|
+
# If macOS
|
39
|
+
if [[ "$OSTYPE" == "darwin"* ]]; then
|
40
|
+
resulting_hash=`md5 -q ${asset}`
|
41
|
+
# Default to linux
|
42
|
+
else
|
43
|
+
resulting_hash=`md5sum ${asset} | awk '{ print $1 }'`
|
44
|
+
fi
|
45
|
+
|
46
|
+
if [[ ! -z "${SWIFTLINT_VERSION}" || "$resulting_hash" == "${default_hash}" ]]; then
|
47
|
+
# if another version is set || our hardcoded hash is correct
|
48
|
+
unzip -o -q "${asset}" -d "${destination}"
|
49
|
+
else
|
50
|
+
echo "Zip was corrupted, try again later."
|
51
|
+
fi
|
52
|
+
rm "${asset}"
|
data/lib/version.rb
CHANGED
data/spec/danger_plugin_spec.rb
CHANGED
@@ -220,6 +220,7 @@ module Danger
|
|
220
220
|
end
|
221
221
|
|
222
222
|
it 'crashes if renamed_files is not configured properly' do
|
223
|
+
allow_any_instance_of(Swiftlint).to receive(:lint).and_return('')
|
223
224
|
allow(@swiftlint.git).to receive(:modified_files).and_return([
|
224
225
|
'spec/fixtures/SwiftFileThatWasRenamedToSomethingElse.swift'
|
225
226
|
])
|
@@ -227,6 +228,7 @@ module Danger
|
|
227
228
|
end
|
228
229
|
|
229
230
|
it 'does not crash if a modified file was renamed' do
|
231
|
+
allow_any_instance_of(Swiftlint).to receive(:lint).and_return('')
|
230
232
|
allow(@swiftlint.git).to receive(:modified_files).and_return([
|
231
233
|
'spec/fixtures/SwiftFileThatWasRenamedToSomethingElse.swift'
|
232
234
|
])
|
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.
|
4
|
+
version: 0.30.0
|
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:
|
15
|
+
date: 2022-02-14 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: danger
|
@@ -155,6 +155,7 @@ extra_rdoc_files: []
|
|
155
155
|
files:
|
156
156
|
- bin/danger-swiftlint
|
157
157
|
- ext/swiftlint/Rakefile
|
158
|
+
- ext/swiftlint/downloadSwiftlint.sh
|
158
159
|
- ext/swiftlint/swiftlint.rb
|
159
160
|
- lib/danger_plugin.rb
|
160
161
|
- lib/version.rb
|
@@ -180,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
181
|
- !ruby/object:Gem::Version
|
181
182
|
version: '0'
|
182
183
|
requirements: []
|
183
|
-
rubygems_version: 3.
|
184
|
+
rubygems_version: 3.0.9
|
184
185
|
signing_key:
|
185
186
|
specification_version: 4
|
186
187
|
summary: A Danger plugin for linting Swift with SwiftLint.
|