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许可发布。有关更多信息,请参见许可证文件。