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

Applying automatic code transformation for "guard clause critic" removes method comment #3055

Closed
juliendelplanque opened this issue Mar 29, 2019 · 3 comments

Comments

@juliendelplanque
Copy link
Contributor

When I apply the automatic code transformation for "guard clause critic", it removes method comment.

Here is how to reproduce the issue:

  1. Create DummyObject class
  2. Add #methodToRefactorWithGuardClause method with source code:
methodToRefactorWithGuardClause
	"This comment will be removed by refactoring engine."
	1 + 1 = 2
		ifTrue: [ 
			'Hello' inspect.
			'world' inspect ].

This method will show the quality assistant critic "Replace single branch conditional with guard clause".

Capture d’écran 2019-03-29 à 10 19 53

If you click the automatic repair button of the critic, it correctly transform the code but removes the class comment leading to the following method:

methodToRefactorWithGuardClause
	1 + 1 = 2
		ifFalse: [ ^ self ].
	'Hello' inspect.
	'world' inspect
@stale
Copy link

stale bot commented Sep 25, 2019

To limit bug bankruptcy (see https://www.joelonsoftware.com/2012/07/09/software-inventory/) this issue has been automatically marked as stale because it has not had any activity in 6 months. It will be closed in 1 month if no further activity occurs. If this issue remains important to you, please comment to reactivate the issue. Thank you for your contributions.

Joel on Software
Imagine, for a moment, that you came upon a bread factory for the first time. At first it just looks like a jumble of incomprehensible machinery with a few people buzzing around. As your eyes adjus…

@stale stale bot added the stale label Sep 25, 2019
@juliendelplanque
Copy link
Contributor Author

Bump.

@stale stale bot removed the stale label Sep 25, 2019
@Ducasse Ducasse moved this from To do to For Later in Refactoring Engine Dec 3, 2020
@MarcusDenker
Copy link
Member

This is caused by #5818

Refactoring Engine automation moved this from For Later (kind of Backlog) to Done Feb 2, 2021
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