mirror of
https://github.com/vale981/apheleia
synced 2025-03-04 09:01:42 -05:00
add support for pyang (#282)
Hi, pyang (https://github.com/mbj4668/pyang) is a YANG validator, transformator and code generator, written in python. YANG (RFC 7950) is a data modeling language for NETCONF (RFC 6241), developed by the IETF NETMOD WG. This formatter provides support for Emacs yang-mode. --------- Co-authored-by: Radon Rosborough <radon@intuitiveexplanations.com>
This commit is contained in:
parent
96a9805ecb
commit
c07e90793c
5 changed files with 31 additions and 2 deletions
|
@ -33,7 +33,10 @@ The format is based on [Keep a Changelog].
|
|||
clojurescript, edn files. ([#271])
|
||||
* Stylua is used now in `lua-ts-mode` as well as just `lua-mode`, by
|
||||
default ([#275]).
|
||||
* [`treefmt`](https://numtide.github.io/treefmt) for project configured formatters ([#280]).
|
||||
* [`treefmt`](https://numtide.github.io/treefmt) for project
|
||||
configured formatters ([#280]).
|
||||
* [`pyang`](https://github.com/mbj4668/pyang) for
|
||||
[YANG](https://www.rfc-editor.org/rfc/rfc7950.html) ([#282]).
|
||||
|
||||
### Bugs fixed
|
||||
* Apheleia sometimes failed to determine indent level from Emacs
|
||||
|
@ -53,6 +56,7 @@ The format is based on [Keep a Changelog].
|
|||
[#274]: https://github.com/radian-software/apheleia/issues/274
|
||||
[#275]: https://github.com/radian-software/apheleia/pull/275
|
||||
[#279]: https://github.com/radian-software/apheleia/pull/279
|
||||
[#282]: https://github.com/radian-software/apheleia/pull/282
|
||||
|
||||
## 4.0 (released 2023-11-23)
|
||||
### Breaking changes
|
||||
|
|
|
@ -150,6 +150,7 @@
|
|||
"--parser=yaml"
|
||||
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
|
||||
(purs-tidy . ("apheleia-npx" "purs-tidy" "format"))
|
||||
(pyang . ("pyang" "--ignore-errors" "-f" "yang"))
|
||||
(robotidy . ("robotidy" "--no-color" "-"
|
||||
(apheleia-formatters-indent nil "--indent")
|
||||
(apheleia-formatters-fill-column "--line-length")))
|
||||
|
@ -370,7 +371,8 @@ rather than using this system."
|
|||
(typescript-ts-mode . prettier-typescript)
|
||||
(web-mode . prettier)
|
||||
(yaml-mode . prettier-yaml)
|
||||
(yaml-ts-mode . prettier-yaml))
|
||||
(yaml-ts-mode . prettier-yaml)
|
||||
(yang-mode . pyang))
|
||||
"Alist mapping major mode names to formatters to use in those modes.
|
||||
This determines what formatter to use in buffers without a
|
||||
setting for `apheleia-formatter'. The keys are major mode
|
||||
|
|
2
test/formatters/installers/pyang.bash
Normal file
2
test/formatters/installers/pyang.bash
Normal file
|
@ -0,0 +1,2 @@
|
|||
apt-get install -y python3-pip
|
||||
pip install pyang
|
10
test/formatters/samplecode/pyang/in.yang
Normal file
10
test/formatters/samplecode/pyang/in.yang
Normal file
|
@ -0,0 +1,10 @@
|
|||
module in { namespace "http://com/in/in";
|
||||
prefix
|
||||
in ;
|
||||
|
||||
list example { key "name";
|
||||
leaf name {
|
||||
type string;
|
||||
}
|
||||
}
|
||||
}
|
11
test/formatters/samplecode/pyang/out.yang
Normal file
11
test/formatters/samplecode/pyang/out.yang
Normal file
|
@ -0,0 +1,11 @@
|
|||
module in {
|
||||
namespace "http://com/in/in";
|
||||
prefix in;
|
||||
|
||||
list example {
|
||||
key "name";
|
||||
leaf name {
|
||||
type string;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue