mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Automatically open a PR to bump the calver (#4167)
* Update our tools package to Swift 6.1
Also improves the package layout with subdirectories 📁
* Update GenerateSDKMocks to be an Async command.
* Add a tool to bump the project CalVer every month.
* Add a workflow to automatically bump the calendar version.
Note: This only does year & month, the patch is handled by the release script.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import ArgumentParser
|
||||
import CommandLineTools
|
||||
import Foundation
|
||||
|
||||
struct UnusedStrings: ParsableCommand {
|
||||
static let configuration = CommandConfiguration(abstract: "Generates a report showing which strings aren't used in the project.")
|
||||
|
||||
@Flag(help: "Save the results to disk instead of printing them.")
|
||||
var saveToFile = false
|
||||
|
||||
func run() throws {
|
||||
try peripheryScan()
|
||||
}
|
||||
|
||||
func peripheryScan() throws {
|
||||
print("Analysing project, this may take a while…")
|
||||
|
||||
// Uses the existing .periphery.yml with small tweaks to the output.
|
||||
let command = "periphery scan --quiet --relative-results --report-include ElementX/Sources/Generated/Strings.swift"
|
||||
let output = try Zsh.run(command: command)
|
||||
|
||||
guard let output else {
|
||||
print("Nothing reported.")
|
||||
return
|
||||
}
|
||||
|
||||
if saveToFile {
|
||||
try output.write(to: .projectDirectory.appending(component: "Unused Strings.txt"), atomically: true, encoding: .utf8)
|
||||
print("Report saved: Unused Strings.txt")
|
||||
} else {
|
||||
print(output)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user