Open zw963 opened 2 years ago
Looks doable. If someone sends a PR, I'll merge it.
--stdin
.--env
so that it finds its configuration file. format-all--locate-file
can 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-hard
can 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.
https://mint-lang.com/guide/getting-started/tools
Following is a usage example:
Thank you.