emacs-format-all-the-code
emacs-format-all-the-code copied to clipboard
[Feature Request] Support mint-lang.
https://mint-lang.com/guide/getting-started/tools
Following is a usage example:
╰─ $ 1 mint format source/Main.mint
Mint - Formatting files
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
All files are formatted!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
All done in 299μs!
Thank you.
Looks doable. If someone sends a PR, I'll merge it.
- You'll have to use
--stdin. - You may or may not have to use
--envso that it finds its configuration file.format-all--locate-filecan help.
$ mint format --help
Usage:
mint format [flags...] <pattern> [arg...]
Formats source files
Flags:
--check # Checks that formatting code produces no changes
--env, -e # Loads the given .env file
--help # Displays help for the current command.
--stdin # Formats Mint code from STDIN
Arguments:
pattern # The pattern which determines which files to format
Another issue is, mint format will return code 1 if current file formatted by this command.
i consider this probably a design error, mint format --check exactly do this things, instead, i consider
the correct process is, if mint format run successful, whatever formatted file no no any changes made,
it should always return code 0.
if need do some extra step for this?
Thanks for investigating it.
Indeed, almost all other formatters use exit code 0 even when they did not make any changes to the code.
format-all--buffer-hard can work around it, but it would be better to fix the upstream mint format. Can you ask in their issue tracker?
Thanks for investigating it.
Indeed, almost all other formatters use exit code 0 even when they did not make any changes to the code.
format-all--buffer-hardcan work around it, but it would be better to fix the upstreammint format. Can you ask in their issue tracker?
Maybe i am wrong, if use like this, cat source/Main.mint |mint format --stdin, it seem like always return 0 whatever if content was changed.