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

Language whitelist for Beautify on Save #308

Closed
dhm116 opened this issue May 4, 2015 · 6 comments
Closed

Language whitelist for Beautify on Save #308

dhm116 opened this issue May 4, 2015 · 6 comments

Comments

@dhm116
Copy link

dhm116 commented May 4, 2015

The current behavior appears to be "beautify everything unless the language has been explicitly disabled", which means I am forced to maintain an ever-increasing list of unsupported languages in the Disabled Languages settings page. Why is the behavior not instead "beautify only the supported languages unless the language has been explicitly disabled"?

@Glavin001
Copy link
Owner

Why is the behavior not instead "beautify only the supported languages unless the language has been explicitly disabled"?

Simply because I am trying to add more language support and then users would have to recognize that a new language has been added in an update and enable every language.
This is very undesirable.

I am forced to maintain an ever-increasing list of unsupported languages in the Disabled Languages settings page

I don't fully understand your problem: the languages that are available are ones that are supported by Atom Beautify, not unsupported languages. You should not have to disable these languages as they are supported and should work for you.
Given that, I am going to make some assumptions here, in an attempt to understand your problem. Please give me some additional feedback so we can figure this out. You have beautify on save turned on, and some of the languages you do work with you do not intend on beautifying and so may not either have the beautifier installed for (say Uncrustify for C++ language, etc) and so beautification always fails, which is undesirable. So you go and disable C++, and C, and Java, etc, since they all use Uncrustify which you do not intend on installing.
I can see this being an issue.

Could you please elaborate more on what you mean for this issue?

I am more than happy to provide options to config Atom Beautify for your expected usage.

@Glavin001 Glavin001 added this to the v0.28.0 milestone May 4, 2015
@Glavin001 Glavin001 self-assigned this May 4, 2015
@dhm116
Copy link
Author

dhm116 commented May 5, 2015

Thanks for the feedback! I'll attempt to clarify a little:

First off, I do have beautify on save enabled, so that may be contributing to my "problem".

The current behavior attempts to run beautification on every language supported by Atom, not just those supported by atom-beautify. To demonstrate this, my current list of Disabled Languages looks like Nimrod, Shell Script, Null Grammar, YAML, Go, Dockerfile, Shell Script (Fish), CoffeeScript, Scala, SQL in order to avoid the constant errors every time I save one of those files. It does appear that some of these formats are now supported by atom-beautify, but that list represents a small subset of languages I work with frequently.

My suggestion was to only attempt to beautify languages supported by atom-beautify unless explicitly disabled - this is why I was considering this a whitelist vs blacklist, as you are only attempting to beautify supported languages instead of every file type known to atom.

I did notice there's a new option to mute unsupported language errors, which is nice, but I think would be unnecessary if it only attempted to beautify supported languages to begin with.

Does that make more sense?

@Glavin001
Copy link
Owner

Does that make more sense?

Thanks for clarifying. I'd like to develop a solution for cases like this for yourself and others.

I did notice there's a new option to mute unsupported language errors, which is nice, but I think would be unnecessary if it only attempted to beautify supported languages to begin with.

I wanted to have a way to indicate to users that this language is not, yet, supported. This way users don't think it's a bug (language not working) and instead realize that they can make a feature request. However, this can become annoying when beautify on save is enabled and so this option to disable unsupported languages notifications was added.


I think this may be an idea solution: how about when Beautify On Save is enabled, you must opt-in for what languages are beautified on save. It sounds like this is only an issue for users with beautify on save enabled. My desire to attempt to beautify all languages and show an error if unsupported was such that if users manually beautified a language, expecting it to work, they could see it is not yet supported and then make a request. This does not make as much sense for beautify on save, which automatically beautifies without user intervention.

My suggestion was to only attempt to beautify languages supported by atom-beautify unless explicitly disabled - this is why I was considering this a whitelist vs blacklist, as you are only attempting to beautify supported languages instead of every file type known to atom.

Would having a whitelist for beautify on save be satisfactory? I think all of the issues similar to this one originate from beautify on save and the fact that it beautifies for every file type, regardless. I do still want to show the unsupported language errors on beautification that is triggered manually by users, such that they know to contribute and create feature requests for new languages they wish to use.

my current list of Disabled Languages looks like Nimrod, Shell Script, Null Grammar, YAML, Go, Dockerfile, Shell Script (Fish), CoffeeScript, Scala, SQL

Note that Disabled Languages has been removed in favour of language specific disabling (see comments at #284 ).

@Glavin001 Glavin001 modified the milestones: v0.27.0, v0.28.0 May 5, 2015
@Glavin001 Glavin001 changed the title Language whitelist instead of blacklist Language whitelist for Beautify on Save May 5, 2015
@dhm116
Copy link
Author

dhm116 commented May 5, 2015

Yeah, actually, being able to specify a list of languages to beautify on save would work really well. Do you think having the choice between specifying the languages or a checkbox for all supported languages makes sense? Great idea, thanks!

@Glavin001
Copy link
Owner

I think I will add a checkbox for each language, in the same way dusabled languages is implemented now. So you would enable each language specifically that you want to have beautified on save.


Sent from Mailbox

On Tue, May 5, 2015 at 10:20 AM, dhm116 [email protected] wrote:

Yeah, actually, being able to specify a list of languages to beautify on save would work really well. Do you think having the choice between specifying the languages or a checkbox for all supported languages makes sense? Great idea, thanks!

Reply to this email directly or view it on GitHub:
#308 (comment)

@dhm116
Copy link
Author

dhm116 commented May 5, 2015

👍 awesome, thanks so much!

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

2 participants