File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -238,10 +238,22 @@ if [ $isFramework = true ]; then
238238 merge_swiftlint_configuration " swiftlint+frameworks.yml" " $tmpFile " " --write-to-file" " $tmpFile .frameworks"
239239 mv " $tmpFile .frameworks" " $tmpFile "
240240
241+ unitTestDir=" false"
242+ # Find the unit test directory
241243 if [ -e " $projectDir /Unit-Tests" ]; then
242- cp " swiftlint+frameworksUnitTest.yml " " $projectDir /Unit-Tests/.swiftlint.yml "
244+ unitTestDir= " $projectDir /Unit-Tests"
243245 elif [ -e " $projectDir /UnitTests" ]; then
244- cp " swiftlint+frameworksUnitTest.yml" " $projectDir /UnitTests/.swiftlint.yml"
246+ unitTestDir=" $projectDir /UnitTests"
247+ fi
248+
249+ if [ -e $unitTestDir ] && [ $unitTestDir != " false" ]; then
250+ if [ -f " $unitTestDir /.project-swiftlint.yml" ]; then
251+ # Deals with .project-swiftlint.yml for unit tests
252+ rm " $unitTestDir /.swiftlint.yml"
253+ merge_swiftlint_configuration " $unitTestDir /.project-swiftlint.yml" " swiftlint+frameworksUnitTest.yml" " --write-to-file" " $unitTestDir /.swiftlint.yml"
254+ else
255+ cp " swiftlint+frameworksUnitTest.yml" " $unitTestDir /.swiftlint.yml"
256+ fi
245257 fi
246258fi
247259
Original file line number Diff line number Diff line change @@ -61,7 +61,6 @@ opt_in_rules:
6161 - contains_over_first_not_nil
6262 - empty_collection_literal
6363 - empty_string
64- - explicit_self
6564 - file_name
6665 - for_where
6766 - joined_default_parameter
@@ -79,11 +78,14 @@ opt_in_rules:
7978 - static_operator
8079 - toggle_bool
8180 - unowned_variable_capture
82- - unused_import
8381 - vertical_whitespace_closing_braces
8482 - single_test_class
8583 - strong_iboutlet
8684
85+ analyzer_rules : # Rules run by `swiftlint analyze` (experimental)
86+ - explicit_self
87+ - unused_import
88+
8789# rule parameters
8890file_length :
8991 warning : 600
You can’t perform that action at this time.
0 commit comments