From 0263adc7811d0e2de4d09a87f76e7e9abd725577 Mon Sep 17 00:00:00 2001 From: LaurentTreguier Date: Wed, 6 Jan 2016 19:13:59 +0100 Subject: [PATCH 1/8] Create dfmt.coffee --- src/beautifiers/dfmt.coffee | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/beautifiers/dfmt.coffee diff --git a/src/beautifiers/dfmt.coffee b/src/beautifiers/dfmt.coffee new file mode 100644 index 0000000..e47ce6d --- /dev/null +++ b/src/beautifiers/dfmt.coffee @@ -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 --indent_size 8", [ + @tempFile("input", text) + ]) From 3537f34173d9968e2a1090d3db7e0079f532db44 Mon Sep 17 00:00:00 2001 From: LaurentTreguier Date: Wed, 6 Jan 2016 19:14:54 +0100 Subject: [PATCH 2/8] Add dfmt --- src/beautifiers/index.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/beautifiers/index.coffee b/src/beautifiers/index.coffee index 6569f74..c086e93 100644 --- a/src/beautifiers/index.coffee +++ b/src/beautifiers/index.coffee @@ -38,6 +38,7 @@ module.exports = class Beautifiers extends EventEmitter 'coffee-formatter' 'coffee-fmt' 'clang-format' + 'dfmt' 'elm-format' 'htmlbeautifier' 'csscomb' From 2bea5a6908e444e77fecf9eedaf600b213bece91 Mon Sep 17 00:00:00 2001 From: LaurentTreguier Date: Wed, 6 Jan 2016 19:15:26 +0100 Subject: [PATCH 3/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index edbcabb..a2e74b1 100644 --- a/README.md +++ b/README.md @@ -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) From b7f32bba9a3803aa78c6cf4f844028ce4fed3653 Mon Sep 17 00:00:00 2001 From: LaurentTreguier Date: Thu, 7 Jan 2016 13:20:52 +0100 Subject: [PATCH 4/8] Create test.d --- examples/nested-jsbeautifyrc/d/original/test.d | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 examples/nested-jsbeautifyrc/d/original/test.d diff --git a/examples/nested-jsbeautifyrc/d/original/test.d b/examples/nested-jsbeautifyrc/d/original/test.d new file mode 100644 index 0000000..40d559b --- /dev/null +++ b/examples/nested-jsbeautifyrc/d/original/test.d @@ -0,0 +1,5 @@ +class Test{ +private int member ; + public auto func ( string str ) + { + import std.stdio; writeln("Hello world !");}} From ec81974d2dda86545969720d4d00b54d4e7c72b3 Mon Sep 17 00:00:00 2001 From: LaurentTreguier Date: Thu, 7 Jan 2016 13:21:25 +0100 Subject: [PATCH 5/8] Create test.d --- examples/nested-jsbeautifyrc/d/expected/test.d | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 examples/nested-jsbeautifyrc/d/expected/test.d diff --git a/examples/nested-jsbeautifyrc/d/expected/test.d b/examples/nested-jsbeautifyrc/d/expected/test.d new file mode 100644 index 0000000..57e453f --- /dev/null +++ b/examples/nested-jsbeautifyrc/d/expected/test.d @@ -0,0 +1,10 @@ +class Test +{ + private int member; + public auto func(string str) + { + import std.stdio; + + writeln("Hello world !"); + } +} From e4f97f70b9fd4d253bba7855f22304c70e4c8898 Mon Sep 17 00:00:00 2001 From: LaurentTreguier Date: Thu, 7 Jan 2016 13:22:24 +0100 Subject: [PATCH 6/8] Update beautify-languages-spec.coffee --- spec/beautify-languages-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/beautify-languages-spec.coffee b/spec/beautify-languages-spec.coffee index 3033837..433f834 100644 --- a/spec/beautify-languages-spec.coffee +++ b/spec/beautify-languages-spec.coffee @@ -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", From 4b8bc95252e5eaf3f5ac7ab0396b0790b92ab6b3 Mon Sep 17 00:00:00 2001 From: LaurentTreguier Date: Thu, 7 Jan 2016 13:23:16 +0100 Subject: [PATCH 7/8] Update d.coffee --- src/languages/d.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/languages/d.coffee b/src/languages/d.coffee index 85ffa77..0e89e3d 100644 --- a/src/languages/d.coffee +++ b/src/languages/d.coffee @@ -16,6 +16,8 @@ module.exports = { extensions: [ ] + defaultBeautifier: "dfmt" + options: configPath: type: 'string' From 18f28afbb9f54cb73170dd46d633e98206bd2d15 Mon Sep 17 00:00:00 2001 From: LaurentTreguier Date: Mon, 11 Jan 2016 13:18:20 +0100 Subject: [PATCH 8/8] That was not supposed to be here --- src/beautifiers/dfmt.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/beautifiers/dfmt.coffee b/src/beautifiers/dfmt.coffee index e47ce6d..8571ceb 100644 --- a/src/beautifiers/dfmt.coffee +++ b/src/beautifiers/dfmt.coffee @@ -12,6 +12,6 @@ module.exports = class Dfmt extends Beautifier } beautify: (text, language, options) -> - @run("dfmt --indent_size 8", [ + @run("dfmt", [ @tempFile("input", text) ])