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

feat: custom (experimental) indentation option #435

Open
wants to merge 2 commits into
base: kamadorueda
Choose a base branch
from

Conversation

kamadorueda
Copy link
Owner

No description provided.

@kamadorueda kamadorueda changed the base branch from main to kamadorueda November 24, 2024 03:40
@@ -99,7 +100,12 @@ fn build_step(
add_token(
builder,
rnix::SyntaxKind::TOKEN_WHITESPACE,
&format!("{0:<1$}", "", 2 * build_ctx.indentation),
&match build_ctx.config.indentation {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we allow the indent customisation, I think it makes sense to allow it fully. That's why I initially proposed the {number}{t | s} syntax in #431.

To make the parsing simple, I would change my initial proposal and disallow the {number} case, like 4, so that either t or s must be always specified.

What do you think?

@@ -0,0 +1,114 @@
[

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend separating the indention and correctness tests as those are different features and their testing logic might change over time. Perhaps, the structure could be

tests/cases
  rules
    apply
      out.nix (uses default 2 spaces indent)
    list
    ...
  indentation
    apply
      out-tabs.nix (uses tabs)
      out-{custom} (optional, if we'd like to test different indentations)
    list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants