27/02/2022 22:32, Stephen Hemminger:
> On Sun, 27 Feb 2022 21:27:40 +0100
> Thomas Monjalon <[email protected]> wrote:
>
> > 25/02/2022 18:47, Stephen Hemminger:
> > > The text file did not end with newline.
> > >
> > > Signed-off-by: Stephen Hemminger <[email protected]>
> >
> > Series applied, thanks for the cleanup.
> >
> > Could we add a check in checkpatch to avoid it in future?
>
> The only tool I saw to find these was
> pcregrep -LMr '\n\Z'
>
> But probably possible with a complex python one-liner...
It can be done with diff:
diff /dev/null $file | tail -1 | grep '^\\ No newline'