This directory contains scripts and tools used for development and maintenance of the Home Assistant iOS app.
Detects unused localization strings in the codebase.
Usage:
python3 Tools/detect_unused_strings.pyWhat it does:
- Parses
Sources/Shared/Resources/Swiftgen/Strings.swiftto extract all L10n properties and their corresponding Localizable keys - Checks for usage of L10n properties in Swift source code
- Double-checks for direct usage of Localizable keys in the codebase
- Reports unused strings that can be safely removed
Exit codes:
0: No unused strings found1: Unused strings detected (normal for reporting)
Converts Xcode code coverage from an .xcresult bundle into an LCOV tracefile, which is
what Codecov consumes. CI runs it after fastlane test so pull requests get a coverage
report; the uploader's own Swift plugin cannot read Xcode result bundles reliably.
Usage:
python3 Tools/xccov_to_lcov.py fastlane/test_output/Tests-Unit.xcresult --lcov coverage.lcovWhat it does:
- Dumps per-line execution counts with
xcrun xccov view --archive --json - Rewrites absolute source paths as repository-relative paths, dropping anything outside the repository
- Writes an LCOV tracefile, and optionally appends a Markdown coverage summary to
--summary
Exit codes:
0: Coverage written1:xccovfailed, or the bundle covered no repository sources
Measures how much of a pull request's own diff the unit tests cover, out of the LCOV
tracefile xccov_to_lcov.py writes. CI's patch-coverage job gates on it: below 90%, it
fails and requests changes on the pull request. When the tracefile is missing, because the
test run or the conversion failed, that job skips the gate instead of blocking on a number
it could not measure.
Usage:
python3 Tools/diff_coverage.py fastlane/test_output/coverage.lcov --base origin/mainWhat it does:
- Reads the LCOV tracefile as per-line execution counts
- Takes the lines the branch adds or changes from
git diff --unified=0 <base>...HEAD - Keeps the changed lines that coverage marks executable, dropping ignored paths
- Reports the covered share, a per-file table, and which changed lines no test runs
Exit codes:
0: Coverage of the changed lines is at or above--threshold(default 90%)1: Coverage is below the threshold, or the tracefile is missing
Builds the Material Design Icons font file from the icon definitions.
SwiftGen template for generating Swift code from Material Design Icons JSON data.