Skip to content

Commit 189c0b0

Browse files
committed
Prevent explicit_acl from being applied in frameworks unit tests
1 parent 61cd264 commit 189c0b0

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

SwiftLint/copy-and-run-swiftlint-config.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ if [ $isFramework = true ]; then
237237
# Merge the Frameworks specific configuration.
238238
merge_swiftlint_configuration "swiftlint+frameworks.yml" "$tmpFile" "--write-to-file" "$tmpFile.frameworks"
239239
mv "$tmpFile.frameworks" "$tmpFile"
240+
241+
if [ -e "$projectDir/Unit-Tests" ]; then
242+
cp "swiftlint+frameworksUnitTest.yml" "$projectDir/Unit-Tests/.swiftlint.yml"
243+
elif [ -e "$projectDir/UnitTests" ]; then
244+
cp "swiftlint+frameworksUnitTest.yml" "$projectDir/UnitTests/.swiftlint.yml"
245+
fi
240246
fi
241247

242248
# Comment out the disabled custom rules from the configuration file
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
###
2+
# swiftlint+frameworks.yml
3+
# For a framework project only
4+
#
5+
# This file gets copied in Unit-Tests or UnitTests folder.
6+
#
7+
# Important File Information:
8+
# - The order of the section is important and must be maintained (1-disabled_rules, 2-excluded, 3-opt_in_rules).
9+
# - There must be an empty line between each section.
10+
# - There must be an empty line at the end of the file.
11+
# - [Indentation] There should be 2 whitespaces before each rule declaration (" ").
12+
13+
# rule identifiers to exclude from running
14+
disabled_rules:
15+
- explicit_acl
16+
17+
# paths to ignore during linting. overridden by `included`.
18+
excluded:
19+
20+
# optional rules that need to be manually opt-in to be used
21+
opt_in_rules:

0 commit comments

Comments
 (0)