swagger-api / swagger-api/swagger-codegen

Discussion - tabs vs spaces

Open
#5,311 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Code format General: Discussion
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

re #5299

@wing328 this has been a big sticking point among JS developers I've worked with who are used to 2-space indents. The tabs were a compromise so they could keep their 2-spaces based on editor setting, while the rest of the world uses 4-space. I respect the official TS style guidelines, so not suggesting undoing #5299. But I am slightly disappointed because now I have to post-process swagger-codegen with a script to replace 4-space back to tabs.

Does it make sense to start a feature request for a setting to control tab size and/or spaces output? Would anyone besides me be supportive of it?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no file, test, or entry point. Start by reviewing how swagger-codegen's template-driven output handles indentation for JavaScript and TypeScript, then determine the scope of a configurable tab-size or spaces-versus-tabs setting. Done should include an agreed behavior and clear support for the requested output choice.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.