<p></p>
<p><b>@tomhughes</b> requested changes on this pull request.</p>

<p dir="auto">In addition to the inline comments, should we update <code class="notranslate">.rubocop.yml</code> to add an include for <code class="notranslate">Dangerfile</code> so it gets linted/</p><hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4988#discussion_r1679809188">Dangerfile</a>:</p>
<pre style='color:#555'>> +
+# Report if some translation file (except en.yml) is modified
+unless modified_yml_files.empty?
+  modified_files_str = modified_yml_files.map { |file| "`#{file}`" }.join(", ")
+  warn("The following YAML files other than `en.yml` have been modified: #{modified_files_str}. Only `en.yml` is allowed to be changed.")
+  auto_label.set(pr_number, "Compromised Translations", "ff0000")
+end
+
+# Report if there are merge-commits in PR
+are_merge_commits_available = git.commits.any? { |c| c.parents.count > 1 }
+warn("Merge commits found in this pull request. Please, read CONTRIBUTE.md!") if are_merge_commits_available
+auto_label.set(pr_number, "Merge Commits", "ffaec9") if are_merge_commits_available
+
+# Report "Everything is fine!" if no warnings were generated
+message("Everything is fine!") if !is_big_pr && modified_yml_files.empty? && !are_merge_commits_available
+auto_label.set(pr_number, "Good PR", "00ff00") if !is_big_pr && modified_yml_files.empty? && !are_merge_commits_available
</pre>
<p dir="auto">Again this could be a block if and I suspect you could use <code class="notranslate">unless violation_reports.empty?</code> here rather than retesting all the previous conditions, which will quickly get out of control.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4988#discussion_r1679809256">Dangerfile</a>:</p>
<pre style='color:#555'>> +auto_label.set(pr_number, "Big PR", "ffff00") if is_big_pr
+
+# Get list of translation files (except en.yml) which are modified
+modified_yml_files = git.modified_files.select do |file|
+  file.start_with?("config/locales") && File.extname(file) == ".yml" && File.basename(file) != "en.yml"
+end
+
+# Report if some translation file (except en.yml) is modified
+unless modified_yml_files.empty?
+  modified_files_str = modified_yml_files.map { |file| "`#{file}`" }.join(", ")
+  warn("The following YAML files other than `en.yml` have been modified: #{modified_files_str}. Only `en.yml` is allowed to be changed.")
+  auto_label.set(pr_number, "Compromised Translations", "ff0000")
+end
+
+# Report if there are merge-commits in PR
+are_merge_commits_available = git.commits.any? { |c| c.parents.count > 1 }
</pre>
<p dir="auto">Again it would probably be better to make this a block if, or maybe we should use the <code class="notranslate">linear_history</code> plugin? That would give a more generic message though.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4988#discussion_r1679810043">Dangerfile</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,32 @@
+# Remove all previously added labels
+auto_label.remove("Big PR")
+auto_label.remove("Compromised Translations")
+auto_label.remove("Merge Commits")
+auto_label.remove("Good PR")
+
+# Report if number of changed lines is > 500
+pr_number = github.pr_json["number"]
+is_big_pr = git.lines_of_code > 500
</pre>
<p dir="auto">It would probably be better to make this a block if rather than doing the test and then guarding each line with the same guard.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4988#discussion_r1679810864">Dangerfile</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,32 @@
+# Remove all previously added labels
+auto_label.remove("Big PR")
+auto_label.remove("Compromised Translations")
+auto_label.remove("Merge Commits")
+auto_label.remove("Good PR")
+
+# Report if number of changed lines is > 500
+pr_number = github.pr_json["number"]
</pre>
<p dir="auto">This is a common variable, not something related to this check, so it should be lifted up above it.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4988#pullrequestreview-2180901032">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLNIO4UI6IEXUUMHER3ZMVL6HAVCNFSM6AAAAABK4KPUJOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCOBQHEYDCMBTGI">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLNZSOY6T5XRZOIKK2TZMVL6HA5CNFSM6AAAAABK4KPUJOWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTUB7XUKQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4988/review/2180901032</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4988#pullrequestreview-2180901032",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4988#pullrequestreview-2180901032",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>