diff mbox series

[GSOC,v2,3/3] userdiff: remove trailing whitespaces, fix multiline comments

Message ID 20240312131448.638472-3-sergiusnyah@gmail.com (mailing list archive)
State New, archived
Headers show
Series [GSOC,v2,1/3] t4018-diff-funcname: use test_grep instead of test_i18ngrep | expand

Commit Message

Sergius Nyah March 12, 2024, 1:14 p.m. UTC
This patch removes trailing whitespaces and fixes multiline comments in the `userdiff.c` file
to match Gits coding standards as seen in [1].

Signed-off-by: Sergius Nyah <sergiusnyah@gmail.com>
---
 userdiff.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

--
2.43.2

[1]:
https://github.com/git/git/blob/master/Documentation/CodingGuidelines
diff mbox series

Patch

diff --git a/userdiff.c b/userdiff.c
index bbe2bcb9a3..15342c8662 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -184,17 +184,18 @@  PATTERNS("java",
 	 "|[-+*/<>%&^|=!]="
 	 "|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|"),
 PATTERNS("javascript",
-      /* Looks for lines that start with optional whitespace, followed
-      * by 'function'* and any characters (for function declarations),
-      * or valid JavaScript identifiers, equals sign '=', 'function' keyword
-      * and any characters (for function expressions).
-      * Also considers functions defined inside blocks with '{...}'.
-      */
-      "^[ \t]*(function[ \t]*.*|[a-zA-Z_$][0-9a-zA-Z_$]*[ \t]*=[ \t]*function[ \t]*.*|(\\{[ \t]*)?)\n",
-      /* This pattern matches JavaScript identifiers */
-      "[a-zA-Z_$][0-9a-zA-Z_$]*"
-      "|[-+0-9.eE]+|0[xX][0-9a-fA-F]+"
-      "|[-+*/<>%&^|=!:]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\|"),
+	/*
+	 * Look for lines that start with optional whitespace, followed
+	 * by 'function' and any characters (for function declarations),
+	 * or valid JavaScript identifiers, equals sign '=', 'function' keyword
+	 * and any characters (for function expressions).
+	 * Also consider functions defined inside blocks with '{...}'.
+	 */
+	 "^[ \t]*(function[ \t]*.*|[a-zA-Z_$][0-9a-zA-Z_$]*[ \t]*=[ \t]*function[ \t]*.*|(\\{[ \t]*)?)\n",
+	 /* Match JavaScript identifiers with this pattern */
+	 "[a-zA-Z_$][0-9a-zA-Z_$]*"
+	 "|[-+0-9.eE]+|0[xX][0-9a-fA-F]+"
+	 "|[-+*/<>%&^|=!:]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\|"),
 PATTERNS("kotlin",
 	 "^[ \t]*(([a-z]+[ \t]+)*(fun|class|interface)[ \t]+.*)$",
 	 /* -- */