From a0383440d518d0de8045a240747b226ad0f97c68 Mon Sep 17 00:00:00 2001 From: Per Andersson Date: Sun, 15 Feb 2026 15:40:25 +0100 Subject: [PATCH] schema diff REFACTOR pyang lint YANG module Refactor ietf-yang-schema-comparison YANG module according to the following command, usually executed during YANG Doctors review pyang --ietf --lint -f yang --yang-line-length=72 \ ietf-yang-schema-comparison@2026-02-11.yang --- ...etf-yang-schema-comparison@2026-02-11.yang | 305 +++++++++--------- 1 file changed, 157 insertions(+), 148 deletions(-) diff --git a/modules/ietf-yang-schema-comparison@2026-02-11.yang b/modules/ietf-yang-schema-comparison@2026-02-11.yang index cba22e4ab..198f49de4 100644 --- a/modules/ietf-yang-schema-comparison@2026-02-11.yang +++ b/modules/ietf-yang-schema-comparison@2026-02-11.yang @@ -21,7 +21,6 @@ module ietf-yang-schema-comparison { organization "IETF NETMOD (Network Modeling) Working Group"; - contact "WG List: NETCONF WG list WG Web: https://datatracker.ietf.org/wg/netmod @@ -34,15 +33,14 @@ module ietf-yang-schema-comparison { Author: Per Andersson "; - description "This YANG 1.1 module contains definitions and extensions to support comparison between different versions of YANG schemas. The - output of the comparison algorithm is described in this YANG module. - The base schema nodes describe changes in a compiled YANG module - with all of its included submodules and imported modules. The rest - of the schema nodes are optional and describe changes in all the - statements of a single YANG module. + output of the comparison algorithm is described in this YANG + module. The base schema nodes describe changes in a compiled YANG + module with all of its included submodules and imported modules. + The rest of the schema nodes are optional and describe changes in + all the statements of a single YANG module. Copyright (c) 2026 IETF Trust and the persons identified as authors of the code. All rights reserved. @@ -64,6 +62,7 @@ module ietf-yang-schema-comparison { are to be interpreted as described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, they appear in all capitals, as shown here."; + // RFC Ed.: update the date below with the date of RFC publication // and remove this note. // RFC Ed.: replace XXXX (inc above) with actual RFC number and @@ -111,9 +110,9 @@ module ietf-yang-schema-comparison { feature parsed-schema { description - "Compare also the statements removed from the compiled schema to get all - the backwards-compatible and non-backwards-compatible changes possible - for a YANG module."; + "Compare also the statements removed from the compiled schema to + get all the backwards-compatible and non-backwards-compatible + changes possible for a YANG module."; reference "RFC 7950: The YANG 1.1 Data Modeling Language, section 11; RFC 6020: YANG - A Data Modeling Language for the Network @@ -123,190 +122,192 @@ module ietf-yang-schema-comparison { typedef schema-node-path { type string; description - "Node schema path (node-id). A generic type is used to not enforce their - evaluation or validation in this context."; + "Node schema path (node-id). A generic type is used to not enforce + their evaluation or validation in this context."; } typedef schema-stmt-path { type string; description - "Path to a statement. Any non data node parents are encoded specially."; + "Path to a statement. Any non data node parents are encoded + specially."; } typedef stmt-type { type enumeration { - enum "base" { + enum base { description "YANG statement 'base'."; } - enum "bit" { + enum bit { description "YANG statement 'bit'."; } - enum "config" { + enum config { description "YANG statement 'config'."; } - enum "contact" { + enum contact { description "YANG statement 'contact'."; } - enum "default" { + enum default { description "YANG statement 'default'."; } - enum "description" { + enum description { description "YANG statement 'description'."; } - enum "deviate" { + enum deviate { description "YANG statement 'deviate'."; } - enum "deviation" { + enum deviation { description "YANG statement 'deviation'."; } - enum "enum" { + enum enum { description "YANG statement 'enum'."; } - enum "error-app-tag" { + enum error-app-tag { description "YANG statement 'error-app-tag'."; } - enum "error-message" { + enum error-message { description "YANG statement 'error-message'."; } - enum "extension" { + enum extension { description "YANG statement 'extension'."; } - enum "extension-instance" { + enum extension-instance { description "Any extension instance YANG statement."; } - enum "feature" { + enum feature { description "YANG statement 'feature'."; } - enum "fraction-digits" { + enum fraction-digits { description "YANG statement 'fraction-digits'."; } - enum "identity" { + enum identity { description "YANG statement 'identity'."; } - enum "if-feature" { + enum if-feature { description "YANG statement 'if-feature'."; } - enum "import" { + enum import { description "YANG statement 'import'."; } - enum "include" { + enum include { description "YANG statement 'include'."; } - enum "length" { + enum length { description "YANG statement 'length'."; } - enum "mandatory" { + enum mandatory { description "YANG statement 'mandatory'."; } - enum "max-elements" { + enum max-elements { description "YANG statement 'max-elements'."; } - enum "min-elements" { + enum min-elements { description "YANG statement 'min-elements'."; } - enum "must" { + enum must { description "YANG statement 'must'."; } - enum "node" { + enum node { description - "YANG statement 'container', 'leaf', 'leaf-list', 'list', 'anydata', - 'anyxml', 'rpc', 'action', or 'notification'. If the parsed schema - is also compared, it can additionally be 'choice', 'case', 'input', - 'output', 'uses', 'augment', or 'grouping'."; + "YANG statement 'container', 'leaf', 'leaf-list', 'list', + 'anydata', 'anyxml', 'rpc', 'action', or 'notification'. If + the parsed schema is also compared, it can additionally be + 'choice', 'case', 'input', 'output', 'uses', 'augment', or + 'grouping'."; } - enum "ordered-by" { + enum ordered-by { description "YANG statement 'ordered-by'."; } - enum "organization" { + enum organization { description "YANG statement 'organization'."; } - enum "path" { + enum path { description "YANG statement 'path'."; } - enum "pattern" { + enum pattern { description "YANG statement 'pattern'."; } - enum "prefix" { + enum prefix { description "YANG statement 'prefix'."; } - enum "presence" { + enum presence { description "YANG statement 'presence'."; } - enum "range" { + enum range { description "YANG statement 'range'."; } - enum "reference" { + enum reference { description "YANG statement 'reference'."; } - enum "refine" { + enum refine { description "YANG statement 'refine'."; } - enum "require-instance" { + enum require-instance { description "YANG statement 'require-instance'."; } - enum "revision-date" { + enum revision-date { description "YANG statement 'revision-date'."; } - enum "status" { + enum status { description "YANG statement 'status'."; } - enum "type" { + enum type { description "YANG statement 'type'."; } - enum "typedef" { + enum typedef { description "YANG statement 'typedef'."; } - enum "units" { + enum units { description "YANG statement 'units'."; } - enum "unique" { + enum unique { description "YANG statement 'unique'."; } - enum "when" { + enum when { description "YANG statement 'when'."; } - enum "yang-version" { + enum yang-version { description "YANG statement 'yang-version'."; } @@ -342,7 +343,8 @@ module ietf-yang-schema-comparison { type yang:yang-identifier; mandatory true; description - "Module with the extension definition of an extension instance."; + "Module with the extension definition of an extension + instance."; } leaf name { type yang:yang-identifier; @@ -376,15 +378,15 @@ module ietf-yang-schema-comparison { "Describes a status statement change."; leaf status { type enumeration { - enum "current" { + enum current { description "Current effective status of a statement."; } - enum "deprecated" { + enum deprecated { description "Deprecated effective status of a statement."; } - enum "obsolete" { + enum obsolete { description "Obsolete effective status of a statement."; } @@ -469,79 +471,79 @@ module ietf-yang-schema-comparison { "Describes a type statement change."; leaf base-type { type enumeration { - enum "int8" { + enum int8 { description "YANG built-in type 'int8'."; } - enum "int16" { + enum int16 { description "YANG built-in type 'int16'."; } - enum "int32" { + enum int32 { description "YANG built-in type 'int32'."; } - enum "int64" { + enum int64 { description "YANG built-in type 'int64'."; } - enum "uint8" { + enum uint8 { description "YANG built-in type 'uint8'."; } - enum "uint16" { + enum uint16 { description "YANG built-in type 'uint16'."; } - enum "uint32" { + enum uint32 { description "YANG built-in type 'uint32'."; } - enum "uint64" { + enum uint64 { description "YANG built-in type 'uint64'."; } - enum "decimal64" { + enum decimal64 { description "YANG built-in type 'decimal64'."; } - enum "string" { + enum string { description "YANG built-in type 'string'."; } - enum "boolean" { + enum boolean { description "YANG built-in type 'boolean'."; } - enum "enumeration" { + enum enumeration { description "YANG built-in type 'enumeration'."; } - enum "bits" { + enum bits { description "YANG built-in type 'bits'."; } - enum "binary" { + enum binary { description "YANG built-in type 'binary'."; } - enum "leafref" { + enum leafref { description "YANG built-in type 'leafref'."; } - enum "identityref" { + enum identityref { description "YANG built-in type 'identityref'."; } - enum "empty" { + enum empty { description "YANG built-in type 'empty'."; } - enum "union" { + enum union { description "YANG built-in type 'union'."; } - enum "instance-identifier" { + enum instance-identifier { description "YANG built-in type 'instance-identifier'."; } @@ -611,15 +613,15 @@ module ietf-yang-schema-comparison { key "name"; ordered-by user; description - "List of enum statements. Keeps the same order of the statements as in - the module."; + "List of enum statements. Keeps the same order of the statements + as in the module."; leaf name { type yang:yang-identifier; description "Enum statement name."; } uses if-feature-stmts { - if-feature parsed-schema; + if-feature "parsed-schema"; } leaf description { type string; @@ -643,15 +645,15 @@ module ietf-yang-schema-comparison { key "name"; ordered-by user; description - "List of bit statements. Keeps the same order of the statements as in - the module."; + "List of bit statements. Keeps the same order of the statements + as in the module."; leaf name { type yang:yang-identifier; description "Bit statement name."; } uses if-feature-stmts { - if-feature parsed-schema; + if-feature "parsed-schema"; } leaf description { type string; @@ -741,8 +743,8 @@ module ietf-yang-schema-comparison { key "name"; ordered-by user; description - "List of enum statements. Keeps the same order of the statements as in - the module."; + "List of enum statements. Keeps the same order of the statements + as in the module."; leaf name { type yang:yang-identifier; description @@ -771,8 +773,8 @@ module ietf-yang-schema-comparison { key "name"; ordered-by user; description - "List of bit statements. Keeps the same order of the statements as in - the module."; + "List of bit statements. Keeps the same order of the statements + as in the module."; leaf name { type yang:yang-identifier; description @@ -817,8 +819,8 @@ module ietf-yang-schema-comparison { grouping refine-deviate-node-substmts { description - "All substatements of a data-definition node that can be changed by both - a refine and deviate statement."; + "All substatements of a data-definition node that can be changed + by both a refine and deviate statement."; uses must-stmts; leaf-list default { type string; @@ -851,7 +853,7 @@ module ietf-yang-schema-comparison { description "All substatements of a data-definition node."; uses if-feature-stmts { - if-feature parsed-schema; + if-feature "parsed-schema"; } uses when-stmts; leaf description { @@ -873,11 +875,11 @@ module ietf-yang-schema-comparison { } leaf ordered-by { type enumeration { - enum "system" { + enum system { description "System-ordered list or leaf-list of items."; } - enum "user" { + enum user { description "User-ordered list or leaf-list of items."; } @@ -926,15 +928,14 @@ module ietf-yang-schema-comparison { "YANG version substatement value."; } leaf prefix { - if-feature parsed-schema; + if-feature "parsed-schema"; type string; description "Prefix substatement value."; } container import { - if-feature parsed-schema; - presence - "Exists only when there is a difference in this import."; + if-feature "parsed-schema"; + presence "Exists only when there is a difference in this import."; description "Import substatements."; leaf module { @@ -967,7 +968,7 @@ module ietf-yang-schema-comparison { uses ext-instance-stmts; } container include { - if-feature parsed-schema; + if-feature "parsed-schema"; presence "Exists only when there is a difference in this include."; description @@ -1016,7 +1017,7 @@ module ietf-yang-schema-comparison { "Reference substatement value."; } container extension { - if-feature parsed-schema; + if-feature "parsed-schema"; presence "Exists only when there is a difference in this extension."; description @@ -1046,7 +1047,7 @@ module ietf-yang-schema-comparison { uses ext-instance-stmts; } container feature { - if-feature parsed-schema; + if-feature "parsed-schema"; presence "Exists only when there is a difference in this feature."; description @@ -1081,10 +1082,10 @@ module ietf-yang-schema-comparison { "Identity statement name."; } uses if-feature-stmts { - if-feature parsed-schema; + if-feature "parsed-schema"; } leaf-list base { - if-feature parsed-schema; + if-feature "parsed-schema"; type yang:yang-identifier; description "List of bases of an identity."; @@ -1092,7 +1093,7 @@ module ietf-yang-schema-comparison { uses ext-instance-stmts; } container deviation { - if-feature parsed-schema; + if-feature "parsed-schema"; presence "Exists only when there is a difference in this deviation."; description @@ -1170,7 +1171,8 @@ module ietf-yang-schema-comparison { } container ext-instance { presence - "Exists only when there is a difference in this extension-instance."; + "Exists only when there is a difference in this + extension-instance."; description "Extension-instance substatements."; uses ext-instance-stmt; @@ -1179,10 +1181,10 @@ module ietf-yang-schema-comparison { grouping parsed-substmts { description - "All parsed-only statements that can be direct substatements of a module - or nested in a node."; + "All parsed-only statements that can be direct substatements of a + module or nested in a node."; uses if-feature-stmts { - if-feature parsed-schema; + if-feature "parsed-schema"; } uses when-stmts; leaf description { @@ -1225,18 +1227,19 @@ module ietf-yang-schema-comparison { "Conformance type of a change."; leaf conformance { type enumeration { - enum "backwards-compatible" { + enum backwards-compatible { description "Backwards-compatible or editorial change."; } - enum "non-backwards-compatible" { + enum non-backwards-compatible { description "Non-backwards-compatible change."; } } mandatory true; description - "Conformance information of a change in the compared YANG modules."; + "Conformance information of a change in the compared YANG + modules."; } } @@ -1260,21 +1263,22 @@ module ietf-yang-schema-comparison { } leaf change { type enumeration { - enum "modified" { + enum modified { description "Statement existed and was modified."; } - enum "added" { + enum added { description "Statement was added."; } - enum "removed" { + enum removed { description "Statement was removed."; } - enum "moved" { + enum moved { description - "Statement was moved and the position affects the meaning."; + "Statement was moved and the position affects the + meaning."; } } mandatory true; @@ -1333,8 +1337,8 @@ module ietf-yang-schema-comparison { leaf parent-path { type schema-stmt-path; description - "Path to the parent statement. Not set if a direct substatement of - module or submodule."; + "Path to the parent statement. Not set if a direct + substatement of module or submodule."; } leaf identifier { type string; @@ -1344,39 +1348,39 @@ module ietf-yang-schema-comparison { } leaf stmt-type { type enumeration { - enum "choice" { + enum choice { description "YANG statement 'choice' node."; } - enum "case" { + enum case { description "YANG statement 'case' node."; } - enum "input" { + enum input { description "YANG statement 'input' node."; } - enum "output" { + enum output { description "YANG statement 'output' node."; } - enum "uses" { + enum uses { description "YANG statement 'uses' node."; } - enum "grouping" { + enum grouping { description "YANG statement 'grouping' node."; } - enum "augment" { + enum augment { description "YANG statement 'augment' node."; } - enum "refine" { + enum refine { description "YANG statement 'refine' node."; } - enum "typedef" { + enum typedef { description "YANG statement 'typedef'."; } @@ -1388,12 +1392,14 @@ module ietf-yang-schema-comparison { uses change-info; container old { description - "Changed parsed statements in the older revision of the YANG module."; + "Changed parsed statements in the older revision of the YANG + module."; uses parsed-substmts; } container new { description - "Changed parsed statements in the newer revision of the YANG module."; + "Changed parsed statements in the newer revision of the YANG + module."; uses parsed-substmts; } } @@ -1407,8 +1413,8 @@ module ietf-yang-schema-comparison { ordered-by user; description "Information about data-definition (node) statement substatement - changes. Keeps the traversed order of the nodes by the algorithm. - It SHOULD follow the depth-first search order."; + changes. Keeps the traversed order of the nodes by the + algorithm. It SHOULD follow the depth-first search order."; leaf node { type schema-node-path; description @@ -1416,39 +1422,39 @@ module ietf-yang-schema-comparison { } leaf node-type { type enumeration { - enum "container" { + enum container { description "YANG statement 'container' node."; } - enum "leaf" { + enum leaf { description "YANG statement 'leaf' node."; } - enum "leaf-list" { + enum leaf-list { description "YANG statement 'leaf-list' node."; } - enum "list" { + enum list { description "YANG statement 'list' node."; } - enum "anydata" { + enum anydata { description "YANG statement 'anydata' node."; } - enum "anyxml" { + enum anyxml { description "YANG statement 'anyxml' node."; } - enum "rpc" { + enum rpc { description "YANG statement 'rpc' node."; } - enum "action" { + enum action { description "YANG statement 'action' node."; } - enum "notification" { + enum notification { description "YANG statement 'notification' node."; } @@ -1505,21 +1511,24 @@ module ietf-yang-schema-comparison { uses conformance-type; list module-comparison { description - "Information about direct module statement substatement changes."; + "Information about direct module statement substatement + changes."; uses change-info; container old { description - "Changed statements in the older revision of the YANG module."; + "Changed statements in the older revision of the YANG + module."; uses module-substmts; } container new { description - "Changed statements in the newer revision of the YANG module."; + "Changed statements in the newer revision of the YANG + module."; uses module-substmts; } } uses parsed-info { - if-feature parsed-schema; + if-feature "parsed-schema"; } uses node-info; }