Glavin001 / atom-beautify

:mega: Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | :lipstick: Universal beautification package for Atom editor (:warning: Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding :heart: )
http://unibeautify.com/
MIT License
1.49k stars 454 forks source link

Language Request: R via Rfmt #1139

Open jzelner opened 8 years ago

jzelner commented 8 years ago

Description

Would it be possible to add a beautifier for R using the very excellent Rfmt (https://github.com/google/rfmt). I have tried to do this on my own using the attached language definition and beautifier can't get it to find the beautifier I made for R, even after a reload and restart of atom, essentially by copying the gofmt language definition.

One suggestion is that this should probably be run using a one-liner R invocation rather than the rfmt command-line argument, as the rfmt shell installation doesn't make the file accesible via /bin/sh.

Thanks!

-Jon Zelner

r.coffee: `module.exports = {

name: "R" description: "R" namespace: "r"

Supported Grammars

grammars: [ "R" ]

Supported extensions

extensions: [ "R" ]

options: []

} rfmt.coffee: "use strict" Beautifier = require('./beautifier')

module.exports = class Rfmt extends Beautifier name: "rfmt"

options: { R: true }

beautify: (text, language, options) -> @run("rfmt", [ @tempFile("input", text) ]) `

Glavin001 commented 7 years ago

I'd be happy to review and merge your Pull Request implementing this! One thing to change is:

options: {
R: true
}

should be

options: {
R: false
}