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

[Feature Request] Support mint-lang. #198

Open
zw963 opened this issue Jun 29, 2022 · 4 comments
Open

[Feature Request] Support mint-lang. #198

zw963 opened this issue Jun 29, 2022 · 4 comments
Labels
pull request wanted Waiting for someone to send a PR to solve this problem

Comments

@zw963
Copy link

zw963 commented Jun 29, 2022

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.

@lassik
Copy link
Owner

lassik commented Jul 1, 2022

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 --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

@lassik lassik added the pull request wanted Waiting for someone to send a PR to solve this problem label Jul 1, 2022
@zw963
Copy link
Author

zw963 commented Jul 1, 2022

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?

@lassik
Copy link
Owner

lassik commented Jul 1, 2022

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?

@zw963
Copy link
Author

zw963 commented Jul 1, 2022

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?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull request wanted Waiting for someone to send a PR to solve this problem
Projects
None yet
Development

No branches or pull requests

2 participants