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

[Wrong repository :( ] Add my waiting Prs to a branch to create a "post" package #11

Closed
wants to merge 8 commits into from

Conversation

twidi
Copy link
Contributor

@twidi twidi commented Dec 31, 2015

Update:

I'm sorry I wanted to do it on my master branch :(

(Forgot a minute that github automatically use the fork source as the source of the PR :( )

To know if a message should be added to Github we check if it was
already added.
Or if we have more than one messages for a line, they are not guaranteed
to be in the same order, so the check fail.

This commit simply sort the lines before adding them to the final
message to check.

(It also simplifies this part of the code using the fact that `set.add`
will not add a new occurence of the value if already present, so the
extra set and the `if..in` are not needed)
We need the path and the line to create the message, and the regex for
the pylint linter does not ensure it.

In a pylint report, it is possible to find a line containing only `::`
so the script crashes.

This commit fixes the problem by updating the `PYLINT_LINE_REGEX` to
force the presence of a path and a line.
Before this commit, nothing was printed on the output to know if
something happened or not, and there was no difference in the exit code
if lint problems were found or not.

The exit code statis is important when integrating this tool in a CI, to
mark the PR as failed.

This commit resolves this by:

- adding a return value to the `report` method as a list of boolean, one
for each comment to post on github:
- True if the comment was posted
- False if not
- analyzing this result in the `main` function and displaying a
different message if there is some result or not, and if yes, also
displaying the number of failure if any
- exiting the program with the exit code `1` if lint problems were found
(if they were posted on github or not), and `0` if none were found
Conflicts:
	linty_fresh/main.py
	linty_fresh/reporters/github_reporter.py
@twidi
Copy link
Contributor Author

twidi commented Dec 31, 2015

I'm sorry I wanted to do it on my master branch :(

@twidi twidi closed this Dec 31, 2015
@twidi twidi changed the title Add my waiting Prs to a branch to create a "post" package [Wrong repository :( ] Add my waiting Prs to a branch to create a "post" package Dec 31, 2015
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

1 participant