diff --git a/.github/check-eof-newline.sh b/.github/check-eof-newline.sh
new file mode 100755
index 00000000000..b771f3988dd
--- /dev/null
+++ b/.github/check-eof-newline.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Checks that all text files end with a newline.
+
+ret=0
+
+# Preserve filename with spaces by only splitting on newlines.
+IFS='
+'
+
+for filename in $(git grep --cached -I -l -e '' -- ':/'); do
+ if [ "$(tail -c 1 "./$filename")" != '' ]; then
+ line="$(wc -l "./$filename" | cut -d' ' -f1)"
+ echo "ERROR:$filename:$line: no newline at EOF."
+ ret=1
+ fi
+done
+
+exit $ret
diff --git a/.github/check-line-endings.sh b/.github/check-line-endings.sh
new file mode 100755
index 00000000000..3de67ea87f6
--- /dev/null
+++ b/.github/check-line-endings.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Checks for prohibited line endings.
+# Prohibited line endings: \r\n
+
+git grep --cached -I -n --no-color -P '\r$' -- ':/' |
+awk '
+ BEGIN {
+ FS = ":"
+ OFS = ":"
+ ret = 0
+ }
+ {
+ ret = 1
+ print "ERROR", $1, $2, " prohibited \\r\\n line ending, use \\n instead."
+ }
+ END {
+ exit ret
+ }
+'
diff --git a/.github/check-trailing-whitespace.sh b/.github/check-trailing-whitespace.sh
new file mode 100755
index 00000000000..33841caa81f
--- /dev/null
+++ b/.github/check-trailing-whitespace.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Checks for trailing whitespace
+
+git grep --cached -I -n --no-color -P '[ \t]+$' -- ':/' |
+awk '
+ BEGIN {
+ FS = ":"
+ OFS = ":"
+ ret = 0
+ }
+ {
+ # Only warn for markdown files (*.md) to accomodate text editors
+ # which do not properly handle trailing whitespace.
+ # (e.g. GitHub web editor)
+ if ($1 ~ /\.md$/) {
+ severity = "WARN"
+ } else {
+ severity = "ERROR"
+ ret = 1
+ }
+ print severity, $1, $2, " trailing whitespace."
+ }
+ END {
+ exit ret
+ }
+'
diff --git a/.github/run-checks.sh b/.github/run-checks.sh
new file mode 100755
index 00000000000..7aad1e96220
--- /dev/null
+++ b/.github/run-checks.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+# Runs all check-* scripts, and returns a non-zero exit code if any of them fail.
+
+dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) &&
+ret=0 &&
+for checkscript in "$dir"/check-*; do
+ if ! "$checkscript"; then
+ ret=1
+ fi
+done
+exit $ret
diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index 391c46b4fe9..e0de81abaf1 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -21,6 +21,11 @@ jobs:
- name: Merge to master
run: git checkout --progress --force ${{ github.sha }}
+ - name: Run repository-wide tests
+ if: runner.os == 'Linux'
+ working-directory: ${{ github.workspace }}/.github
+ run: ./run-checks.sh
+
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md
index db96476f913..4829fe43011 100644
--- a/docs/DeveloperGuide.md
+++ b/docs/DeveloperGuide.md
@@ -31,7 +31,7 @@ The ***Architecture Diagram*** given above explains the high-level design of the
* At app launch: Initializes the components in the correct sequence, and connects them up with each other.
* At shut down: Shuts down the components and invokes cleanup methods where necessary.
-[**`Commons`**](#common-classes) represents a collection of classes used by multiple other components.
+[**`Commons`**](#common-classes) represents a collection of classes used by multiple other components.
The rest of the App consists of four components.
@@ -198,7 +198,7 @@ The following activity diagram summarizes what happens when a user executes a ne

-#### Design consideration:
+#### Design consideration:
##### Aspect: How undo & redo executes
diff --git a/docs/Gemfile b/docs/Gemfile
index bf0110f33cb..999a7099d8d 100644
--- a/docs/Gemfile
+++ b/docs/Gemfile
@@ -6,4 +6,4 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem 'jekyll'
gem 'github-pages', group: :jekyll_plugins
-gem 'wdm', '~> 0.1.0' if Gem.win_platform?
\ No newline at end of file
+gem 'wdm', '~> 0.1.0' if Gem.win_platform?
diff --git a/docs/Testing.md b/docs/Testing.md
index 3d584134452..8a99e82438a 100644
--- a/docs/Testing.md
+++ b/docs/Testing.md
@@ -33,4 +33,4 @@ This project has three types of tests:
1. *Integration tests* that are checking the integration of multiple code units (those code units are assumed to be working).
e.g. `seedu.address.storage.StorageManagerTest`
1. Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together.
- e.g. `seedu.address.logic.LogicManagerTest`
\ No newline at end of file
+ e.g. `seedu.address.logic.LogicManagerTest`
diff --git a/docs/UserGuide.md b/docs/UserGuide.md
index 5d0883ceb55..b91c3bab04d 100644
--- a/docs/UserGuide.md
+++ b/docs/UserGuide.md
@@ -29,7 +29,7 @@ AddressBook Level 3 (AB3) is a **desktop app for managing contacts, optimized fo
* **`add`**`n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` : Adds a contact named `John Doe` to the Address Book.
* **`delete`**`3` : Deletes the 3rd contact shown in the current list.
-
+
* **`clear`** : Deletes all contacts.
* **`exit`** : Exits the app.
@@ -73,7 +73,7 @@ Adds a person to the address book.
Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…`
-