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

Need help for mint format. #37

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

Need help for mint format. #37

zw963 opened this issue Jun 29, 2022 · 4 comments

Comments

@zw963
Copy link

zw963 commented Jun 29, 2022

What i said is mint-lang.

https://mint-lang.com/guide/getting-started/tools

Following is command:

 ╰─ $ 1  mint format source/Main.mint 
Mint - Formatting files
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
All files are formatted!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
All done in 299μs!

I have no idea how to make this command work.

Following is my config:

(reformatter-define mint-format
  :program "mint"
  :args '("format")
  :stdout nil
  )

Thank you.

@zw963
Copy link
Author

zw963 commented Jul 1, 2022

Try more but still no luck

(defun mint--format-args ()
  (append
   '("format")
   `(,(buffer-file-name))
   )
  )

(defun mint--format-exit-code (code)
  t
  ;; (when (or (eq code 0) (eq code 1))
  ;;   t
  ;;   )
  )

(reformatter-define mint-format
  :program "mint"
  :args (mint--format-args)
  :stdout nil
  :input (reformatter-temp-file-in-current-directory "mint")
  :exit-code-success-p mint--format-exit-code
  )

@purcell
Copy link
Owner

purcell commented Jul 5, 2022

Does mint format support reading/writing with stdin/stdout? That's the best solution if possible, and if not, an upstream bug report is advised. Very very few such programs don't support that mode of operation these days.

@zw963
Copy link
Author

zw963 commented Jul 5, 2022

Does mint format support reading/writing with stdin/stdout? That's the best solution if possible, and if not, an upstream bug report is advised. Very very few such programs don't support that mode of operation these days.

Current, mint format in replace code in file directly, it have one options for this.

(reformatter-define mint-format
  :program "mint"
  :args '("format" "--stdin")
  )

but, the issue is, the mint format --stdin must be run within the project root to make it work correct, is there any option archive this?

more context, please check this

Thank you

@c4710n
Copy link

c4710n commented Feb 26, 2023

#13 (comment) would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants