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

[#56] Relative position for PR comments #57

Merged
merged 4 commits into from
Jul 23, 2014

Conversation

jfacorro
Copy link
Contributor

No description provided.

-spec patch_position(binary()) -> integer().
patch_position(Line) ->
Regex = "^@@ .*? \\+(\\d+),.*$",
{match, [_, {Position, Len} | _ ]} = re:run(Line, Regex),
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be better to use re:run(Line, Regex, [{capture, all_but_first, list}])?

elbrujohalcon added a commit that referenced this pull request Jul 23, 2014
@elbrujohalcon elbrujohalcon merged commit 95d808a into master Jul 23, 2014
@jfacorro jfacorro deleted the jfacorro.56.relative.comment.position branch July 23, 2014 13:22
%% @doc Takes a patch type line and returns the line number after the +.
-spec patch_position(binary()) -> integer().
patch_position(Line) ->
Regex = "^@@ .*? \\+(\\d+),.*$",
Copy link

Choose a reason for hiding this comment

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

Missing space after "," on line 95

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

3 participants