-
Notifications
You must be signed in to change notification settings - Fork 885
'jfmt' tool for the fast formating #50
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
Conversation
Thanks for thinking about how to make this project better! Question: If On Tue, May 24, 2016 at 5:37 AM, Pavel Bazin [email protected]
Kevin Bourrillion | Java Librarian | Google, Inc. | [email protected] |
I had the idea before, but as you suggest to put more functionality into the executable I think it should be considered now: What do you think about separating library code and executable into two artifacts? This would prevent problems like #42 in the future and tools like dagger could depend on the library only. CLI parsing libraries ( Both library and tool could evolve independently and adding the functionality you suggested would not require a new release of the library. |
If you ask me, I'll write this kind of a tool in both proposed cases. If Consider following use case:
Now you are able to read formatted code like it was formatted from the beginning. Or
To write code in comfortable style and format it afterwards to common style. I can't say that last example can be considered as a good one, but it shows the point. Cheers. |
Thanks for answer @cushon ! This script is aimed on an integration into users shell. The key point is to type 4 characters and format whole project at once, or type 5 characters and drag-n-drop particular However, perhaps it will be too much to have two wrappers. I proposed this tool because it serves well to me, with an unix-like idea "one tool for a one job". May be it is a good idea to add this functionality into the existing script? Otherwise lets close this request. Cheers! |
I wrote a tool, Python script, which is able to format .java files in directory and subdirectories or just a single .java file. I use it like
$ jfmt /path/to/project/dir
and I find it very convenient way to format my code as a whole.Script was tested on Linux and Mac.
I hope this tool can be useful for others. Also, I not quite sure about the name. I was inspired by
fmt
from the Go lang.