[RFC Outreachy] Teach ci/check-whitespace to flag incomplete lines as an error
- From
Bello Caleb Olamide <belkid98@gmail.com>
- Date
- Oct 11, 2025, 14:24 UTC
- Message-ID
- <aOporVVSRRL/v4Lq@ubuntu>
Hello,
While going through the mailing list for some #leftoverbits, I stumbled on this converation. https://public-inbox.org/git/xmqqikla86id.fsf@gitster.g/.
After studying the check-whitespace script, I observed that the script parses each line of the output of the command `git log --check --pretty=format:"---% h% s" "${baseCommit}"..` and formats the result.
But the output of the git command itself does not flag '\no newline at end of file' as it is shown in git diff, in a case where the files does not contain a newline at the end of the file.
One approach I propose to take is to check the each file changed in each commit and check if it has the \n as the last character.
Please, will this be good for a microproject and also I'll appreciate suggestions for the approach. Thank you.
Bello