Skip to content

Commit c176d77

Browse files
committed
Update Dangerfile to use latest Dangermattic plugins
1 parent 3300d15 commit c176d77

1 file changed

Lines changed: 20 additions & 19 deletions

File tree

Dangerfile

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
# frozen_string_literal: true
22

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
64

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)
107

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
149

15-
has_wip_label || has_wip_title
16-
end
10+
podfile_checker.check_podfile_does_not_have_branch_references
1711

18-
return if github.pr_labels.include?('Releases')
12+
ios_release_checker.check_core_data_model_changed
13+
ios_release_checker.check_release_notes_and_app_store_strings
1914

20-
github.dismiss_out_of_range_messages
15+
# skip remaining checks if we're during the release process
16+
if github.pr_labels.include?('Releases')
17+
message('This PR has the `Releases` label: some checks will be skipped.')
18+
return
19+
end
2120

22-
manifest_pr_checker.check_all_manifest_lock_updated
21+
common_release_checker.check_internal_release_notes_changed(report_type: :message)
22+
23+
ios_release_checker.check_modified_translations_on_release_branch
2324

2425
labels_checker.check(
2526
do_not_merge_labels: ['[Status] DO NOT MERGE'],
2627
required_labels: [//],
2728
required_labels_error: 'PR requires at least one label.'
2829
)
2930

30-
view_changes_need_screenshots.view_changes_need_screenshots
31+
view_changes_checker.check
3132

32-
pr_size_checker.check_diff_size
33+
pr_size_checker.check_diff_size(max_size: 500)
3334

3435
# 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)
36+
unless github.pr_draft? || (github_utils.wip_feature? && !(github_utils.release_branch? || github_utils.main_branch?))
37+
milestone_checker.check_milestone_due_date(days_before_due: 4)
38+
end

0 commit comments

Comments
 (0)