From cce1caf85ece468a89ff28db00e13b681e7248d6 Mon Sep 17 00:00:00 2001 From: Ruslan Kashapov Date: Mon, 19 Jun 2023 13:44:53 +0300 Subject: [PATCH] Make warnings for unkeyed lists disabled by default Making warnings for unkeyed list with config=true disabled by default. JIRA: YANGTOOLS-1423 Change-Id: I2b8e9a0abef8531d3b7853b029604a515e7196b8 Signed-off-by: Ruslan Kashapov --- .../yang/parser/api/YangParserConfiguration.java | 3 +-- .../opendaylight/yangtools/yang/validator/Main.java | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/parser/yang-parser-api/src/main/java/org/opendaylight/yangtools/yang/parser/api/YangParserConfiguration.java b/parser/yang-parser-api/src/main/java/org/opendaylight/yangtools/yang/parser/api/YangParserConfiguration.java index 248732f2fe..7484bb149d 100644 --- a/parser/yang-parser-api/src/main/java/org/opendaylight/yangtools/yang/parser/api/YangParserConfiguration.java +++ b/parser/yang-parser-api/src/main/java/org/opendaylight/yangtools/yang/parser/api/YangParserConfiguration.java @@ -99,8 +99,7 @@ public final class YangParserConfiguration implements Immutable { public static final class Builder implements Mutable { private ImportResolutionMode importResolutionMode = ImportResolutionMode.DEFAULT; private boolean retainDeclarationReferences; - // FIXME: YANGTOOLS-1423: default to false - private boolean warnForUnkeyedLists = true; + private boolean warnForUnkeyedLists = false; private Builder() { // Hidden on purpose diff --git a/tools/yang-model-validator/src/main/java/org/opendaylight/yangtools/yang/validator/Main.java b/tools/yang-model-validator/src/main/java/org/opendaylight/yangtools/yang/validator/Main.java index 26d5ffa306..b93a4436e2 100644 --- a/tools/yang-model-validator/src/main/java/org/opendaylight/yangtools/yang/validator/Main.java +++ b/tools/yang-model-validator/src/main/java/org/opendaylight/yangtools/yang/validator/Main.java @@ -43,7 +43,7 @@ public final class Main { private static final String YANG_MODEL = "yang-model"; private static final String PATH = "path"; private static final String RECURSIVE = "recursive"; - private static final String LIST_WARNING_OFF = "no-warning-for-unkeyed-lists"; + private static final String UNKEYED_LIST_WARNING_ON = "warning-for-unkeyed-lists"; private static final String OUTPUT = "output"; private static final String MODULE_NAME = "module-name"; private static final String FEATURES = "features"; @@ -86,7 +86,7 @@ public final class Main { final Set supportedFeatures = initSupportedFeatures(arguments); runSystemTest(yangLibDirs, yangFiles, supportedFeatures, arguments.getBoolean(RECURSIVE), - !arguments.getBoolean(LIST_WARNING_OFF)); + arguments.getBoolean(UNKEYED_LIST_WARNING_ON)); LOG_ROOT.getLoggerContext().reset(); } @@ -186,9 +186,9 @@ public final class Main { .help("recursive search of directories specified by -p option") .dest(RECURSIVE) .action(Arguments.storeTrue()); - parser.addArgument("-K", "--no-warning-for-unkeyed-lists") - .help("do not add warnings about unkeyed lists with config true") - .dest(LIST_WARNING_OFF) + parser.addArgument("-W", "--warning-for-unkeyed-lists") + .help("add warnings about unkeyed lists with config true") + .dest(UNKEYED_LIST_WARNING_ON) .action(Arguments.storeTrue()); parser.addArgument("-o", "--output") .help("path to output file for logs. Output file will be overwritten") -- 2.36.6