spacemacs/layers/+lang/yang
Arif Er 00f9ab19ac chore: update copyright headers to 2022
The script used to identify and update the change is added into the GitHub
workflows script directory. A workflow action can be created to trigger the
script to update the headers on the first of every new year. Possibly a task for
a consequent PR.
2022-06-03 17:32:20 +02:00
..
README.org Switch to the new layers generator 2019-05-15 21:08:21 +03:00
config.el chore: update copyright headers to 2022 2022-06-03 17:32:20 +02:00
packages.el chore: update copyright headers to 2022 2022-06-03 17:32:20 +02:00

README.org

yang layer

Description

This layer provides support for the YANG file format.

Features:

  • Syntax highlighting
  • Syntax checking via flycheck

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add yang to the existing dotspacemacs-configuration-layers list in this file.

  (setq-default dotspacemacs-configuration-layers '(yang))

Syntax checking with flycheck

Flycheck is used to check the yang syntax utilizing pyang which needs to be installed on your system. Documentation for pyang can be found at the pyang repository, and can be installed using python packaging mechanisms

Configuration

By default the syntax checking is done according to pyang --lint which uses rules outlined in RFC 6020. To use a different set of rules set the yang-pyang-rules variable. The valid values at the time of writing were:

  • mef Validate the module(s) according to MEF rules.
  • ietf Validate the module(s) according to IETF rules.
  • bbf Validate the module(s) according to BBF rules.
  • ieee Validate the module(s) according to IEEE rules.
  • lint Validate the module(s) according to RFC 6087 rules.
  (setq-default dotspacemacs-configuration-layers
                '((yang :variables yang-pyang-rules "ietf")))

To allow further customization one can set the yang-pyang-extra-args variable to a string that will be passed directly to the pyang command.

  (setq-default dotspacemacs-configuration-layers
                '((yang :variables yang-pyang-extra-args "--max-line-length=69")))