Skip to content

Commit

Permalink
feat: add styler formatter for R (#184)
Browse files Browse the repository at this point in the history
* feat: add styler formatter for R

* fix: do not run --vanilla to pick up options

* docs: add to README

* fix: std in false

* fix: do not hardcode style, use config file

* fix: lint styler formatter
  • Loading branch information
JohnCoene authored Nov 10, 2023
1 parent c3447c0 commit 6afc64e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ You can view this list in vim with `:help conform-formatters`
- [standardjs](https://standardjs.com) - JavaScript Standard style guide, linter, and formatter.
- [standardrb](https://github.com/standardrb/standard) - Ruby's bikeshed-proof linter and formatter.
- [stylelint](https://github.com/stylelint/stylelint) - A mighty CSS linter that helps you avoid errors and enforce conventions.
- [styler](https://github.com/devOpifex/r.nvim) - A formatter for the R programming language.
- [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.
Expand Down
11 changes: 11 additions & 0 deletions lua/conform/formatters/styler.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
local util = require("conform.util")
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://github.com/devOpifex/r.nvim",
description = "R formatter and linter.",
},
command = util.find_executable({ "usr/bin/" }, "R"),
args = { "-s", "-e", "r.nvim::format()", "--args", "$FILENAME" },
stdin = false,
}

0 comments on commit 6afc64e

Please sign in to comment.