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

[WIP] add more YARD docs #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[WIP] add more YARD docs #36

wants to merge 1 commit into from

Conversation

jbodah
Copy link
Contributor

@jbodah jbodah commented Jun 17, 2015

@tcopeland this PR has a couple shout outs to you. Would you mind explaining what the notated blocks are doing?

This branch depends on #35 for doc links to be correct

Thanks!

the_check = self.class.instance_variable_get(name)
the_check.add_problem
# TODO - @tcopeland could you explain this block?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tcopeland would you mind explaining what's going on here?

Copy link
Owner

Choose a reason for hiding this comment

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

Hey sorry for the delay in replying @jbodah.

The problem this is trying to solve is illustrated in this sequence of method calls:

x = foo.select {|y| y > 2 }
z = x.first
x.each {|q| puts q }

Normally pippi would flag that code since select is called and then first is called on the result. But in this case, the result is also used as a collection later - that is, we call each on it. So the code can't be simplified down into a single call to detect.

Pippi's logic is more or less to add a Problem, and then remove it if needed. There might be a nicer way to do that... like, adding it as a provisional problem and not actually adding it to the report until we confirm it.

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.

None yet

2 participants