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

Simplify SmellWarning class #1489

Merged
merged 5 commits into from
Aug 26, 2019
Merged

Simplify SmellWarning class #1489

merged 5 commits into from
Aug 26, 2019

Conversation

mvz
Copy link
Collaborator

@mvz mvz commented Aug 25, 2019

  • Pass smell type instead of full class to SmellWarning#initialize
  • Simplify spec setup by skipping detector creation

@mvz mvz requested review from troessner and chastell August 25, 2019 10:23
@mvz mvz force-pushed the simplify-smell-warning branch from 4044401 to b02f2b7 Compare August 25, 2019 17:54
Copy link
Owner

@troessner troessner left a comment

Choose a reason for hiding this comment

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

Very nice! One tiny comment and then let's merge :)


# @note When using Reek's public API, you should not create SmellWarning
# objects yourself. This is why the initializer is not part of the
# public API.
#
# @quality :reek:LongParameterList { max_params: 6 }
def initialize(smell_detector, context: '', lines:, message:,
def initialize(smell_type, context: '', lines:, message:,
Copy link
Owner

Choose a reason for hiding this comment

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

Let's use this opportunity to add proper parameter documentation :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

@troessner troessner merged commit f895056 into master Aug 26, 2019
@troessner troessner deleted the simplify-smell-warning branch August 26, 2019 20:03
@mvz
Copy link
Collaborator Author

mvz commented Aug 27, 2019

Hm. Can we not squash merge? I really hate it.

@troessner
Copy link
Owner

You mean not squash anymore at all or are you referring to this specific case? If it's the latter, how about leaving a comment for the reviewer (or label it) that we shouldnt squash on merge?

@mvz
Copy link
Collaborator Author

mvz commented Aug 27, 2019

I mean in general not use GitHub's squash merge option.

@mvz
Copy link
Collaborator Author

mvz commented Aug 27, 2019

A short list of why I don't like it:

  • It loses fine-grained git blame information
  • It makes it harder to see that local branches have been merged
  • Its method of generating a commit message is very simplistic

@troessner
Copy link
Owner

Ok, no worries, I'm ok with not using it anymore :)

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

Successfully merging this pull request may close these issues.

2 participants