diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | lua/conform/formatters/swiftlint.lua | 11 |
2 files changed, 12 insertions, 0 deletions
@@ -330,6 +330,7 @@ You can view this list in vim with `:help conform-formatters` - [stylua](https://github.com/JohnnyMorganz/StyLua) - An opinionated code formatter for Lua. - [swift_format](https://github.com/apple/swift-format) - Swift formatter from apple. Requires building from source with `swift build`. - [swiftformat](https://github.com/nicklockwood/SwiftFormat) - SwiftFormat is a code library and command-line tool for reformatting `swift` code on macOS or Linux. +- [swiftlint](https://github.com/realm/SwiftLint) - A tool to enforce Swift style and conventions. - [taplo](https://github.com/tamasfe/taplo) - A TOML toolkit written in Rust. - [templ](https://templ.guide/commands-and-tools/cli/#formatting-templ-files) - Formats templ template files. - [terraform_fmt](https://www.terraform.io/docs/cli/commands/fmt.html) - The terraform-fmt command rewrites `terraform` configuration files to a canonical format and style. diff --git a/lua/conform/formatters/swiftlint.lua b/lua/conform/formatters/swiftlint.lua new file mode 100644 index 0000000..1a6bd6f --- /dev/null +++ b/lua/conform/formatters/swiftlint.lua @@ -0,0 +1,11 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://github.com/realm/SwiftLint", + description = "A tool to enforce Swift style and conventions.", + }, + command = "swiftlint", + stdin = true, + args = { "lint", "--use-stdin", "--fix", "--format" }, + cwd = require("conform.util").root_file({ ".swiftlint.yml", "Package.swift" }), +} |