Skip to content

[Bug]: weird formatting #1874

Open
Open

Description

@belav

Description

This doesn't seem ideal but I don't know if there is a better way to deal with it.

return pages.Where(o =>
    o.PublishOn
    == pageVersionQuery
        .Where(p => p.PageId == o.PageId && p.PublishOn < parameter.ActiveOn)
        .Max(p => p.PublishOn)
);

Activity

  1. domn1995 commented on Jun 28, 2026

    @domn1995
    SponsorContributor

    I think a lambda argument that itself needs wrapping should always start on next line:

    return pages.Where(
        o => o.PublishOn 
            == pageVersionQuery
                .Where(p => p.PageId == o.PageId && p.PublishOn < parameter.ActiveOn)
                .Max(p => p.PublishOn)
    ); 

    And worst case where each operand is too long we can wrap each one treating each like it's a method call that would be in its own line:

    return pages.Where(
        o => o.PublishOn 
            == pageVersionQuery
                .Where(
                    p => p.SuperDuperMegaLongPageId 
                        == o.SuperDuperMegaLongPageId
                        && p.SuperDuperMegaLongPublishOn 
                        < parameter.SuperDuperMegaLongActiveOn
                )
                .Max(p => p.PublishOn)
    ); 
  2. github-actions commented on Sep 27, 2026

    @github-actions

    This issue is stale because it has been open 90 days with no activity and was not assigned a label or milestone. Leave a comment if this still needs to be addressed or this will be closed in 7 days.

  3. added this to the 1.5.0 milestone on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions