From 5dcb6260b1f4e8bd717ef34422c38cb7fd8320da Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Sun, 20 Oct 2024 18:08:38 +0530 Subject: [PATCH] feat(formatters): add nufmt config --- README.md | 1 + doc/conform.txt | 1 + lua/conform/formatters/nufmt.lua | 9 +++++++++ 3 files changed, 11 insertions(+) create mode 100644 lua/conform/formatters/nufmt.lua diff --git a/README.md b/README.md index b88f787..06e8ce7 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,7 @@ You can view this list in vim with `:help conform-formatters` - [mojo_format](https://docs.modular.com/mojo/cli/format) - Official Formatter for The Mojo Programming Language - [nickel](https://nickel-lang.org/) - Code formatter for the Nickel programming language. - [nimpretty](https://github.com/nim-lang/nim) - nimpretty is a Nim source code beautifier that follows the official style guide. +- [nufmt](https://github.com/nushell/nufmt) - The nushell formatter. - [nixfmt](https://github.com/NixOS/nixfmt) - The official (but not yet stable) formatter for Nix code. - [nixpkgs_fmt](https://github.com/nix-community/nixpkgs-fmt) - nixpkgs-fmt is a Nix code formatter for nixpkgs. - [npm-groovy-lint](https://github.com/nvuillam/npm-groovy-lint) - Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line. diff --git a/doc/conform.txt b/doc/conform.txt index 027418f..65f1ccd 100644 --- a/doc/conform.txt +++ b/doc/conform.txt @@ -397,6 +397,7 @@ FORMATTERS *conform-formatter `nickel` - Code formatter for the Nickel programming language. `nimpretty` - nimpretty is a Nim source code beautifier that follows the official style guide. +`nufmt` - The nushell formatter. `nixfmt` - The official (but not yet stable) formatter for Nix code. `nixpkgs_fmt` - nixpkgs-fmt is a Nix code formatter for nixpkgs. `npm-groovy-lint` - Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle diff --git a/lua/conform/formatters/nufmt.lua b/lua/conform/formatters/nufmt.lua new file mode 100644 index 0000000..24c045c --- /dev/null +++ b/lua/conform/formatters/nufmt.lua @@ -0,0 +1,9 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://github.com/nushell/nufmt", + description = "The nushell formatter", + }, + command = "nufmt", + args = {"$FILENAME"} +}