Skip to content

Commit

Permalink
Add vfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Nahoum authored and Raphael Nahoum committed Oct 8, 2024
1 parent d6f5207 commit b1c232b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 2 additions & 0 deletions apheleia-formatters.el
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
(terraform . ("terraform" "fmt" "-"))
(treefmt . ("treefmt" "--stdin" filepath))
(typstyle . ("typstyle"))
(vfmt . ("v" "fmt" "-" "-w"))
(xmllint . ("xmllint" "--format" "-"))
(yapf . ("yapf"))
(yq-csv . ("yq" "--prettyPrint" "--no-colors"
Expand Down Expand Up @@ -372,6 +373,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)
Expand Down
9 changes: 9 additions & 0 deletions test/formatters/installers/vfmt.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ver="$(latest_release vlang/v)"

apt-get install -y gcc
wget "https://github.com/vlang/v/releases/download/${ver}/v_linux.zip" -O v.zip
unzip v.zip
chmod a=u,go-w -R v
sudo mkdir /opt/vlang
sudo cp -R v/. /opt/vlang/.
sudo /opt/vlang/v symlink
21 changes: 21 additions & 0 deletions test/formatters/samplecode/vfmt/in.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
fn
main() {
areas:= ['game',

'web', 'tools',

'science',


'systems',
'embedded', 'drivers', 'GUI', 'mobile']
for area in areas
{





println('Hello, ${area} developers!')
}
}
6 changes: 6 additions & 0 deletions test/formatters/samplecode/vfmt/out.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fn main() {
areas := ['game', 'web', 'tools', 'science', 'systems', 'embedded', 'drivers', 'GUI', 'mobile']
for area in areas {
println('Hello, ${area} developers!')
}
}

0 comments on commit b1c232b

Please sign in to comment.