Make danger labels use consisent capitalisation

Existing labels are all lower case and avoid spaces.
This commit is contained in:
Tom Hughes 2024-10-26 12:17:38 +01:00
parent 8e566b0bff
commit 67749e7534

View file

@ -4,9 +4,9 @@ pr_number = github.pr_json["number"]
# Report if number of changed lines is > 500 # Report if number of changed lines is > 500
if git.lines_of_code > 500 if git.lines_of_code > 500
warn("Number of updated lines of code is too large to be in one PR. Perhaps it should be separated into two or more?") warn("Number of updated lines of code is too large to be in one PR. Perhaps it should be separated into two or more?")
auto_label.set(pr_number, "Big PR", "FBCA04") auto_label.set(pr_number, "big-pr", "FBCA04")
else else
auto_label.remove("Big PR") auto_label.remove("big-pr")
end end
# Get list of translation files (except en.yml) which are modified # Get list of translation files (except en.yml) which are modified
@ -16,17 +16,17 @@ end
# Report if some translation file (except en.yml) is modified # Report if some translation file (except en.yml) is modified
if modified_yml_files.empty? if modified_yml_files.empty?
auto_label.remove("Inappropriate Translations") auto_label.remove("inappropriate-translations")
else else
modified_files_str = modified_yml_files.map { |file| "`#{file}`" }.join(", ") 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. Translations are updated via Translatewiki, see CONTRIBUTING.md.") warn("The following YAML files other than `en.yml` have been modified: #{modified_files_str}. Only `en.yml` is allowed to be changed. Translations are updated via Translatewiki, see CONTRIBUTING.md.")
auto_label.set(pr_number, "Inappropriate Translations", "B60205") auto_label.set(pr_number, "inappropriate-translations", "B60205")
end end
# Report if there are merge-commits in PR # Report if there are merge-commits in PR
if git.commits.any? { |c| c.parents.count > 1 } if git.commits.any? { |c| c.parents.count > 1 }
warn("Merge commits are found in PR. Please rebase to get rid of the merge commits in this PR, see CONTRIBUTING.md.") warn("Merge commits are found in PR. Please rebase to get rid of the merge commits in this PR, see CONTRIBUTING.md.")
auto_label.set(pr_number, "Merge Commits", "D93F0B") auto_label.set(pr_number, "merge-commits", "D93F0B")
else else
auto_label.remove("Merge Commits") auto_label.remove("merge-commits")
end end