Skip to contentSkip to conversation

uncrustify: have exactly one newline at the end of files

PATCH In review Frank Lichtenheld 3 participants 3 messages May 18, 2022 – May 22, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uncrustify: have exactly one newline at the end of files

Avoid the ugly "No newline at end of file" in git
diffs.

---
 dev-tools/uncrustify.conf  | 2 ++
 src/compat/compat-daemon.c | 1 -
 src/openvpn/ssl_ncp.c      | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
dev-tools/uncrustify.conf +2 -0
index 25eb4cdd..a04c6164 100644
@@ -45,6 +45,8 @@ nl_enum_leave_one_liners=true
 nl_brace_fparen=add
 nl_max=4
 nl_after_func_proto=2
+nl_end_of_file_min=1
+nl_end_of_file=force
 
 # Always use scoping braces for conditionals
 mod_full_brace_if=add
src/compat/compat-daemon.c +0 -1
index 197bc3f1..460b9e99 100644
@@ -102,4 +102,3 @@ daemon(int nochdir, int noclose)
 }
 
 #endif /* ifndef HAVE_DAEMON */
-
src/openvpn/ssl_ncp.c +1 -1
index 4a083e24..4bcbc69a 100644
@@ -494,4 +494,4 @@ p2p_mode_ncp(struct tls_multi *multi, struct tls_session *session)
         multi->use_peer_id, multi->peer_id, common_cipher);
 
     gc_free(&gc);
-}
\ No newline at end of file
+}
Signature · 1 line
2.30.2
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 4 lines · Frank Lichtenheld

Avoid the ugly "No newline at end of file" in git
diffs.

It does what we want.

Quoted 39 lines
---
  dev-tools/uncrustify.conf  | 2 ++
  src/compat/compat-daemon.c | 1 -
  src/openvpn/ssl_ncp.c      | 2 +-
  3 files changed, 3 insertions(+), 2 deletions(-)
dev-tools/uncrustify.conf +2 -0
index 25eb4cdd..a04c6164 100644
@@ -45,6 +45,8 @@ nl_enum_leave_one_liners=true
  nl_brace_fparen=add
  nl_max=4
  nl_after_func_proto=2
+nl_end_of_file_min=1
+nl_end_of_file=force
 
  # Always use scoping braces for conditionals
  mod_full_brace_if=add
src/compat/compat-daemon.c +0 -1
index 197bc3f1..460b9e99 100644
@@ -102,4 +102,3 @@ daemon(int nochdir, int noclose)
  }
 
  #endif /* ifndef HAVE_DAEMON */
-
src/openvpn/ssl_ncp.c +1 -1
index 4a083e24..4bcbc69a 100644
@@ -494,4 +494,4 @@ p2p_mode_ncp(struct tls_multi *multi, struct tls_session *session)
          multi->use_peer_id, multi->peer_id, common_cipher);
 
      gc_free(&gc);
-}
\ No newline at end of file
+}
Signature · 1 line
Antonio Quartulli
#2 lore raw
In reply to Frank Lichtenheld

Thanks for digging up a way to make uncrustify fix these. Annoying, and I did not always catch these...

Your patch has been applied to the master branch.

commit a76153c1ca98c841b8c8cf3b6ade6c00ee3876a5

Author: Frank Lichtenheld
Date:   Wed May 18 12:51:57 2022 +0200
     uncrustify: have exactly one newline at the end of files

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Antonio Quartulli <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg24386.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering