forked from NixOS/nixfmt
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Column width experiments #3
Open
piegamesde
wants to merge
93
commits into
master
Choose a base branch
from
column-width
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To make more clear that one formats and the other one only checks
Tests mostly imported from Alejandra
- Disallow single-line if statements - Handle multi-line conditions differently (indent instead of absorb)
- The (from) case needs to be improved - Somehow it indents the comments *after* the statement now, no idea why or how to fix
The file was identical to diff/idioms_nixos_1 and therefore redundant. Moreover, we need to also keep a look on the *really* big packages in there, and Mozilla is a prime example.
Except when that item is another list or attribute set
This is nixos/modules/services/web-apps/nextcloud.nix, so that we have a big NixOS module in our suite
from not form
There is now the choice whether to pull whitespace just before/at the start of a group in or out. This allows to fix an outstanding issue with inherit statements, and is also used in the bindings format
Fix typo in README.md
They now get expanded and indented more liberally, with some exceptions. Things still look weird at places because of parentheses formatting.
With a couple of exceptions, multiline parentheses are now forced to start on the next line.
It is now even more powerful, although there is still a bit of room for improvement in the future. In short, it defers merging spacing across group boundaries, allowing groups to start/end with spacing even if the previous/next token is a whitespace too. Previously, they would get merged, causing weird results. - Removed mergeSpacings', as it is not needed anymore - Merged moveLinesOut and mergeSpacings into a single pass "fixup" - layoutGreedy can now handle some consecutive spacings across group boundaries - It still does not handle all cases, only the ones needed for the current features. More will be added as needed.
Only place the semicolon onto a new line if the last expression of the body is an if statement or an operator chain.
Instead of extracting comments from tokens with a lot of special cases, we now move them out of groups as part of the fixup processing. This fixes comment handling in all the remaining cases which were previously forgotten.
piegamesde
force-pushed
the
rfc101-style
branch
from
October 18, 2023 13:25
579d02c
to
7649a1b
Compare
This was referenced Oct 31, 2023
piegamesde
force-pushed
the
column-width
branch
from
October 31, 2023 19:38
9292494
to
1c0c907
Compare
piegamesde
force-pushed
the
column-width
branch
from
October 31, 2023 20:51
1c0c907
to
a3a65eb
Compare
piegamesde
added a commit
that referenced
this pull request
Nov 14, 2023
As was empirically determined in #3 and piegamesde/nixpkgs#3
piegamesde
added a commit
that referenced
this pull request
Nov 15, 2023
As was empirically determined in #3 and piegamesde/nixpkgs#3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.