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

Whitepace added around parentheses within string #399

Open
n8henrie opened this issue Aug 23, 2023 · 0 comments
Open

Whitepace added around parentheses within string #399

n8henrie opened this issue Aug 23, 2023 · 0 comments
Labels
component | style Modifications to the formatting rules roadmap | style config status | it is a good thing We agree it is good to implement this type | feature request New feature or request

Comments

@n8henrie
Copy link
Contributor

n8henrie commented Aug 23, 2023

I have a "line too long" error thrown by pkgs.writers.writePythonApplication that I'm working around by changing

''"${thisLongNixPath}"'' into

''(
        "${thisLongNixPath}"
)';'

as the newline break should put the long string under the line length limit.

Unfortunately, alejandra keeps adding a bunch of whitespace before the ( and the "${:

$ diff flake.nix <(alejandra -q <flake.nix )
35,37c35,37
<           ''(
<             "${chromium}/Chromium.app/Contents/MacOS/Chromium"
<             )
---
>           ''            (
>                         "${chromium}/Chromium.app/Contents/MacOS/Chromium"
>                         )

I think that's because this is surrounded in a square bracket, and it seems to want to align the inner parentheses to the outer square bracket, but this kind of alignment within a string perhaps shouldn't happen:

Pre:

        replacements = [
          "--replace"
          ''"./Chromium.app/Contents/MacOS/Chromium"''
          ''(
            "${chromium}/Chromium.app/Contents/MacOS/Chromium"
            )
          ''
        ];

Post:

        replacements = [
          "--replace"
          ''"./Chromium.app/Contents/MacOS/Chromium"''
          ''            (
                        "${chromium}/Chromium.app/Contents/MacOS/Chromium"
                        )
          ''
        ];
@kamadorueda kamadorueda added type | feature request New feature or request component | style Modifications to the formatting rules status | it is a good thing We agree it is good to implement this roadmap | style config labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component | style Modifications to the formatting rules roadmap | style config status | it is a good thing We agree it is good to implement this type | feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants