|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | | -def release_branch? |
4 | | - danger.github.branch_for_base.start_with?('release/') || danger.github.branch_for_base.start_with?('hotfix/') |
5 | | -end |
| 3 | +github.dismiss_out_of_range_messages |
6 | 4 |
|
7 | | -def main_branch? |
8 | | - danger.github.branch_for_base == 'trunk' |
9 | | -end |
| 5 | +# `files: []` forces rubocop to scan all files, not just the ones modified in the PR |
| 6 | +rubocop.lint(files: [], force_exclusion: true, inline_comment: true, fail_on_inline_comment: true, include_cop_names: true) |
10 | 7 |
|
11 | | -def wip_feature? |
12 | | - has_wip_label = github.pr_labels.any? { |label| label.include?('WIP') } |
13 | | - has_wip_title = github.pr_title.include?('WIP') |
| 8 | +manifest_pr_checker.check_all_manifest_lock_updated |
14 | 9 |
|
15 | | - has_wip_label || has_wip_title |
| 10 | +podfile_checker.check_podfile_does_not_have_branch_references |
| 11 | + |
| 12 | +ios_release_checker.check_core_data_model_changed |
| 13 | +ios_release_checker.check_release_notes_and_app_store_strings |
| 14 | + |
| 15 | +# skip remaining checks if we're in a release-process PR |
| 16 | +if github.pr_labels.include?('Releases') |
| 17 | + message('This PR has the `Releases` label: some checks will be skipped.') |
| 18 | + return |
16 | 19 | end |
17 | 20 |
|
18 | | -return if github.pr_labels.include?('Releases') |
| 21 | +common_release_checker.check_internal_release_notes_changed(report_type: :message) |
19 | 22 |
|
20 | | -github.dismiss_out_of_range_messages |
| 23 | +ios_release_checker.check_modified_translations_on_release_branch |
21 | 24 |
|
22 | | -manifest_pr_checker.check_all_manifest_lock_updated |
| 25 | +view_changes_checker.check |
| 26 | + |
| 27 | +pr_size_checker.check_diff_size(max_size: 500) |
| 28 | + |
| 29 | +# skip remaining checks if the PR is still a Draft |
| 30 | +if github.pr_draft? |
| 31 | + message('This PR is still a Draft: some checks will be skipped.') |
| 32 | + return |
| 33 | +end |
23 | 34 |
|
24 | 35 | labels_checker.check( |
25 | 36 | do_not_merge_labels: ['[Status] DO NOT MERGE'], |
26 | 37 | required_labels: [//], |
27 | 38 | required_labels_error: 'PR requires at least one label.' |
28 | 39 | ) |
29 | 40 |
|
30 | | -view_changes_need_screenshots.view_changes_need_screenshots |
31 | | - |
32 | | -pr_size_checker.check_diff_size |
33 | | - |
34 | | -# skip check for draft PRs and for WIP features unless the PR is against the main branch or release branch |
35 | | -milestone_checker.check_milestone_due_date(days_before_due: 4) unless github.pr_draft? || (wip_feature? && !(release_branch? || main_branch?)) |
36 | | - |
37 | | -rubocop.lint(inline_comment: true, fail_on_inline_comment: true, include_cop_names: true) |
| 41 | +# runs the milestone check if this is not a WIP feature and the PR is against the main branch or the release branch |
| 42 | +milestone_checker.check_milestone_due_date(days_before_due: 4) if (github_utils.main_branch? || github_utils.release_branch?) && !github_utils.wip_feature? |
0 commit comments