Replies: 1 comment 5 replies
-
Hej, this is great feedback, and while we do want to take the default from whatever is the standard in the respective ecosystem, we should of course make Topiary as accessible as possible. In an older version of Topiary the indentation was user configurable, but this was removed in a refactor with the intention of adding it back. This has not happened yet. I have created #505 with a proposed change to add it back. I hope this way we can have Topiary have the best of both worlds. Reading .editorconfig is also definitely an option, but I think (for now) not one we want to explore just yet. I hope having a configuration distinct from .editorconfig is still acceptable. Using Please let us know if #505 addresses your concerns, and if not, what we can do further to help you. Kindly, |
Beta Was this translation helpful? Give feedback.
-
I have some concerns with a lot of standardize formatting tools in some languages. As the years have passed staring at screens, my eyesight has been getting worse. For now at least 1–2-space indented code causes me a lot of trouble as it lacks the indentation contrast for my eyes & I have a lot of difficulty reading some code bases (Nix, PureScript, & JavaScript come to mind especially once nesting adds up). This can be mildly inconvenient or debilitation in the case of nested Nix sets with lots of
let
s. This tool, Topiary, may have a solution.Some ideas:
As
gofmt
is the listed first as inspiration, consider the user-configurable tab character (U+0009
) for languages that have yet to have years of establish code (and actually support tabs (Nix, PureScript do not)). This would allow folks that prefer 2 spaces to set it in their terminal/editor, and those that need less or more can do the same without affecting the code or the diff. …Or at consider bump this up to something >2 as the default (caveat: helps some vision impaired folks but braille users often prefer 0 or 1 space as it seems to use less space on the device).Supporting & integrate EditorConfig before calling to the default (I see it in this project @
./.editorconfig
). If a user/project defines indentation for a file type, use that first before using the define value or falling back to the 2-space default.Prompted by a
vim-nickel
issue I raised, where it seems this tool wants to be the go-to formatter for Nickel so the tool is in the position to ‘set the standard’ if it wishes. I’ve also raised the concern with OCaml recently (trying to learn) where someone recommended this tool, but for now Topiary appears it falls in the same category 2-space defaults with no easy road to configuration. My current hacky solution is wrappingocamlformat
in a of the same script with Nix that pipes its output to GNUunexpand
which isn’t ideal.After these tools start to cement themselves in their communities, folks get a lot of pushback from any change. The biggest example of this in the formatter space is over at Prettier where for accessibility reasons, they wanted to move to the default of 1 tab character (when a user hasn’t opted into a specific style or wants to follow the community/tool defaults) & it has been a slog to follow as the old tabs vs. spaces arguments arise to where maintainers may just opt to leave it alone than make a change (3+ years already). In Prettier’s case, even though it seems a lot of folks, myself included, are in favor of the change, it’s a bit hard to tell what the ‘real’ support level is as those most affected by the defaults not working for them are more likely to notice the issue & raise concern. Topiary is young, so I would like to bring up the idea earlier rather than later with the existing community.
Beta Was this translation helpful? Give feedback.
All reactions