Re: [netmod] [Tools-discuss] reflow of YANG descriptions, and general YANG format annoyances

William Lupton <wlupton@broadband-forum.org> Mon, 09 November 2020 09:38 UTC

Return-Path: <wlupton@broadband-forum.org>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 159FD3A0DAB for <netmod@ietfa.amsl.com>; Mon, 9 Nov 2020 01:38:42 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=broadband-forum-org.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2d4u0wx9tRBr for <netmod@ietfa.amsl.com>; Mon, 9 Nov 2020 01:38:40 -0800 (PST)
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B61893A0DB4 for <netmod@ietf.org>; Mon, 9 Nov 2020 01:38:39 -0800 (PST)
Received: by mail-ed1-x52b.google.com with SMTP id o20so7997434eds.3 for <netmod@ietf.org>; Mon, 09 Nov 2020 01:38:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadband-forum-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9WoG6s0OpPVZ1niNFg30zcpj45hn2WLZl0fURt9+58U=; b=I+HnFvTcMu1dpwKil3C4Ruwpqmrt4r6FgYE4vPqkRqQv30M37HPrzc+W/Y2Hwwd6z9 8jT1992Ptlc3/+48nj4KJessLZLWRWKRAE49CIZ6PMsKEBoREEElIsibfN1pNf/k02er M4tDoiZxyLQFeQCjONZdcQV7LFaOcI+n2O2wiPSAFweOfjc+P25qbqr4jB20iLMgxj7+ 3lQmvqZPPfYSoQpVCEGkU2CRSpIlid05bzZhmcmKYe7tkucuWd52jc+7ki1P7PMEgUFX oGXR0NISI8nbsWKUNRJ6ONvcJjY9HUvUvsH9cQaGezrbsEUmRqYwIzAFda4omTnipOuh IChg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9WoG6s0OpPVZ1niNFg30zcpj45hn2WLZl0fURt9+58U=; b=iv1F8qakbartO7DmewnzuzBZxnoawcY3jE2/+Mzrc5F8o279l208Si9/2KhV+4CXPV tYRWmwOB22YhFtI34fT/SN+uFWqBOIdvvi0vUQWRPsCvrMIoHKm0Re7FdXvBiuzap1+6 m4/ZnEGN9+k7kf4eM89VZE4F2LSvRfRrTOgFskNcUN/2dbd5QcXbUyTN+xpQWxIBRJU5 A04Eew2DKW2YggnPKheFBHPUNwfVfGjLmX8ZdAYfr6lL00Ii8QKZ1PMBoqCFaQrQP6pN rx7TwX1qd4CUht1MOt8zMlJBuBBB6w34u3dNVKB7yFIB4hQqAsaR6Rk33VEcwRbktzdE hArw==
X-Gm-Message-State: AOAM532tgP1IMnB+Y0dLpsNbZDKZa3v1OOgaQvO5x5vIz9igO3LbXlFN R1SDWjqZyhQSgo1g6m4P70h0e6RVytZDMaRAgmNGm653WKnlKaOt
X-Google-Smtp-Source: ABdhPJywqj9vqFmkByuLrkH5lDRcBJAMXr8dsAyaSXcg9XmIdx9hfWnFcdcyFCYDVE+06q4WKk30WmZ6oNBUQXnZdyQ=
X-Received: by 2002:a05:6402:b68:: with SMTP id cb8mr14386716edb.198.1604914717829; Mon, 09 Nov 2020 01:38:37 -0800 (PST)
MIME-Version: 1.0
References: <29950.1604697852@localhost> <008B882D-102D-4AEA-AF59-E259F07089CB@tzi.org> <6712.1604707568@localhost> <4BC302A5-D990-45EE-85C2-196BBC1D09DF@tzi.org>
In-Reply-To: <4BC302A5-D990-45EE-85C2-196BBC1D09DF@tzi.org>
From: William Lupton <wlupton@broadband-forum.org>
Date: Mon, 09 Nov 2020 09:38:26 +0000
Message-ID: <CAEe_xxhNEPuMhg0i14J=0+hW-3+NgknEDG99qyMRdR59q8OM_Q@mail.gmail.com>
To: NetMod WG <netmod@ietf.org>
Cc: tools-discuss@ietf.org
Content-Type: multipart/alternative; boundary="000000000000a6c5ca05b3a953fe"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/r2LnE9PdMMYFCuPVpO65_ZxYTHs>
Subject: Re: [netmod] [Tools-discuss] reflow of YANG descriptions, and general YANG format annoyances
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Nov 2020 09:38:42 -0000

I ensured that I have the latest version of the Emacs YANG mode, and find
that M-q works well to wrap description strings, but...

   1. Should I expect intelligent behaviour of RET and TAB when within a
   description (or other) string? I find that (in this context) RET positions
   the cursor at the start of the line, and TAB does nothing. Ideally RET
   might position the cursor at the indentation point of the previous line, or
   one character past the opening quote if this was the first line.
   2. Wrapping (quite reasonably) can't handle cases where the author
   didn't in fact intend line breaks to be inserted. The most common cases are
   probably (a) not using a blank line as a paragraph break, (b) text was
   further indented (which often implies literal text), or (c) text started
   with * (or -, ...) and was to be interpreted as a list item.

I don't believe that RFCs 7950 and 8407 say anything about paragraph
formatting, but most NETMOD YANG does seem to adhere to the convention that
paragraphs should be separated by blank lines. Perhaps this could be made
into a stronger convention?

As for the other cases (further indentation -> literal, and */- mean list
items), of course this is getting back to the markdown discussion. I
believe that when this has come up before the discussion has died for want
of clear standards. However I do believe that it would be very useful to
define some layout conventions (or rules) that allow automated reflow and
other formatting, and personally I would take it further than just the
three points that I have mentioned! It doesn't have to be called
'markdown'...

William

On Sat, 7 Nov 2020 at 05:07, Carsten Bormann <cabo@tzi.org> wrote:

> On 2020-11-07, at 01:06, Michael Richardson <mcr+ietf@sandelman.ca> wrote:
> >
> > M-q reflowed a paragraph, but made it too long with 76 columns wide.
>
> Is your .emacs setting fill-column to a non-standard value?
>
> C-x f 69 RET
>
> or put
>
> // -*- fill-column: 69 -*-
>
> into the first line of your YANG file (in a comment)
> or better
>
> (add-hook 'yang-mode-hook
>           '(lambda () (set-fill-column 69)))
>
> in your .emacs.
>
> Grüße, Carsten
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>