From ebcd6fcea1517b00153214e3284d6307809175f5 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Sun, 16 Oct 2022 12:05:25 +0200 Subject: lint: check for bad white space habits A little coding hygiene cannot hurt. Add a simple awk script to check all source files for bad white space habits: - trailing white space - trailing new lines at the end of files - missing new line at the end of files - spaces followed by tabs The script outputs color when the terminal supports it. It exits with a non-zero code when there was at least one white space issue found. Call the script in the lint step. Example output of the awk script: config/default_styleset:1:# <-- trailing whitespace config/default_styleset:3:# <-- trailing whitespace doc/aerc.1.scd:78: Executes an arbitrary command in the background. Aerc will set the <-- trailing whitespace doc/aerc.1.scd:234: <-- trailing whitespace doc/aerc.1.scd:237: <-- trailing whitespace worker/types/thread_test.go:74: // return ErrSkipThread<-- space(s) followed by tab(s) worker/lib/testdata/message/invalid/hexa: trailing new line(s) Fix issues reported by the script. NB: The ENDFILE match is a GNU extension. It will be ignored on BSD-awk and trailing new lines will not be detected. The lint make target is only invoked on alpine linux which has GNU awk anyway. NB: Empty cells in scdoc tables require trailing white space... Avoid this by setting content in these cells. I don't really see a use for empty cells. Signed-off-by: Robin Jarry Tested-by: Moritz Poldrack --- doc/aerc.1.scd | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'doc/aerc.1.scd') diff --git a/doc/aerc.1.scd b/doc/aerc.1.scd index dbf782ce..ea4be171 100644 --- a/doc/aerc.1.scd +++ b/doc/aerc.1.scd @@ -76,7 +76,7 @@ These commands work in any context. as a delta from the selected tab. *exec* - Executes an arbitrary command in the background. Aerc will set the + Executes an arbitrary command in the background. Aerc will set the environment variables *$account* and *$folder* when the command is executed from an Account tab or an opened message. @@ -237,10 +237,8 @@ message list, the message in the message viewer, etc). Seen Message has been read - Answered Message has been answered - Flagged Message is flagged for urgent/special attention -- cgit