From ba5d6c9108103e36e6b486ddc6b8ae10d02c2c02 Mon Sep 17 00:00:00 2001
From: Adam Brown <adampsbrown@gmail.com>
Date: Tue, 2 Aug 2022 12:19:16 +0100
Subject: [PATCH] replacing all danger mutable lets with const

---
 tools/danger/dangerfile.js | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/danger/dangerfile.js b/tools/danger/dangerfile.js
index 6bf0a10bf0..26ab19ce7b 100644
--- a/tools/danger/dangerfile.js
+++ b/tools/danger/dangerfile.js
@@ -13,7 +13,7 @@ const github = danger.github
 const user = pr.user.login
 const modified = danger.git.modified_files
 const created = danger.git.created_files
-let editedFiles = [...modified, ...created]
+const editedFiles = [...modified, ...created]
 
 // Check that the PR has a description
 if (pr.body.length == 0) {
@@ -30,10 +30,10 @@ const changelogAllowList = [
     "dependabot[bot]",
 ]
 
-let requiresChangelog = !changelogAllowList.includes(user)
+const requiresChangelog = !changelogAllowList.includes(user)
 
 if (requiresChangelog) {
-    let changelogFiles = editedFiles.filter(file => file.startsWith("changelog.d/"))
+    const changelogFiles = editedFiles.filter(file => file.startsWith("changelog.d/"))
 
     if (changelogFiles.length == 0) {
         warn("Please add a changelog. See instructions [here](https://github.com/vector-im/element-android/blob/develop/CONTRIBUTING.md#changelog)")
@@ -77,18 +77,18 @@ const allowList = [
     "yostyle",
 ]
 
-let requiresSignOff = !allowList.includes(user)
+const requiresSignOff = !allowList.includes(user)
 
 if (requiresSignOff) {
-    let hasPRBodySignOff = pr.body.includes(signOff)
-    let hasCommitSignOff = danger.git.commits.every(commit => commit.message.includes(signOff))
+    const hasPRBodySignOff = pr.body.includes(signOff)
+    const hasCommitSignOff = danger.git.commits.every(commit => commit.message.includes(signOff))
     if (!hasPRBodySignOff && !hasCommitSignOff) {
         fail("Please add a sign-off to either the PR description or to the commits themselves.")
     }
 }
 
 // Check for screenshots on view changes
-let hasChangedViews = editedFiles.filter(file => file.includes("/layout")).length > 0
+const hasChangedViews = editedFiles.filter(file => file.includes("/layout")).length > 0
 if (hasChangedViews) {
     if (!pr.body.includes("user-images")) {
         warn("You seem to have made changes to views. Please consider adding screenshots.")
@@ -96,7 +96,7 @@ if (hasChangedViews) {
 }
 
 // Check for pngs on resources
-let hasPngs = editedFiles.filter(file => file.toLowerCase().endsWith(".png")).length > 0
+const hasPngs = editedFiles.filter(file => file.toLowerCase().endsWith(".png")).length > 0
 if (hasPngs) {
     warn("You seem to have made changes to some images. Please consider using an vector drawable.")
 }