diff --git a/CHANGELOG.md b/CHANGELOG.md index 38e6463..58a159e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ The format is based on [Keep a Changelog]. [Ocaml](https://ocaml.org/) ([#306]). ### Formatters +* `vfmt` for + [vlang](https://vlang.io/) ([#324]). * [`typstyle`](https://github.com/Enter-tainer/typstyle) for [typst](https://typst.app/) ([#313]). * [`rubocop`](https://github.com/rubocop/rubocop) changed to use `-a` @@ -53,6 +55,7 @@ The format is based on [Keep a Changelog]. [#316]: https://github.com/radian-software/apheleia/pull/316 [#317]: https://github.com/radian-software/apheleia/issues/317 [#319]: https://github.com/radian-software/apheleia/pull/319 +[#324]: https://github.com/radian-software/apheleia/pull/324 [#325]: https://github.com/radian-software/apheleia/pull/325 [#326]: https://github.com/radian-software/apheleia/pull/326 [#327]: https://github.com/radian-software/apheleia/pull/327 diff --git a/apheleia-formatters.el b/apheleia-formatters.el index 34ee3fc..bef7aa0 100644 --- a/apheleia-formatters.el +++ b/apheleia-formatters.el @@ -200,6 +200,7 @@ (terraform . ("terraform" "fmt" "-")) (treefmt . ("treefmt" "--stdin" filepath)) (typstyle . ("typstyle")) + (vfmt . ("v" "fmt")) (xmllint . ("xmllint" "--format" "-")) (yapf . ("yapf")) (yq-csv . ("yq" "--prettyPrint" "--no-colors" @@ -375,6 +376,7 @@ rather than using this system." (typescript-ts-mode . prettier-typescript) (typst-mode . typstyle) (typst-ts-mode . typstyle) + (v-mode . vfmt) (web-mode . prettier) (yaml-mode . prettier-yaml) (yaml-ts-mode . prettier-yaml) diff --git a/test/formatters/installers/vfmt.bash b/test/formatters/installers/vfmt.bash new file mode 100644 index 0000000..b0c528d --- /dev/null +++ b/test/formatters/installers/vfmt.bash @@ -0,0 +1,15 @@ +ver="$(latest_release vlang/v)" + +apt-get install -y gcc libx11-dev + +wget -nv "https://github.com/vlang/v/releases/download/${ver}/v_linux.zip" -O v.zip +unzip -q v.zip + +sudo mkdir /opt/vlang +sudo cp -R v/. /opt/vlang/. +sudo /opt/vlang/v symlink + +sudo v build-tools + +# thx https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=vlang +sudo touch /opt/vlang/cmd/tools/.disable_autorecompilation diff --git a/test/formatters/samplecode/vfmt/in.v b/test/formatters/samplecode/vfmt/in.v new file mode 100644 index 0000000..5cb06c5 --- /dev/null +++ b/test/formatters/samplecode/vfmt/in.v @@ -0,0 +1,21 @@ +fn +main() { + areas:= ['game', + + 'web', 'tools', + + 'science', + + + 'systems', + 'embedded', 'drivers', 'GUI', 'mobile'] + for area in areas + { + + + + + + println('Hello, ${area} developers!') + } +} diff --git a/test/formatters/samplecode/vfmt/out.v b/test/formatters/samplecode/vfmt/out.v new file mode 100644 index 0000000..1cbc2c3 --- /dev/null +++ b/test/formatters/samplecode/vfmt/out.v @@ -0,0 +1,6 @@ +fn main() { + areas := ['game', 'web', 'tools', 'science', 'systems', 'embedded', 'drivers', 'GUI', 'mobile'] + for area in areas { + println('Hello, ${area} developers!') + } +}