lint/checkpatch: Update 'check for adding lines without a newline'
This reduce the difference with linux v5.19-rc7. Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: I1bd68e9a6609a3dfa7dc856f24e4b616714d9990 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65826 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@tutanota.com>
This commit is contained in:
parent
c5ede53ba8
commit
86e4a3ae05
|
@ -3329,8 +3329,11 @@ sub process {
|
||||||
|
|
||||||
# check for adding lines without a newline.
|
# check for adding lines without a newline.
|
||||||
if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
|
if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
|
||||||
WARN("MISSING_EOF_NEWLINE",
|
if (WARN("MISSING_EOF_NEWLINE",
|
||||||
"adding a line without newline at end of file\n" . $herecurr);
|
"adding a line without newline at end of file\n" . $herecurr) &&
|
||||||
|
$fix) {
|
||||||
|
fix_delete_line($fixlinenr+1, "No newline at end of file");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# check we are in a valid source file C or perl if not then ignore this hunk
|
# check we are in a valid source file C or perl if not then ignore this hunk
|
||||||
|
|
Loading…
Reference in New Issue