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

Configurable indentation size #77

Open
RealityAnomaly opened this issue Mar 10, 2021 · 8 comments
Open

Configurable indentation size #77

RealityAnomaly opened this issue Mar 10, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@RealityAnomaly
Copy link
Member

I prefer to indent my Nix expressions with four spaces rather than two as I find it more readable. It'd be nice to have this as a command-line option you can specify, with two as the default.

@yorickvP yorickvP added the enhancement New feature or request label Feb 25, 2022
@quantenzitrone
Copy link

yes and a tabs option please
preferably even respecting the settings in .editorconfig

@infinisil
Copy link
Member

While it has been configurable for a while using -w, since #118, it's a soft limit, and not a hard one. We should also implement a way to configure the hard limit now.

@quantenzitrone
Copy link

-w is for line length not indentation

@dasJ
Copy link
Member

dasJ commented Apr 3, 2024

Yep sorry, that was an oversight on my side :/

@infinisil
Copy link
Member

Ah I see, makes sense!

I guess for that we should use editorconfig's indent_size

@omkumar312
Copy link

I want to work on this issues please assign me this issue.

@infinisil
Copy link
Member

@omkumar312 Thanks! If you need any help, feel free to also join the Nix Formatting Matrix room.

Note also that there's already an open draft PR for this: #209

@omkumar312
Copy link

Command-Line Option: Introduce a flag, such as --indent, that allows users to set their preferred indentation size. example of usage: 'nixfmt --indent 4'

Keep the default indentation at two spaces for compatibility but enable users to choose four spaces if they prefer.
This change will provide greater flexibility and accommodate different coding styles, improving overall readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

6 participants