-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor FXIOS-10205 [Swiftlint] Enable implicitly_unwrapped_optional rule but keep it disabled for test files using nested Swiftlint configurations #24031
base: main
Are you sure you want to change the base?
Changes from all commits
ffceb00
15ec372
002cefb
7feedec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Swiftlint configuration overloads that will be applied to all files | ||
# in this folder and all its children recursively, unless another | ||
# nested configuration takes over. | ||
# https://github.com/realm/SwiftLint#nested-configurations. | ||
|
||
disabled_rules: | ||
# Many test use implicitly unwrapped optional properties that | ||
# initialized in setUp and reset in tearDown. | ||
- implicitly_unwrapped_optional |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15861,7 +15861,7 @@ | |
); | ||
runOnlyForDeploymentPostprocessing = 0; | ||
shellPath = /bin/sh; | ||
shellScript = "if [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nMODIFIED_FILES=$(git diff --name-only --diff-filter=ACM | grep -e '\\.swift$')\n\nif which swiftlint > /dev/null; then\n for file in $MODIFIED_FILES; do\n swiftlint lint \"${SRCROOT}/../${file}\" --config \"${SRCROOT}/../.swiftlint.yml\"\n done\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\" \nfi\n"; | ||
shellScript = "if [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nMODIFIED_FILES=$(git diff --name-only --diff-filter=ACM | grep -e '\\.swift$')\n\nif which swiftlint > /dev/null; then\n\n # Move to the location of the root Swiftlint config file in\n # order to use nested configurations\n cd ${SWIFTLINT_ROOT}\n \n for file in $MODIFIED_FILES; do\n swiftlint lint \"${SRCROOT}/../${file}\"\n done\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\" \nfi\n"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a small change the rest looks great 🎉 . i'd have: // move out of the for loop
cd $SWIFTLINT_ROOT
for loop {} I'd also reduce the comment a bit and add it directly to the cd $SWIFTLINT_ROOT saying that this instruction is needed here in order to have nested swiftlint configurations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, done! |
||
}; | ||
E6639F191BF11E3A002D0853 /* Conditionally Add Settings Bundle */ = { | ||
isa = PBXShellScriptBuildPhase; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Swiftlint configuration overloads that will be applied to all files | ||
# in this folder and all its children recursively, unless another | ||
# nested configuration takes over. | ||
# https://github.com/realm/SwiftLint#nested-configurations. | ||
|
||
disabled_rules: | ||
# Many test use implicitly unwrapped optional properties that | ||
# initialized in setUp and reset in tearDown. | ||
- implicitly_unwrapped_optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Thanks for the work on this issue 🙌 I'll let my colleagues do the final review!