fastlane-plugin-swiftlint_codequality 1.0.0 → 1.0.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcb5caa1c9cfe3874e7cd77a62ceb1ca8bf9f5ae250968a864fc6826e1d9f090
|
4
|
+
data.tar.gz: 0cd78729191c9ab5b4f49161b0a701dc1b709752757039b036107c6cdcce0202
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '029d5fa7366cc9a7c12faf0fcfd21c334ada9f0412d86482ab3b14ff5963796cc5b28e623d4dafda84b493947dfaa74a126bec9e993157b007dc2ad374fd9f69'
|
7
|
+
data.tar.gz: 63d394b304b77fb9d9393c4557ab1064d7907c94a4575532ba2b9c644b45a25173c74a6f341ceb68723db3ef4478d8399e92a9d34fded33d4e601de7cdaed049
|
@@ -13,15 +13,32 @@ module Fastlane
|
|
13
13
|
.each
|
14
14
|
.select { |l| l.include?("Warning Threshold Violation") == false }
|
15
15
|
.map { |line|
|
16
|
-
|
16
|
+
filename, start, reason = line.match(/(.*\.swift):(\d+):\d+:\s*(.*)/).captures
|
17
17
|
|
18
|
+
# example: error: Type Name Violation: Type name should only contain alphanumeric characters: 'FILE' (type_name)
|
19
|
+
|
20
|
+
issue_type, failure_type, description, rule = reason.match(/(.*?):?\s(.*?):\s(.*)\((.*)\)/).captures
|
21
|
+
|
22
|
+
case issue_type
|
23
|
+
when 'error'
|
24
|
+
severity = 'critical'
|
25
|
+
when 'warning'
|
26
|
+
severity = 'minor'
|
27
|
+
else
|
28
|
+
severity = 'info'
|
29
|
+
end
|
30
|
+
|
18
31
|
{
|
19
|
-
:
|
32
|
+
:type => "issue",
|
33
|
+
:check_name => failure_type.strip,
|
34
|
+
:description => description.strip,
|
20
35
|
:fingerprint => Digest::MD5.hexdigest(line),
|
36
|
+
:severity => severity,
|
21
37
|
:location => {
|
22
|
-
:path =>
|
38
|
+
:path => params[:prefix] + filename.sub(pwd, ''),
|
23
39
|
:lines => {
|
24
|
-
:begin => start.to_i
|
40
|
+
:begin => start.to_i,
|
41
|
+
:end => start.to_i
|
25
42
|
}
|
26
43
|
}
|
27
44
|
}
|
@@ -29,6 +46,8 @@ module Fastlane
|
|
29
46
|
.to_a
|
30
47
|
.to_json
|
31
48
|
|
49
|
+
|
50
|
+
|
32
51
|
IO.write(params[:output], result)
|
33
52
|
|
34
53
|
UI.success "🚀 Generated Code Quality report at #{params[:output]} 🚀"
|
@@ -61,6 +80,12 @@ module Fastlane
|
|
61
80
|
env_name: "SWIFTLINT_CODEQUALITY_OUTPUT",
|
62
81
|
description: "The path to the generated output report",
|
63
82
|
optional: false,
|
83
|
+
type: String),
|
84
|
+
FastlaneCore::ConfigItem.new(key: :prefix,
|
85
|
+
env_name: "SWIFTLINT_CODEQUALITY_PREFIX_PATH",
|
86
|
+
description: "Used to prefix the path of a file. Usefull in e.g. React Native projects where the iOS project is in a subfolder",
|
87
|
+
optional: true,
|
88
|
+
default_value: '',
|
64
89
|
type: String)
|
65
90
|
]
|
66
91
|
end
|