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

Add ability to customize tab size #14225

Closed
delvh opened this issue Jan 3, 2021 · 5 comments
Closed

Add ability to customize tab size #14225

delvh opened this issue Jan 3, 2021 · 5 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@delvh
Copy link
Member

delvh commented Jan 3, 2021

  • Gitea version (or commit ref): -
  • Git version: -
  • Operating system: -

Description

Many projects and files use different tab sizes: The preferred ones are 2, 4 and 8.
And yet, there is currently no option to customize this for each file in a Pull Request, or when viewing the raw source code inside the file tree.
It would be nice if users could customize themselves how many spaces a tab should represent.
As far as I'm aware, currently only setting the tab size globally using hard-coded values (see #9071) is supported.

What to implement

  • option for users to configure the tab size in a PR for every file/ globally (so that every file in this PR will have tab size 2,4 or 8)
  • option for users to configure the tab size when viewing raw source code in the file tree

Both options must not be persisted, simply calling them with a default value should be enough.

@silverwind
Copy link
Member

We don't need a separate option, users should just commit a .editorconfig into the repo instead which makes tab preference work everywhere including GitHub. We do support editorconfig in the online code editor, just not in the code view.

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jan 3, 2021
@delvh
Copy link
Member Author

delvh commented Jan 3, 2021

Well, already the fact that many/most people don't know about that, speaks against it in my opinion.
Start a poll somewhere, I'm 95% sure if you ask 100 random developers/ git users, 50 of them will not know about the editorconfig.
While it might currently be possible, it definitely is rather hacky.
And having the .editorconfig does not invalidate the additional option:
As I have mentioned, that can then be the default values used.
By offering the option to manually change the tab size for a specific PR, nothing gets lost.
Instead, it is enhanced, as less code will be horribly misplaced.

@CirnoT
Copy link
Contributor

CirnoT commented Jan 3, 2021

Should we also make separate config for line length? And whether it's tab or space? How about using tab/space differently for different files (.yaml)? Should we also support that?

These are rhetorical questions really, as you can see, Gitea is not a place to handle this for you.

@6543
Copy link
Member

6543 commented Jan 3, 2021

I think this will just add eafen more complex code :/ - .editorconfig is the way to go if you asked me

@techknowlogick
Copy link
Member

Closing as there is an established standard and we shouldn't compete with it

@go-gitea go-gitea locked and limited conversation to collaborators Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

6 participants