Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Add a fixer for "unnecessary-constructor" rule. #4694

Merged
merged 2 commits into from
May 5, 2019

Conversation

bowenni
Copy link
Contributor

@bowenni bowenni commented May 2, 2019

PR checklist

  • Addresses an existing issue: fixes #0000
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

Overview of change:

Add a fixer for "unnecessary-constructor" rule.
Also don't flag constructors with decorated parameters since the parameter decorator can have side effects.

Is there anything you'd like reviewers to focus on?

This was added in the initial commit of "unnecessary-constructor" rule but removed later. What are the concerns?
I ran this fixer across Google's mono repo. The fixes produced are legit to me.

CHANGELOG.md entry:

Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

...but removed later. What are the concerns?

Ha, I forgot about this! Thanks for adding it back in 😊

Until copying links to PR responses is fixed, quoting the comment left on the fixer as originally implemented:

This will produce invalid code for classes with an empty constructor and multiple overload signatures by removing the implementation and leaving the overloads in place.

It looks like you added the logic & test cases for deleting overloads so this LGTM. Thanks!

@JoshuaKGoldberg JoshuaKGoldberg merged commit be293b0 into palantir:master May 5, 2019
@bowenni bowenni deleted the empty-constructor-fix branch May 5, 2019 17:44
@adidahiya adidahiya mentioned this pull request May 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants