[2/2] examples: add missing newline at eof

Message ID 20220225174703.100447-2-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [1/2] remove extra blank line at eof |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Stephen Hemminger Feb. 25, 2022, 5:47 p.m. UTC
  The text file did not end with newline.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/flow_classify/ipv4_rules_file.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Feb. 27, 2022, 8:27 p.m. UTC | #1
25/02/2022 18:47, Stephen Hemminger:
> The text file did not end with newline.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Series applied, thanks for the cleanup.

Could we add a check in checkpatch to avoid it in future?
  
Stephen Hemminger Feb. 27, 2022, 9:32 p.m. UTC | #2
On Sun, 27 Feb 2022 21:27:40 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:

> 25/02/2022 18:47, Stephen Hemminger:
> > The text file did not end with newline.
> > 
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>  
> 
> 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...
  
Thomas Monjalon Feb. 27, 2022, 10:35 p.m. UTC | #3
27/02/2022 22:32, Stephen Hemminger:
> On Sun, 27 Feb 2022 21:27:40 +0100
> Thomas Monjalon <thomas@monjalon.net> wrote:
> 
> > 25/02/2022 18:47, Stephen Hemminger:
> > > The text file did not end with newline.
> > > 
> > > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>  
> > 
> > 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'
  

Patch

diff --git a/examples/flow_classify/ipv4_rules_file.txt b/examples/flow_classify/ipv4_rules_file.txt
index dfa0631fcc09..cd5215736aaf 100644
--- a/examples/flow_classify/ipv4_rules_file.txt
+++ b/examples/flow_classify/ipv4_rules_file.txt
@@ -11,4 +11,4 @@ 
 6.7.8.9/16 192.168.0.36/16 10 : 0xffff 11 : 0xffff 6/0xfe 7
 6.7.8.9/8 192.168.0.36/8 10 : 0xffff 11 : 0xffff 6/0xfe 8
 #error rules
-#9.8.7.6/8 192.168.0.36/8 10 : 0xffff 11 : 0xffff 6/0xfe 9
\ No newline at end of file
+#9.8.7.6/8 192.168.0.36/8 10 : 0xffff 11 : 0xffff 6/0xfe 9