atom-standard-formatter icon indicating copy to clipboard operation
atom-standard-formatter copied to clipboard

Please consider adding

Open hanakin opened this issue 8 years ago • 3 comments

Hey guys love the package my only issue with these standards (which are great by the way), and the one rule i feel should be configurable is the spacing of indent this should always be an option.

This is a global programming concern as we often mix various languages often, some of which require 2 spaces and some of which require 4 spaces, others hat require hard tabs.

since there is a format for 2 spaces and hard tabs I made a version with 4 space soft tabs to meet this need.

https://github.com/hanakin/sane-format https://github.com/hanakin/js-sane-standard

please consider adding it to the package thks

hanakin avatar Sep 09 '16 00:09 hanakin

Thanks the feedback @hanakin.

I feel like this may be adding support for too many deviations from the actual standard format. We originally added support for semi-standard and happiness format because the existing linter package supported these options. In retrospect this may have been a bad idea, as it opens up the possibility to support an unlimited number of flavours of standard (which is kind of the opposite of what standard tries to achieve). Supporting a variety of formatters, in my opinion, should be left to installing multiple Atom packages or creating a general purpose/customizable formatting package – something other than standard-formatter.

stephenkubovic avatar Sep 14 '16 23:09 stephenkubovic

hmm thats the thing though or rather the fools errand of standard. its a novile idea but the two things that very in any of these is semi colons and spacing. why? because it varies in other languages. 1. semi-colons is a weird one and outside of standard I have never heard of not using them and doubt it will catch on, especially since lots of languages use them. 2. spacing is dictated by project more than anything else it depends on what other languages you couple it with. the only reason that 2 spaces ever caught on in the first place was because of saas being a ruby project and ruby is strictly 2 spaced.... However if you ever work with other languages in your projects such as php, .net, java, etc... they also have their own standards for spacing. Not to mention HTML is 4 spaced tabs.... In fact I think 4 spaced tabs is the more universal as outside of ruby I can not really think of another language that is 2 spaced of the top of my head.

Maybe a better way to handle this is to just allow an override for those two settings? This way you would need none of the others...

hanakin avatar Sep 14 '16 23:09 hanakin

@hanakin "the fools errand of standard" is literally one of the selling points

No decisions to make. No .eslintrc, .jshintrc, or .jscsrc files to manage. It just works.

This module saves you (and others!) time in two ways:

No configuration. The easiest way to enforce consistent style in your project. Just drop it in. Catch style errors before they're submitted in PRs. Saves precious code review time by eliminating back-and-forth between maintainer and contributor.

I think you should look for another solution if you disagree with the very heart of the project.

kyeotic avatar Feb 28 '17 18:02 kyeotic