Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/indent indent: clean up lint annotation and tests



details:   https://anonhg.NetBSD.org/src/rev/9e381fde95db
branches:  trunk
changeset: 1026361:9e381fde95db
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 20 09:59:53 2021 +0000

description:
indent: clean up lint annotation and tests

diffstat:

 tests/usr.bin/indent/fmt_decl.c    |   6 +++---
 tests/usr.bin/indent/opt_P.c       |   4 ++--
 tests/usr.bin/indent/opt_badp.c    |  16 ++++++++--------
 tests/usr.bin/indent/opt_bl_br.c   |   9 +++++----
 tests/usr.bin/indent/t_misc.sh     |   4 ++--
 tests/usr.bin/indent/token_ident.c |   4 ++--
 usr.bin/indent/lexi.c              |   5 ++---
 7 files changed, 24 insertions(+), 24 deletions(-)

diffs (206 lines):

diff -r a69f04e95894 -r 9e381fde95db tests/usr.bin/indent/fmt_decl.c
--- a/tests/usr.bin/indent/fmt_decl.c   Sat Nov 20 09:43:03 2021 +0000
+++ b/tests/usr.bin/indent/fmt_decl.c   Sat Nov 20 09:59:53 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fmt_decl.c,v 1.19 2021/11/19 22:24:29 rillig Exp $     */
+/*     $NetBSD: fmt_decl.c,v 1.20 2021/11/20 09:59:53 rillig Exp $     */
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /*
@@ -470,11 +470,11 @@
 
 
 /*
- * Between 2019-04-04 and before lexi.c 1.146 from 2021-11-09, the indentation
+ * Between 2019-04-04 and before lexi.c 1.146 from 2021-11-19, the indentation
  * of the '*' depended on the function name, which did not make sense.  For
  * function names that matched [A-Za-z]+, the '*' was placed correctly, for
  * all other function names (containing [$0-9_]) the '*' was right-aligned on
- * declaration indentation, which defaults to 16.
+ * the declaration indentation, which defaults to 16.
  */
 #indent input
 int *
diff -r a69f04e95894 -r 9e381fde95db tests/usr.bin/indent/opt_P.c
--- a/tests/usr.bin/indent/opt_P.c      Sat Nov 20 09:43:03 2021 +0000
+++ b/tests/usr.bin/indent/opt_P.c      Sat Nov 20 09:59:53 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_P.c,v 1.2 2021/11/19 22:24:29 rillig Exp $ */
+/* $NetBSD: opt_P.c,v 1.3 2021/11/20 09:59:53 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -9,7 +9,7 @@
  * arbitrary files, therefore this test is rather restricted.
  *
  * See also:
- *     t_misc                  for test with custom setup
+ *     t_misc                  for tests with individual setup
  */
 
 #indent input
diff -r a69f04e95894 -r 9e381fde95db tests/usr.bin/indent/opt_badp.c
--- a/tests/usr.bin/indent/opt_badp.c   Sat Nov 20 09:43:03 2021 +0000
+++ b/tests/usr.bin/indent/opt_badp.c   Sat Nov 20 09:59:53 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_badp.c,v 1.5 2021/11/19 22:24:29 rillig Exp $ */
+/* $NetBSD: opt_badp.c,v 1.6 2021/11/20 09:59:53 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -10,7 +10,7 @@
 
 #indent input
 void
-empty_body(void)
+empty(void)
 {
 }
 #indent end
@@ -21,7 +21,7 @@
 
 #indent input
 void
-empty_line(void)
+blank(void)
 {
 
 }
@@ -33,7 +33,7 @@
 
 #indent input
 void
-only_declaration(void)
+declaration(void)
 {
        int             decl;
 }
@@ -45,7 +45,7 @@
 
 #indent input
 void
-only_statement(void)
+statement(void)
 {
        stmt();
 }
@@ -53,7 +53,7 @@
 
 #indent run -badp
 void
-only_statement(void)
+statement(void)
 {
 
        stmt();
@@ -64,7 +64,7 @@
 
 #indent input
 void
-declaration_and_statement(void)
+declaration_statement(void)
 {
        int             decl;
        stmt();
@@ -73,7 +73,7 @@
 
 #indent run -badp
 void
-declaration_and_statement(void)
+declaration_statement(void)
 {
        int             decl;
        /* $ FIXME: missing empty line */
diff -r a69f04e95894 -r 9e381fde95db tests/usr.bin/indent/opt_bl_br.c
--- a/tests/usr.bin/indent/opt_bl_br.c  Sat Nov 20 09:43:03 2021 +0000
+++ b/tests/usr.bin/indent/opt_bl_br.c  Sat Nov 20 09:59:53 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_bl_br.c,v 1.3 2021/11/19 22:24:29 rillig Exp $ */
+/* $NetBSD: opt_bl_br.c,v 1.4 2021/11/20 09:59:53 rillig Exp $ */
 /* $FreeBSD$ */
 
 #indent input
@@ -13,8 +13,8 @@
 #indent end
 
 /*
- * XXX: The '} else' looks strange in this style since the 'else' is
- * not at the left margin of the code.
+ * XXX: The '} else' looks strange in this style since the '}' is not on a
+ * line of its own.
  */
 #indent run -bl
 void
@@ -109,7 +109,8 @@
 
 
 /*
- *
+ * The combination of the options '-br' and '-ei' (both active by default)
+ * remove extra newlines between the tokens '}', 'else' and 'if'.
  */
 #indent input
 void
diff -r a69f04e95894 -r 9e381fde95db tests/usr.bin/indent/t_misc.sh
--- a/tests/usr.bin/indent/t_misc.sh    Sat Nov 20 09:43:03 2021 +0000
+++ b/tests/usr.bin/indent/t_misc.sh    Sat Nov 20 09:59:53 2021 +0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: t_misc.sh,v 1.16 2021/11/19 22:24:29 rillig Exp $
+# $NetBSD: t_misc.sh,v 1.17 2021/11/20 09:59:53 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -234,7 +234,7 @@
 /* For int options, trailing garbage would be an error. */
 -i3
 
-/*For float options, trailing garbage would be an error. */
+/* For float options, trailing garbage would be an error. */
 -cli3.5
 
 -b/*/acc       /* The comment is '/' '*' '/', making the option '-bacc'. */
diff -r a69f04e95894 -r 9e381fde95db tests/usr.bin/indent/token_ident.c
--- a/tests/usr.bin/indent/token_ident.c        Sat Nov 20 09:43:03 2021 +0000
+++ b/tests/usr.bin/indent/token_ident.c        Sat Nov 20 09:59:53 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: token_ident.c,v 1.3 2021/11/07 20:16:50 rillig Exp $ */
+/* $NetBSD: token_ident.c,v 1.4 2021/11/20 09:59:53 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -80,7 +80,7 @@
 
 
 /*
- * Text the tokenizer for number constants.
+ * Test the tokenizer for number constants.
  *
  * When the tokenizer reads a character that makes a token invalid (such as
  * '0x') but may later be extended to form a valid token (such as '0x123'),
diff -r a69f04e95894 -r 9e381fde95db usr.bin/indent/lexi.c
--- a/usr.bin/indent/lexi.c     Sat Nov 20 09:43:03 2021 +0000
+++ b/usr.bin/indent/lexi.c     Sat Nov 20 09:59:53 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lexi.c,v 1.149 2021/11/20 09:43:03 rillig Exp $        */
+/*     $NetBSD: lexi.c,v 1.150 2021/11/20 09:59:53 rillig Exp $        */
 
 /*-
  * SPDX-License-Identifier: BSD-4-Clause
@@ -43,7 +43,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__NetBSD__)
-__RCSID("$NetBSD: lexi.c,v 1.149 2021/11/20 09:43:03 rillig Exp $");
+__RCSID("$NetBSD: lexi.c,v 1.150 2021/11/20 09:59:53 rillig Exp $");
 #elif defined(__FreeBSD__)
 __FBSDID("$FreeBSD: head/usr.bin/indent/lexi.c 337862 2018-08-15 18:19:45Z pstef $");
 #endif
@@ -314,7 +314,6 @@
 }
 #endif
 
-/* ARGSUSED */
 static lexer_symbol
 lexi_end(lexer_symbol lsym)
 {



Home | Main Index | Thread Index | Old Index