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

fix #894: Error Prone UnnecessaryLambdaArgumentParentheses #1186

Merged
merged 5 commits into from
Jan 23, 2020

Conversation

carterkozak
Copy link
Contributor

Lambdas with a single parameter do not require argument parentheses.

- (value) -> value != null
+ value -> value != null

After this PR

==COMMIT_MSG==
Lambdas with a single parameter do not require argument parentheses.
==COMMIT_MSG==

Possible downsides?

This is already validated by checkstyle, however checkstyle doesn't provide functionality to automatically fix occurrences.

Lambdas with a single parameter do not require argument parentheses.

```diff
- (value) -> value != null
+ value -> value != null
```
@changelog-app
Copy link

changelog-app bot commented Jan 23, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Lambdas with a single parameter do not require argument parentheses.

Check the box to generate changelog(s)

  • Generate changelog entry

@carterkozak
Copy link
Contributor Author

pending testing on a large internal project

@ferozco
Copy link
Contributor

ferozco commented Jan 23, 2020

We should also remove the existing checkstyle rule

@carterkozak
Copy link
Contributor Author

We should also remove the existing checkstyle rule

Good call, updated and increased the level to WARN.

link = "https://github.com/palantir/gradle-baseline#baseline-error-prone-checks",
linkType = BugPattern.LinkType.CUSTOM,
providesFix = BugPattern.ProvidesFix.REQUIRES_HUMAN_ATTENTION,
severity = BugPattern.SeverityLevel.WARNING,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should go with error since checkstyle previous enforced this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most projects fail on WARNING -- iirc we tried using ERROR for the BracesRequired check but ran into issues (possibly with generated code).

Since excavator will auto-fix anything in projects that don't fail on warnings, I don't think there's much risk.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok sure!

@ferozco
Copy link
Contributor

ferozco commented Jan 23, 2020

👍

@bulldozer-bot bulldozer-bot bot merged commit c3eea66 into develop Jan 23, 2020
@bulldozer-bot bulldozer-bot bot deleted the ckozak/UnnecessaryLambdaArgumentParentheses branch January 23, 2020 18:06
@svc-autorelease
Copy link
Collaborator

Released 3.1.0

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

Successfully merging this pull request may close these issues.

3 participants