ConventionalCommitsKit 是一个小型的库,用于创建和解析符合 约定式提交 规范的表示形式。
要使用 Apple 的 Swift Package Manager 进行集成,请将以下内容作为依赖项添加到您的 Package.swift
文件中
dependencies: [
.package(url: "https://github.com/alexanderwe/ConventionalCommitsKit.git", from: "1.0.0")
]
或者,导航到您的 Xcode 项目,选择 Swift Packages
,然后点击 +
图标来搜索 ConventionalCommitsKit
。
如果您不想使用上述任何依赖管理工具,您可以手动将 ConventionalCommitsKit
集成到您的项目中。只需将 Sources
文件夹拖到您的 Xcode 项目中即可。
首先导入 ConventionalCommitsKit
import ConventionalCommitsKit
根据提交消息定义一个 ConventionalCommit
。请注意,解析可能会失败并抛出一个相应的错误。
let commitMessage = """
fix: correct minor typos in code
see the issue for details
on typos fixed.
Reviewed-by #Z
Refs #133
"""
let commit = try ConventionalCommit(input: commitMessage)
非常欢迎大家贡献代码 🙌