Unverified Commit 8cdca1d4 authored by Raniere Silva's avatar Raniere Silva Committed by GitHub
Browse files

Merge pull request #253 from maxim-belkin/error-out

lesson_check.py: Exit with a status of 1 if something was wrong
parents 7ca21f54 2e6d3c64
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ lesson-check :

## lesson-check-all : validate lesson Markdown, checking line lengths and trailing whitespace.
lesson-check-all :
	@bin/lesson_check.py -s . -p ${PARSER} -l -w
	@bin/lesson_check.py -s . -p ${PARSER} -l -w --permissive

## unittest         : run unit tests on checking tools.
unittest :
+7 −0
Original line number Diff line number Diff line
@@ -118,6 +118,8 @@ def main():
        checker.check()

    args.reporter.report()
    if args.reporter.messages and not args.permissive:
        exit(1)


def parse_args():
@@ -146,6 +148,11 @@ def parse_args():
                      action="store_true",
                      dest='trailing_whitespace',
                      help='Check for trailing whitespace')
    parser.add_option('--permissive',
                      default=False,
                      action="store_true",
                      dest='permissive',
                      help='Do not raise an error even if issues are detected')

    args, extras = parser.parse_args()
    require(args.parser is not None,