angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Cannot change tabulation size

Open albanx opened this issue 10 years ago • 49 comments

Hi There Is there a way to set the tab size to 4 spaces instead of 2 of the new generated files?

Cheers Alban

albanx avatar Jun 30 '16 08:06 albanx

Please consider reopening this issue. I have configured VSCode to not detect current file settings so that I can go in and auto-format each generated file, but it would sure be nice to skip this step.

rscottfree avatar Jan 26 '17 17:01 rscottfree

+1 seems good and option in angular-cli.json 👍

didacrios avatar Jan 30 '17 13:01 didacrios

+1 Please implement this.

karljv avatar Feb 01 '17 11:02 karljv

+1. Not familiar with anyone use 2 spaces for indenting...

daporro avatar Feb 03 '17 17:02 daporro

+1 Our team also uses 4 spaces and it's slightly annoying needing to go in and update them.

meechanism avatar Feb 09 '17 23:02 meechanism

Could there not at least be a CLI option to set the number of spaces to tab when generating files?

IRCraziestTaxi avatar Feb 10 '17 03:02 IRCraziestTaxi

If this feature is not going to be implemented near soon, at least consider to change the default indent to 4 spaces. It's the default indentacion in WebStorm and most editors.

hacknaked avatar Feb 12 '17 20:02 hacknaked

+1, we use 4 spaces wide tabs for indentation... 2 spaces feel strange...

shramee avatar Feb 13 '17 04:02 shramee

+1 This feature would be great. Or atleast change it to 4 spaces as that is the most common indentation setting from what I can tell.

jaygazula avatar Feb 16 '17 00:02 jaygazula

+1 I would like to have that feature

FelixWessendorf avatar Feb 16 '17 09:02 FelixWessendorf

+1 for Tabs. 2 spaces just makes the code ugly.

Kaleab14 avatar Feb 18 '17 11:02 Kaleab14

+1 for indentation. Can't stand 2 spaces!!!!!

mr-madamin avatar Feb 18 '17 16:02 mr-madamin

Is this not something the team cares to add, @filipesilva? Seems to be a good bit of interest, yet the issue remains closed.

JustinSchneider avatar Feb 20 '17 12:02 JustinSchneider

Tabs vs spaces (and number of spaces) is one of those heavy, contentious issues in the JS community.

It's not a matter of functionality, but rather of style. On matters of style we usually defer to the style guide. The style guide has no recommendations on tabs vs spaces but almost all of the examples internally are in 2 spaces, so we default to 2 spaces.

There are other style issues where we take action, but those are usually motivated by consistency (to minimize confusion and to make it easier to reference docs) rather than any kind of preference.

There is a fair amount of interest, yes. But there is also a very trivial workaround - format your code however you like. The amount of effort to offer this customization isn't well understood, but spending time looking into it is effort as well.

So as far as functionality is concerned, resolving this issue has zero impact. It's just not important enough to take up resources that would be best spent elsewhere.

Sure it would be easier for users to just throw a flag into generators, but I find it hard to justify to myself the development time. Should I fix broken functionality, or should I cater to the eternal tab/spaces struggle? That's an easy decision for me to make. It's also an easy decision if I'm talking about important features instead of bugs. It's very, very low on the totem pole.

We're looking at a new blueprint system and it should be much easier to make these style decisions there. The best I can say is that I'll keep that in mind at the time. But it's just not worth it to try and retrofit the existing system to support this kind of customization.

So that is why this issue remains closed.

filipesilva avatar Feb 20 '17 12:02 filipesilva

Cool. Thanks for the feedback and reasoning, anyway. Guess it's safe to Unsubscribe to this one.

PS - 4 Space Tabs 4 Life!

JustinSchneider avatar Feb 20 '17 12:02 JustinSchneider

@justin you mean just 4 spaces as formating

On Mon, Feb 20, 2017 at 12:49 PM, Justin Schneider <[email protected]

wrote:

Cool. Thanks for the feedback and reasoning, anyway. Guess it's safe to Unsubscribe to this one.

PS - 4 Space Tabs 4 Life!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/1252#issuecomment-281071091, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFAqE1Ifi3dZdCjAR9vNxiavuSaFpvPks5reYvigaJpZM4JB73x .

-- www.albanx.com www.realuploader.com

albanx avatar Feb 20 '17 13:02 albanx

@albanx No, tab characters that are 4 spaces wide. I knew I'd mess up saying it. o_O

JustinSchneider avatar Feb 20 '17 13:02 JustinSchneider

I think most of community is against that, because the tab characters has proven to be problematic in different platforms, meanwhile the space is the same everywhere and will almost never affect file formatting in different platforms.

On Mon, Feb 20, 2017 at 1:37 PM, Justin Schneider [email protected] wrote:

@albanx https://github.com/albanx No, tab characters that are 4 spaces wide. I knew I'd mess up saying it. o_O

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/1252#issuecomment-281081070, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFAqBLBl1dlAjmeUhmkJxu_wi0NMtWUks5reZcKgaJpZM4JB73x .

-- www.albanx.com www.realuploader.com

albanx avatar Feb 20 '17 13:02 albanx

Right, which is why the feature in this issue was requested in the first place. So that individual devs and teams don't have to conform to what the community prefers as a whole. I'm not saying my preference is "right", but it certainly isn't wrong.

JustinSchneider avatar Feb 20 '17 13:02 JustinSchneider

Yes, in any case, that should depend from .editorconfig file, so the idea is that the CLI should format files pending on the .editorconfig file

On Mon, Feb 20, 2017 at 1:43 PM, Justin Schneider [email protected] wrote:

Right, which is why the feature in this issue was requested in the first place. So that individual devs and teams don't have to conform to what the community prefers as a whole. I'm not saying my preference is "right", but it certainly isn't wrong.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/1252#issuecomment-281082358, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFAqIPUAxLHjZT9dv5n7cq7VuGy0rIiks5reZh0gaJpZM4JB73x .

-- www.albanx.com www.realuploader.com

albanx avatar Feb 20 '17 13:02 albanx