Skip to content

Commit 5f435fa

Browse files
authored
Add swiftlint rule to check for unsafe SFSymbol usage (#3700)
<!-- Thank you for submitting a Pull Request and helping to improve Home Assistant. Please complete the following sections to help the processing and review of your changes. Please do not delete anything from this template. --> ## Summary <!-- Provide a brief summary of the changes you have made and most importantly what they aim to achieve --> ## Screenshots <!-- If this is a user-facing change not in the frontend, please include screenshots in light and dark mode. --> ## Link to pull request in Documentation repository <!-- Pull requests that add, change or remove functionality must have a corresponding pull request in the Companion App Documentation repository (https://github.com/home-assistant/companion.home-assistant). Please add the number of this pull request after the "#" --> Documentation: home-assistant/companion.home-assistant# ## Any other notes <!-- If there is any other information of note, like if this Pull Request is part of a bigger change, please include it here. -->
1 parent 62fcf1d commit 5f435fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.swiftlint.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ excluded:
5555
- Pods
5656
- vendor
5757
- "**/**/.build"
58+
- "./.swiftlint.yml"
5859

5960
custom_rules:
6061
prohibit_environment_assignment:
@@ -64,3 +65,9 @@ custom_rules:
6465
severity: error
6566
excluded:
6667
- "Tests"
68+
sf_safe_symbol:
69+
name: "Safe SFSymbol"
70+
message: "Use `SFSafeSymbols` via `systemSymbol` parameters for type safety."
71+
regex: >
72+
(Image\\(systemName:)|(NSImage\\(symbolName:)|(Label[^,]+?,\\s*systemImage:)|(UIApplicationShortcutIcon\\(systemImageName:)
73+
severity: warning

0 commit comments

Comments
 (0)