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

panlint: Add option to exit cleanly even if problems are found #159

Merged
merged 1 commit into from
Jul 25, 2017

Conversation

jrha
Copy link
Member

@jrha jrha commented Jul 13, 2017

Some testing frameworks interpret tools exiting with a non-zero code as a
failure of the tool rather than the tests it performs, adding this option
allows panlint to be used with these tools. (e.g. arcanist).

@jrha jrha changed the title Add option to exit cleanly even if problems are found panlint: Add option to exit cleanly even if problems are found Jul 13, 2017
@@ -448,6 +448,7 @@ def main():
parser.add_argument('--vi', action='store_true', help='Output line numbers in a vi option style')
parser.add_argument('--table', action='store_true', help='Display a table of per-file problem stats')
parser.add_argument('--allow_mvn_templates', action='store_true', help='Allow use of maven templates')
parser.add_argument('--ignore_problems_on_exit', action='store_true', help='Exit cleanly even if problems are found')
Copy link
Member

Choose a reason for hiding this comment

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

i would rename it to always_exit_success, because this is what your code does

@@ -465,7 +466,7 @@ def main():

if not args.paths:
print 'No files were provided, not doing anything'
sys_exit(0)
return 0
Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO this is a (user) error. Since the user ran the tool they wanted an effect, unless they passed --help or -v or something.

Copy link
Member Author

Choose a reason for hiding this comment

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

See #144

@jrha jrha force-pushed the panlint branch 2 times, most recently from 69a982e to 9d70a3f Compare July 24, 2017 15:35
@jrha
Copy link
Member Author

jrha commented Jul 24, 2017

@stdweird thanks for the suggestion — done

@@ -485,6 +486,9 @@ def main():
print
print '%d problems found in total' % problems_found

if args.ignore_problems_on_exit:
Copy link
Member

Choose a reason for hiding this comment

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

you changed the option name, but not the attribute name?

Copy link
Member Author

Choose a reason for hiding this comment

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

Blargh, rebase.

Some testing frameworks interpret tools exiting with a non-zero code as a
failure of the tool rather than the tests it performs, adding this option
allows panlint to be used with these tools. (e.g. arcanist).
@stdweird stdweird merged commit 1a02b66 into quattor:master Jul 25, 2017
@jrha jrha deleted the panlint branch July 25, 2017 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants