forked from nus-cs2103-AY2324S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As repository-wide checks were not ported over during the migration from Travis to GitHub Actions, let's reintroduce them. * Fix formatting errors in documentation
- Loading branch information
Showing
11 changed files
with
88 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ AddressBook Level 3 (AB3) is a **desktop app for managing contacts, optimized fo | |
* **`add`**`n/John Doe p/98765432 e/[email protected] 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]…` | ||
|
||
<div markdown="span" class="alert alert-primary">:bulb: **Tip:** | ||
<div markdown="span" class="alert alert-primary">:bulb: **Tip:** | ||
A person can have any number of tags (including 0) | ||
</div> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters