Open RealityAnomaly opened 3 years ago
yes and a tabs option please preferably even respecting the settings in .editorconfig
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.
-w
is for line length not indentation
Yep sorry, that was an oversight on my side :/
Ah I see, makes sense!
I guess for that we should use editorconfig's indent_size
I want to work on this issues please assign me this issue.
@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: https://github.com/NixOS/nixfmt/pull/209
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.
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.