SwiftDocAutomator
1.0.0
SwiftDocautomator是一種強大的工具,它會根據官方的Apple和Swift準則自動為您的Swift代碼生成文檔註釋。它通過分析代碼並製作簡潔,易於理解的文檔來幫助您節省時間和精力。
要安裝SwiftDocautomator,只需克隆存儲庫並安裝所需的依賴項:
git clone https://github.com/Saik0s/SwiftDocAutomator.git
cd SwiftDocAutomator
pip install -r requirements.txt要使用SwiftDocautomator,請運行以下命令:
python main.py /path/to/your/swift/file.swift這將遵循官方的Apple和Swift指南,為指定的Swift文件中的所有功能和屬性生成文檔註釋。
假設您具有以下SWIFT功能:
internal static func _typeMismatch ( at path : [ CodingKey ] , expectation : Any . Type , reality : Any ) -> DecodingError {
let description = " Expected to decode ( expectation ) but found ( _typeDescription ( of : reality ) ) instead. "
return . typeMismatch ( expectation , Context ( codingPath : path , debugDescription : description ) )
}SwiftDocautomator將生成以下文檔評論:
/// Returns a `.typeMismatch` error describing the expected type.
///
/// - parameter path: The path of `CodingKey`s taken to decode a value of this type.
/// - parameter expectation: The type expected to be encountered.
/// - parameter reality: The value that was encountered instead of the expected type.
/// - returns: A `DecodingError` with the appropriate path and debug description. 我很高興收到您可能會有的任何貢獻。如果您有任何建議,錯誤報告或功能請求,請隨時在GitHub存儲庫上打開問題。您的反饋對我來說很有價值,我感謝您提供的任何意見。
SwiftDocautomator由MIT許可發布。有關更多信息,請參見許可證文件。