fastlane-plugin-ciutils 0.2.4 → 0.2.5

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
  SHA1:
3
- metadata.gz: 2bceff1482108fdecec0a8a40f87507fcd6df460
4
- data.tar.gz: 5a418e659c980d6b675946e514b2ef5dda11a356
3
+ metadata.gz: f0d65ab73b252a6e36cd9f6021f3e67fb3427b05
4
+ data.tar.gz: c5f048d5e095409ac658ecfe0e7529b3071baa5e
5
5
  SHA512:
6
- metadata.gz: 7230ead5db8f74bd403c184422f7ae31ae1edd39f3359876c5ff043faa1a8a582caad4634bee2dec12d247ba94f718d88db460298fd25df4003fa2858328cbb9
7
- data.tar.gz: 398b6be24c49be54714421cf44984874d6a90d903e6038b38109b25309f1a3b425fc998f79e85cd1d55b4c0fb2cfac59b7ce3f142c78dd68d84fac402e243acf
6
+ metadata.gz: 5d916eeb97307c8f4b65608b77e7998e1ac1c41f4b9217dbdc98367426be3ea249c84b215e4318a771ad3e522d2a5a3eeed085648646a5a6144e0f965150828f
7
+ data.tar.gz: 56913f7fec5fc1d579708499ec400b318982cb6971cccff87765a136a2c1070e718b5d9dc561936972468de76ddb7d7172aecaec2c4f0bf3ca987d2a87046220
@@ -13,6 +13,7 @@ module Fastlane
13
13
 
14
14
  lizard_extra_args = params[:lizard_extra_args]
15
15
  swiftlint_extra_args = params[:swiftlint_extra_args]
16
+ swiftlint_config_arg = swiftlint_config_path_arg(params)
16
17
 
17
18
  swiftlint_path_args = self.swiftlint_path_args(params)
18
19
  lizard_path_args = self.lizard_path_args(params)
@@ -39,7 +40,7 @@ module Fastlane
39
40
 
40
41
  # run static code analysis
41
42
  unless params[:skip_swiftlint_analysis]
42
- sh("swiftlint lint #{swiftlint_path_args} --quiet > '#{swiftlint_output_path}' || exit 0")
43
+ sh("swiftlint lint #{swiftlint_path_args} #{swiftlint_config_arg} #{swiftlint_extra_args} --quiet > '#{swiftlint_output_path}' || exit 0")
43
44
  end
44
45
 
45
46
  unless params[:skip_lizard_analysis]
@@ -89,6 +90,28 @@ module Fastlane
89
90
  include_files + exclude_files
90
91
  end
91
92
 
93
+ def self.swiftlint_config_path_arg(params)
94
+ file_path = params[:swiftlint_config_path]
95
+ config_path_arg = ""
96
+
97
+ if File.exist?('.swiftlint.yml')
98
+ config_path_arg = File.expand_path('.swiftlint.yml')
99
+ end
100
+
101
+ if file_path != nil && !file_path.strip.empty?
102
+ config_path_arg = File.expand_path(file_path.strip)
103
+ if !File.exist?(config_path_arg)
104
+ config_path_arg = ""
105
+ end
106
+ end
107
+
108
+ if !config_path_arg.strip.empty?
109
+ return "--config '#{config_path_arg}'"
110
+ else
111
+ return ""
112
+ end
113
+ end
114
+
92
115
  def self.swiftlint_path_args(params)
93
116
  include_files = ""
94
117
 
@@ -135,6 +158,11 @@ module Fastlane
135
158
  default_value: false,
136
159
  optional: true),
137
160
 
161
+ FastlaneCore::ConfigItem.new(key: :swiftlint_config_path,
162
+ env_name: "FL_EN_SWIFTLINT_CONFIG_PATH",
163
+ description: 'Path to .swiftlint.yml',
164
+ optional: true),
165
+
138
166
  FastlaneCore::ConfigItem.new(key: :swiftlint_extra_args,
139
167
  env_name: "FL_EN_SWIFTLINT_EXTRA ARGS",
140
168
  description: 'Extra command line args for swiftlint',
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Ciutils
3
- VERSION = "0.2.4"
3
+ VERSION = "0.2.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-ciutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolae Ghimbovschi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-18 00:00:00.000000000 Z
11
+ date: 2019-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slather