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

Print summary and return exit code 1 if problem found #10

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

Conversation

twidi
Copy link
Contributor

@twidi twidi commented Dec 31, 2015

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, a tuple with:
    • Reporter name
    • Number of line with problem(s)
    • Number not already present on github
    • Raised overflow, or None
    • Number that cannot be pushed on github
  • passing this result from the main function to a new manage_results
    function that will:
    • display a message depending of the result for each reporter
    • return 1 if at least 1 problem was found in the PR (even if already
      pushed on Github on a previous call), and 0 if not

@twidi twidi force-pushed the print-status-plus-exit-code branch 6 times, most recently from a4644b4 to 28e1c9e Compare January 4, 2016 03:42
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, a tuple with:
  - Reporter name
  - Number of line with problem(s)
  - Number not already present on github
  - Raised overflow, or None
  - Number that cannot be pushed on github
- passing this result from the `main` function to a new `manage_results`
function that will:
  - display a message depending of the result for each reporter
  - return 1 if at least 1 problem was found in the PR (even if already
pushed on Github on a previous call), and 0 if not
@twidi twidi force-pushed the print-status-plus-exit-code branch from 28e1c9e to 5f9b060 Compare January 4, 2016 04:30
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.

1 participant