Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try add mint-lang support. #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions format-all.el
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
("Literate Haskell" brittany)
("Lua" lua-fmt)
("Markdown" prettier)
("Mint" mint)
("Nix" nixpkgs-fmt)
("Objective-C" clang-format)
("OCaml" ocp-indent)
Expand Down Expand Up @@ -744,6 +745,13 @@ Consult the existing formatters for examples of BODY."
(:features)
(:format (format-all--buffer-easy executable "tool" "format" "-")))

(define-format-all-formatter mint
(:executable "mint")
(:install (macos "brew install mint-lang"))
(:languages "Mint")
(:features)
(:format (format-all--buffer-easy executable "format" "--stdin")))

(define-format-all-formatter dart-format
(:executable "dart")
(:install (macos "brew tap dart-lang/dart && brew install dart"))
Expand Down Expand Up @@ -828,7 +836,7 @@ Consult the existing formatters for examples of BODY."
'emacs-lisp-mode
(if region
(lambda () (indent-region (car region) (cdr region)))
(lambda () (indent-region (point-min) (point-max)))))))
(lambda () (indent-region (point-min) (point-max)))))))

(define-format-all-formatter erb-format
(:executable "erb-format")
Expand Down Expand Up @@ -1106,7 +1114,7 @@ Consult the existing formatters for examples of BODY."
(format-all--buffer-easy
executable "format" "-stdin"
(let ((ext (if (not (buffer-file-name)) ""
(file-name-extension (buffer-file-name)))))
(file-name-extension (buffer-file-name)))))
(concat "." (if (equal ext "") "res" ext))))))

(define-format-all-formatter rubocop
Expand Down Expand Up @@ -1567,7 +1575,7 @@ The PROMPT argument works as for `format-all-buffer'."
(let ((prompt (if current-prefix-arg 'always t)))
(if (use-region-p)
(list (region-beginning) (region-end) prompt)
(error "The region is not active now"))))
(error "The region is not active now"))))
(format-all--buffer-or-region prompt (cons start end)))

(defun format-all-ensure-formatter ()
Expand Down