Project

General

Profile

Actions

Misc #18891

closed

Expand tabs in C code

Added by k0kubun (Takashi Kokubun) over 2 years ago. Updated over 2 years ago.

Status:
Closed
Assignee:
-
[ruby-core:109115]

Description

Problem

There's no way to handle tab/space-mixed indentation of CRuby's C code properly in VSCode. It impacts the productivity of the VSCode users a lot, including myself.

Suggested solutions

I implemented option 2 out of the following options at https://github.com/ruby/ruby/pull/6094.

  1. You tell me how to do that in VSCode.
  2. Expand all tabs in most of the C code at once and add the commit to .git-blame-ignore-revs
    • pros: GitHub and git blame --ignore-revs-file support it. Unlike option 3, commit logs and .git-blame-ignore-revs can be short.
    • cons: It might be a bit difficult to find out which C files shouldn't be a target. Bare git blame could be inconvenient.
  3. Allow expanding all tabs in each C file as we want and manage the list of such commits in .git-blame-ignore-revs
    • pros: GitHub and git blame --ignore-revs-file support it. You don't introduce unnecessary changes to files you don't care about.
    • cons: We might see too many commits for this in the commit history. Bare git blame could be inconvenient for such files.
  4. Discourage contributions to CRuby from VSCode users. (proposed by @graywolf (Gray Wolf))

Drawbacks

The expected drawbacks of doing option 2 are:

  • Existing patches on hard-tab lines may conflict.
  • Backporting patches on hard-tab lines made after this commit to revisions before this commit may conflict.

I assume that resolving such conflicts wouldn't be too difficult and this problem will not last forever.

Out of scope

I'm not interested in discussing the adoption of clang-format. It would change a lot of things that are not related to the problem.

Past discussion

https://bugs.ruby-lang.org/issues/16112 touched this topic before, but we haven't discussed --ignore-revs-file so much. I also didn't know VSCode still can't deal with it in 2022 (as I've been using Vim).

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0