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

whitespace and other formatting bugs in !bounty #5

Open
Smuzzy-waiii opened this issue Oct 1, 2023 · 1 comment
Open

whitespace and other formatting bugs in !bounty #5

Smuzzy-waiii opened this issue Oct 1, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Smuzzy-waiii
Copy link
Owner

Currently this the code for interpreting !bounty assignments

// parse the comment here to give a bounty
comment_text_parts := strings.Split(parsed_hook.Comment.Body, " ")
if comment_text_parts[0] == "!bounty" {
	// Convert the points
	points, err := strconv.Atoi(comment_text_parts[1])
...

This is obviously prone to problems if the maintainer were to accidentally place a whitespace before !bounty in their comments and other such formatting bugs. Fix all formatting bugs that might happen accounting for common maintainer comments formats (like newline after bounty points number etc)

To refresh this is bounty assign comment format:
!bounty <bounty_points>

Eg:
!bounty 30

This is a comment that needs to be made on a PR (and not a issue) which assigns <bounty_points> to the user who created the PR

@Smuzzy-waiii
Copy link
Owner Author

Might need to sanitise input so that the bounty points are within a sane range

@Smuzzy-waiii Smuzzy-waiii self-assigned this Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant