Merge pull request #733 from LaurentTreguier/master

Adding dfmt support for D
This commit is contained in:
Glavin Wiechert 2016-02-20 15:24:54 -04:00
commit 2b6b026cc6
7 changed files with 37 additions and 2 deletions

View File

@ -60,7 +60,7 @@ Or Settings/Preferences ➔ Packages ➔ Search for `atom-beautify`
- [x] [Objective-C](https://github.com/Glavin001/atom-beautify/issues/57)
- Requires [Uncrustify](http://sourceforge.net/projects/uncrustify/)
- [x] [D](https://github.com/Glavin001/atom-beautify/issues/57)
- Requires [Uncrustify](http://sourceforge.net/projects/uncrustify/)
- Requires [Uncrustify](http://sourceforge.net/projects/uncrustify/) or [dfmt](https://github.com/Hackerpilot/dfmt)
- [x] [Fortran](https://github.com/Glavin001/atom-beautify/issues/300)
- Requires [GNU Emacs](http://www.gnu.org/software/emacs/)
- [x] [Pawn](https://github.com/Glavin001/atom-beautify/issues/57)

View File

@ -0,0 +1,10 @@
class Test
{
private int member;
public auto func(string str)
{
import std.stdio;
writeln("Hello world !");
}
}

View File

@ -0,0 +1,5 @@
class Test{
private int member ;
public auto func ( string str )
{
import std.stdio; writeln("Hello world !");}}

View File

@ -21,7 +21,7 @@ describe "BeautifyLanguages", ->
# Activate all of the languages
allLanguages = [
"c", "coffee-script", "css", "html",
"c", "coffee-script", "css", "d", "html",
"java", "javascript", "json", "less",
"mustache", "objective-c", "perl", "php",
"python", "ruby", "sass", "sql", "svg",

View File

@ -0,0 +1,17 @@
###
Requires [dfmt](https://github.com/Hackerpilot/dfmt)
###
"use strict"
Beautifier = require('./beautifier')
module.exports = class Dfmt extends Beautifier
name: "dfmt"
options: {
D: true
}
beautify: (text, language, options) ->
@run("dfmt", [
@tempFile("input", text)
])

View File

@ -38,6 +38,7 @@ module.exports = class Beautifiers extends EventEmitter
'coffee-formatter'
'coffee-fmt'
'clang-format'
'dfmt'
'elm-format'
'htmlbeautifier'
'csscomb'

View File

@ -16,6 +16,8 @@ module.exports = {
extensions: [
]
defaultBeautifier: "dfmt"
options:
configPath:
type: 'string'