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

x/tools: fix mixed style of indentation in javascript files #24933

Closed
ysmolski opened this issue Apr 18, 2018 · 7 comments
Closed

x/tools: fix mixed style of indentation in javascript files #24933

ysmolski opened this issue Apr 18, 2018 · 7 comments

Comments

@ysmolski
Copy link
Member

ysmolski commented Apr 18, 2018

While working in x/tool/... and x/playground with JS I have encountered mix of indentation, 2/4 spaces and tabs. It’s confusing to edit such files. For example in emacs I have to constantly fight it by switching indent-mode.

I would like to fix this by agreeing to use tabs only (following go style) and fix all files to the unified format.

I am very eager to do this.

@andybons @bradfitz

@gopherbot gopherbot added this to the Unreleased milestone Apr 18, 2018
@bradfitz
Copy link
Contributor

I have no opinions here.

@ysmolski
Copy link
Member Author

cc @broady @campoy

@ghost
Copy link

ghost commented Apr 18, 2018

Duplicate #21719?

@andybons
Copy link
Member

Duplicate of #21719

@andybons andybons marked this as a duplicate of #21719 Apr 18, 2018
@andybons
Copy link
Member

While I twitch when I see inconsistent formatting in a bunch of the JS/CSS/etc., reformatting everything without any logic changes is churn that negates the usefulness of git blame.

For new files, I'm on board with using a standardized formatter so that we just don't need to worry about it (though honestly I wish we didn't have to install npm in order to get it).

That's what #21719 is about, but I'm not onboard with just fixing formatting for formatting's sake.

Unless I'm ignorant of some feature in git that allows you to avoid the scenario I describe above.

@ysmolski
Copy link
Member Author

I see. I have completely forgot about git history. From that point of view it all makes sense. Thank you.

@earthboundkid
Copy link
Contributor

Preserving Git blame is not a good enough reason to avoid standardizing formatting. Git blame inevitably gets confused by uninteresting changes like adding ,. Breaking Git blame should be minimized but not outright avoided. When you're looking at Git blame, you always need to be prepared to dig deeper and go past the first superficial change to a line to find its real source deeper in history. A single formatting commit is easy enough to push past as long as one doesn't arbitrarily churn through formatting systems. Github now has a feature where you can hover next to a line to find prior changes, which makes it easy to daisy chain blame lookups to find the real source.

screen shot 2018-04-18 at 4 17 07 pm

@golang golang locked and limited conversation to collaborators Apr 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants