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

Unnecessary indent in short operator #307

Open
benjavalero opened this issue Dec 3, 2019 · 1 comment
Open

Unnecessary indent in short operator #307

benjavalero opened this issue Dec 3, 2019 · 1 comment

Comments

@benjavalero
Copy link

In a binary operation, if the second operator is too short, it seems indented unnecessarily.

Maybe related to #251

Input:

articleIds.removeIf(id -> replacementRepository.countByArticleIdAndTypeAndSubtypeAndReviewerNotNull(
        id, ReplacementFinderService.CUSTOM_FINDER_TYPE, replacement) > 0);

Output (0.4.0):

articleIds.removeIf(
    id -> replacementRepository.countByArticleIdAndTypeAndSubtypeAndReviewerNotNull(
        id,
        ReplacementFinderService.CUSTOM_FINDER_TYPE,
        replacement
    ) >
        0
);

Expected Output (IMHO):

articleIds.removeIf(
    id -> replacementRepository.countByArticleIdAndTypeAndSubtypeAndReviewerNotNull(
        id,
        ReplacementFinderService.CUSTOM_FINDER_TYPE,
        replacement
    ) > 0
);
@clementdessoude
Copy link
Contributor

Indeed, it is printed weirdly... The binary expression logic is a bit complex, it would be nice to try to refactor this part to be able to handle those cases more easily.

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

No branches or pull requests

2 participants