1 Star 0 Fork 0

zz-github-forks/SwifterSwift

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Dangerfile 1.83 KB
一键复制 编辑 原始数据 按行查看 历史
message('Thank you for submitting a pull request to SwifterSwift. The team will review your submission as soon as possible.')
# Checks for modified source files
source_changes_exist = !git.modified_files.grep(/Sources/).empty?
# Checks for changelog entry
no_changelog_entry = !git.modified_files.include?("CHANGELOG.md")
# Checks for tests
no_test_changes = git.modified_files.grep(/Tests/).empty?
if source_changes_exist && no_test_changes
warn('Consider adding tests for new extensions or updating existing tests for a modified SwifterSwift extension')
end
if source_changes_exist && no_changelog_entry
warn('The source files have been modified. Please consider adding a CHANGELOG entry if necessary.')
end
# Swiftlint Danger
# Workaround see: https://github.com/ashfurrow/danger-ruby-swiftlint/issues/87
files_to_lint = (git.modified_files - git.deleted_files) + git.added_files
swiftlint.lint_files(files_to_lint, additional_swiftlint_args: '--no-force-exclude')
# Checks if pull request is labeled as [WIP]
warn('This pull request is marked as Work in Progress. DO NOT MERGE!') if github.pr_title.include? "[WIP]"
# Xcode summary
def summary(platform:)
xcode_summary.report "xcodebuild-#{platform}.json"
end
def label_tests_summary(label:, platform:)
file_name = "xcodebuild-#{platform}.json"
json = File.read(file_name)
data = JSON.parse(json)
data["tests_summary_messages"].each { |message|
if !message.empty?
message.insert(1, " " + label + ":")
end
}
File.open(file_name,"w") do |f|
f.puts JSON.pretty_generate(data)
end
end
label_tests_summary(label: "iOS", platform: "ios")
label_tests_summary(label: "tvOS", platform: "tvos")
label_tests_summary(label: "macOS", platform: "macos")
summary(platform: "ios")
summary(platform: "tvos")
summary(platform: "macos")
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Swift
1
https://gitee.com/zz-github-forks/SwifterSwift.git
git@gitee.com:zz-github-forks/SwifterSwift.git
zz-github-forks
SwifterSwift
SwifterSwift
master

搜索帮助