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: 946e157adb514f50cf4c33d8a99a8c41a384f76415ccd60d68ff7df144844547
4
- data.tar.gz: 24cfe7ee56aee1d6c49ad50ea02530c2e41682d1d99125d6f1de3e427a12e280
3
+ metadata.gz: fcb5caa1c9cfe3874e7cd77a62ceb1ca8bf9f5ae250968a864fc6826e1d9f090
4
+ data.tar.gz: 0cd78729191c9ab5b4f49161b0a701dc1b709752757039b036107c6cdcce0202
5
5
  SHA512:
6
- metadata.gz: 8f2fc081f8a2b3b7684782d021796770534b04968cb8a4af8b5f8636456b2f5cbb261dd902667767e1335a893300847c99a18258872742a5927672f6241c3e20
7
- data.tar.gz: 8e439b119ff71c64d7b38e30129afabd41f2c4ba36b4fd4fa985df1ee0f84866ad1c8b8e9a423aa0b52bbaaabb357fa82e3321b8590b709c23473f3e10201dea
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
- filename, start, reason = line.match(/(.*\.swift):(\d+):\d+:\s*(.*)/).captures
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
- :description => reason,
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 => "ios" + filename.sub(pwd, ''),
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
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module SwiftlintCodequality
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-swiftlint_codequality
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mads Bøgeskov