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

lambda #282

Closed
tonycody opened this issue Sep 9, 2021 · 3 comments
Closed

lambda #282

tonycody opened this issue Sep 9, 2021 · 3 comments

Comments

@tonycody
Copy link

tonycody commented Sep 9, 2021

Can lambda be optimized to render better?

@wilkinsona
Copy link
Contributor

What do you think could be improved? Can you provide some examples of the current output and equivalent examples where you think the formatting's better?

@tonycody
Copy link
Author

tonycody commented Sep 9, 2021

What do you think could be improved? Can you provide some examples of the current output and equivalent examples where you think the formatting's better?
You can refer to it
https://github.com/palantir/palantir-java-format
image

@wilkinsona
Copy link
Contributor

Thanks. The before in the image above doesn't match the behaviour of this formatter. This formatter formats that code as follows:

private static void configureResolvedVersionsWithVersionMapping(Project project) {
    project.getPluginManager().withPlugin("maven-publish", plugin -> {
        project.getExtensions().getByType(PublishingExtension.class).getPublications()
                .withType(MavenPublication.class)
                .configureEach(publication -> publication.versionMapping(mapping -> {
                    mapping.allVariants(VariantVersionMappingStrategy::fromResolutionResult);
                }));
    });
}

Further changes, such as placing getByType(PublishingExtension.class) and getPublications() on separate lines is a duplicate of #124.

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

No branches or pull requests

2 participants