Merge branch 'master' of https://github.com/fdelbos/atom-beautify into fdelbos-master
This commit is contained in:
commit
6ea9788255
|
@ -70,3 +70,8 @@ before_install:
|
|||
# Elm
|
||||
- curl -L -o /tmp/elm-format.tgz https://github.com/avh4/elm-format/releases/download/0.2.0-alpha/elm-format-0.2.0-alpha-mac-x64.tgz
|
||||
- tar xvzf /tmp/elm-format.tgz -C /usr/local/bin
|
||||
# OCaml
|
||||
- brew install ocaml opam
|
||||
- opam init --auto-setup
|
||||
- opam install --yes ocp-indent
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
# dev
|
||||
- Add [ocp-indent](https://github.com/OCamlPro/ocp-indent) beautifier for the OCaml language.
|
||||
- Add [elm-format](https://github.com/avh4/elm-format) beautifier for the Elm language.
|
||||
- Add [clang-format](http://clang.llvm.org/docs/ClangFormat.html) beautifier for C/C++/Obj-C languages.
|
||||
- Add [yapf](http://github.com/google/yapf) beautifier for Python.
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
let f = function
|
||||
| _ -> 0
|
||||
;;
|
||||
|
||||
let f x = match x with
|
||||
| _ -> 0
|
||||
;;
|
||||
|
||||
let f =
|
||||
function
|
||||
| _ -> 0
|
||||
;;
|
||||
|
||||
let f x =
|
||||
match x with
|
||||
| _ -> 0
|
||||
;;
|
||||
|
||||
let f x =
|
||||
begin match x with
|
||||
| _ -> 0
|
||||
end
|
||||
;;
|
||||
|
||||
let check_price t = function
|
||||
| { Exec.
|
||||
trade_at_settlement = (None | Some false);
|
||||
} -> ()
|
||||
|
||||
let check_price t = function
|
||||
| simpler -> ()
|
||||
| other -> ()
|
||||
|
||||
(* Sometimes we like to write big alternations like this, in which case the
|
||||
comment should typically align with the following clause. *)
|
||||
let 0 =
|
||||
match x with
|
||||
| A
|
||||
(* a *)
|
||||
-> a
|
||||
let 0 =
|
||||
match x with
|
||||
A
|
||||
(* a *)
|
||||
-> a
|
||||
|
||||
let _ =
|
||||
a
|
||||
|| match a with
|
||||
| a -> true
|
||||
| b -> false
|
|
@ -0,0 +1,51 @@
|
|||
let f = function
|
||||
| _ -> 0
|
||||
;;
|
||||
|
||||
let f x = match x with
|
||||
| _ -> 0
|
||||
;;
|
||||
|
||||
let f =
|
||||
function
|
||||
| _ -> 0
|
||||
;;
|
||||
|
||||
let f x =
|
||||
match x with
|
||||
| _ -> 0
|
||||
;;
|
||||
|
||||
let f x =
|
||||
begin match x with
|
||||
| _ -> 0
|
||||
end
|
||||
;;
|
||||
|
||||
let check_price t = function
|
||||
| { Exec.
|
||||
trade_at_settlement = (None | Some false);
|
||||
} -> ()
|
||||
|
||||
let check_price t = function
|
||||
| simpler -> ()
|
||||
| other -> ()
|
||||
|
||||
(* Sometimes we like to write big alternations like this, in which case the
|
||||
comment should typically align with the following clause. *)
|
||||
let 0 =
|
||||
match x with
|
||||
| A
|
||||
(* a *)
|
||||
-> a
|
||||
let 0 =
|
||||
match x with
|
||||
A
|
||||
(* a *)
|
||||
-> a
|
||||
|
||||
let _ =
|
||||
a
|
||||
|| match a with
|
||||
| a -> true
|
||||
| b -> false
|
|
@ -78,6 +78,10 @@
|
|||
{
|
||||
"name": "Ayoub Adib",
|
||||
"url": "https://github.com/ayoubdev"
|
||||
},
|
||||
{
|
||||
"name": "Frederic Delbos",
|
||||
"url": "https://github.com/fdelbos"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
|
|
|
@ -48,6 +48,7 @@ module.exports = class Beautifiers extends EventEmitter
|
|||
'fortran-beautifier'
|
||||
'js-beautify'
|
||||
'jscs'
|
||||
'ocp-indent'
|
||||
'perltidy'
|
||||
'php-cs-fixer'
|
||||
'phpcbf'
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
###
|
||||
Requires https://github.com/OCamlPro/ocp-indent
|
||||
###
|
||||
|
||||
"use strict"
|
||||
Beautifier = require('./beautifier')
|
||||
|
||||
module.exports = class OCPIndent extends Beautifier
|
||||
name: "ocp-indent"
|
||||
|
||||
options: {
|
||||
OCaml: true
|
||||
}
|
||||
|
||||
beautify: (text, language, options) ->
|
||||
@run("ocp-indent", [
|
||||
@tempFile("input", text)
|
||||
])
|
|
@ -43,6 +43,7 @@ module.exports = class Languages
|
|||
'marko'
|
||||
"mustache"
|
||||
"objective-c"
|
||||
"ocaml"
|
||||
"pawn"
|
||||
"perl"
|
||||
"php"
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
module.exports = {
|
||||
|
||||
name: "OCaml"
|
||||
namespace: "ocaml"
|
||||
|
||||
###
|
||||
Supported Grammars
|
||||
###
|
||||
grammars: [
|
||||
"OCaml"
|
||||
]
|
||||
|
||||
###
|
||||
Supported extensions
|
||||
###
|
||||
extensions: [
|
||||
"ml"
|
||||
]
|
||||
|
||||
options: []
|
||||
|
||||
}
|
Loading…
Reference in New Issue