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

Multiple active beautifiers per language #457

Closed
Cortys opened this issue Jul 12, 2015 · 24 comments
Closed

Multiple active beautifiers per language #457

Cortys opened this issue Jul 12, 2015 · 24 comments

Comments

@Cortys
Copy link
Contributor

Cortys commented Jul 12, 2015

It would be pretty awesome if the plugin could handle multiple active beautifiers per language so that you can set up something like a queue of beautifiers.

I for example use JSCS and JSBeautify at the same time, since the JSCS fixer is quite rudimentary atm and JSBeautify cannot be configured to be fully compliant with my JSCS config.

This problem could be solved if it was possible to setup a queue, that runs a file through JSBeautify first and then through JSCS.

Another use case for this would be if you use different beautifiers on different projects. Instead of switching the beautifier in the settings, it would be possible to simply connect all beautifiers in series and tell them to only run if a config file is present.

This of course requires quite a lot of work but I think it's worth discussing.

@Glavin001
Copy link
Owner

Very interesting idea. So taking advantage of the additional features between various beautifiers to achieve your desired formatting? Right now there is only a single defaultBeautifier however I could see a beautifierPipeline or something similar where multiple beautifiers are enabled, each utilizing different beautification features that the other(s) may not.

If there is interest from other users as well then I think this is worth researching and developing in a future version.

@Cortys
Copy link
Contributor Author

Cortys commented Jul 13, 2015

Sounds great. Thanks!

@pavankris
Copy link

Yes this would be really useful, as we could use default and then override some from user ..

@danseethaler
Copy link

I'd love to see this concept come to life. I've got the same issue as outlined in #484 and would love to see an HTML beautify followed by PHP. Any idea of when this might get looked at?

@Glavin001
Copy link
Owner

For those interested in developing a Pull Request.

The above is rough. Looking forward to seeing what others come up with as well.

@danseethaler
Copy link

Fantastic outline @Glavin001 I'd love to take a look at it although I'll have to brush up my coffeescript skills.

@Glavin001
Copy link
Owner

@danseethaler maybe http://js2.coffee/ could help you with the CoffeeScript part 😉. Best of luck!

@Glavin001 Glavin001 added this to the v1.0.0 milestone Apr 1, 2016
@Glavin001
Copy link
Owner

In addition to chaining / piping beautifier output to another, such beautifying JavaScript with JSCS and then JS-Beautify or Pretty Diff, after looking into #722 it appears that being able to beautify a language with multiple types of sub-languages (think PHP file with both PHP code and HTML code and maybe even JavaScript and CSS code within) would be valuable.

Vue is a great example ( #722 ) and an implementation found at https://github.com/LeslieYQ/vue-format/blob/master/lib/vue-format.coffee#L27-L50 used Regular Expressions to split the code into each of the sub-languages and allow their respective beautifiers to be applied individually.

I'll keep thinking about this feature. Hopefully we can have this support in upcoming months and for release v1.

@mjanser
Copy link

mjanser commented Jun 23, 2016

Is there any progress on this?

I'd be really interested in the part of using different beautifiers on different projects. Some projects I work on are using PHP_CodeSniffer, other use PHP-CS-Fixer. It would be great if the plugin could check if a config file is present and then only run the appropriate beautifier.

@Glavin001
Copy link
Owner

Is there any progress on this?

No progress yet.

I'd be really interested in the part of using different beautifiers on different projects. Some projects I work on are using PHP_CodeSniffer, other use PHP-CS-Fixer. It would be great if the plugin could check if a config file is present and then only run the appropriate beautifier.

This sounds like a different issue / feature, which I think would also be great to have.
This Issue is about having multiple beautifiers for handling beautification of a complex file.
What you want would be a way for the default beautifier to be chosen dynamically given the current project. This would be simpler to accomplish. I'll have to think a little more about how I'd want to implement this. Feel free to create a separate issue for this feature request detailing your use case. Thanks!

@mjanser
Copy link

mjanser commented Jul 2, 2016

Thank you for the information. I created a separate issue #1041 as suggested.

@Glavin001
Copy link
Owner

I'm working on this feature for Unibeautify: Unibeautify/unibeautify#4

Atom-Beautify will eventually be migrated over to Unibeautify, and therefore support this feature. See #1174.

@MattRiddell
Copy link

Hi, any progress on this?

@eivindml
Copy link

eivindml commented Apr 5, 2017

Any news?

@Glavin001
Copy link
Owner

No updates lately. I just finished my final exams yesterday, so now I will have time to revisit my work on Unibeautify. Thank you for your patience!

@MattRiddell
Copy link

Donations accepted?

@Glavin001
Copy link
Owner

Donations are very much appreciated, @MattRiddell . Thank you! 😃

P.S. Paypal Donation button is at the top of the README. I'm not overly familiar with donations, so feel free to recommend other donation platforms I should add. Thanks again!

@MattRiddell
Copy link

Ok cool no probs 😊

@simondoescode
Copy link

Any updates?

@Glavin001
Copy link
Owner

No update, yet. Just released #1687 and testing it now. I think this may be the next feature.

In fact, I am going to reopen this and implement in Atom-Beautify first. I will port over to Unibeautify once we are all happy with its implementation.

@Glavin001 Glavin001 reopened this Jun 30, 2017
@MattRiddell
Copy link

Awesome!

@stale
Copy link

stale bot commented Nov 4, 2017

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 4, 2017
@stale stale bot closed this as completed Nov 11, 2017
@StefKors
Copy link

Any updates?

@stevenzeck stevenzeck mentioned this issue Jan 28, 2018
5 tasks
@Glavin001
Copy link
Owner

Glavin001 commented Feb 6, 2018

Multiple beautifiers per language has been implemented in Unibeautify: Unibeautify/unibeautify#4

Atom-Beautify is being rewritten to be powered by Unibeautify. (#1174, cc @szeck87 )

Please keep the feature ideas and support coming! I appreciate your patience. I hope to develop Unibeautify to meet all of your needs.

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

No branches or pull requests

9 participants