|
| 1 | +# This option tells Periphery to not report any Swift code as unused if it's accessible from Objective-C. This includes any class that inherits from NSObject, and any method or property marked with the @objc or @objcMembers attribute. |
| 2 | +# Woocommerce-ios, is a mixed Swift and Objective-C project. Swift code is often called from Objective-C and vice-versa. Without this flag, Periphery would incorrectly flag Swift code that is only used by Objective-C parts of the app as "unused," which would be a false positive. Setting this to true is essential for getting accurate results in a mixed-language codebase. |
| 3 | +retain_objc_accessible: true |
| 4 | + |
| 5 | +# This option prevents Periphery from flagging unused parameters in protocol method implementations. |
| 6 | +# Often, a protocol will define a method with parameters that are needed by some, but not all, conforming types. If a specific implementation doesn't need to use a parameter, Swift still requires that the method signature matches the protocol exactly. Periphery would normally see this unused parameter and flag it. However, removing it would cause a compile error because the method signature would no longer match the protocol. This flag tells Periphery to ignore these cases, avoiding false positives. |
| 7 | +retain_unused_protocol_func_params: true |
| 8 | + |
| 9 | +# This option retains all code within a previews struct that conforms to SwiftUI's PreviewProvider protocol. |
| 10 | +# SwiftUI Previews are a powerful feature for UI development in Xcode. The code you write for previews is often not directly called from your main application target; it's used by Xcode's canvas. Periphery would see this and incorrectly mark the preview code as unused. This flag correctly tells Periphery to always keep preview provider code, which is the desired behavior. |
| 11 | +retain_swift_ui_previews: true |
| 12 | + |
| 13 | +# This option disables the check for public declarations that are only used within their own module. |
| 14 | +# Normally, Periphery would suggest changing public to internal or private in these cases to reduce the public API surface of a module. |
| 15 | +disable_redundant_public_analysis: false |
| 16 | + |
| 17 | +# By default, Periphery will scan all targets in your project, including test targets. |
| 18 | +# This can lead to false positives, as test code is not part of the main application. |
| 19 | +# This option tells Periphery to exclude all test targets from the scan, ensuring that only the application code is analyzed. |
| 20 | +exclude_tests: true |
| 21 | + |
| 22 | +schemes: |
| 23 | +- WooCommerce |
| 24 | + |
| 25 | +project: WooCommerce.xcworkspace |
| 26 | + |
| 27 | +# Used for local run by `periphery scan` |
| 28 | +# This will not conflict with CI build configuration because of build skipping by `--skip-build` and `--index-store-path` |
| 29 | +build_arguments: |
| 30 | +- -xcconfig |
| 31 | +- config/WooCommerce.debug.xcconfig |
| 32 | + |
| 33 | +# A baseline is used to manage the large number of warnings from a mature codebase. |
| 34 | +# It contains a snapshot of all "existing/acceptable" warnings. Periphery will ignore all |
| 35 | +# warnings in this file, allowing you to focus on new issues in pull requests. |
| 36 | +# |
| 37 | +# After fixing existing warnings, regenerate this file with: |
| 38 | +# periphery scan --write-baseline Scripts/Periphery/periphery_baseline.json |
| 39 | +baseline: Scripts/Periphery/periphery_baseline.json |
| 40 | + |
| 41 | +exclude_targets: |
| 42 | +- GenerateCredentials |
| 43 | +- WooCommerceScreenshots |
| 44 | +- WordPressAuthenticator |
| 45 | +- WordPressAuthenticatorTests |
| 46 | +- WooCommerceTests |
| 47 | +- WooCommerceUITests |
| 48 | +- NotificationExtension |
| 49 | +- StoreWidgetsExtension |
| 50 | +- WatchWidgetsExtension |
| 51 | +- "Woo Watch App" |
| 52 | +- Fakes |
| 53 | +- XcodeTarget_WooCommerceTests |
| 54 | +- XcodeTarget_WooCommerceUITests |
| 55 | +- XcodeTarget_WordPressAuthenticatorTests |
| 56 | + |
| 57 | +index_exclude: |
| 58 | +- Pods/* |
| 59 | +- vendor/** |
| 60 | +- BuildTools/.build/** |
| 61 | +- "**/Tests/*" |
| 62 | +- "**/Test*/*" |
| 63 | +- "docs/*" |
| 64 | +- "fastlane/*" |
| 65 | +- "config/*" |
| 66 | +- "**/*.xib" |
| 67 | +- "**/*.storyboard" |
| 68 | +- "**/*.generated.swift" |
0 commit comments