Commit fb178306 authored by Greg Wilson's avatar Greg Wilson
Browse files

Lesson checking parameter handling

parent c2f89a7a
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -40,6 +40,9 @@ REQUIRED_FILES = {
# Episode filename pattern.
P_EPISODE_FILENAME = re.compile(r'/_episodes/(\d\d)-[-\w]+.md$')

# Pattern to match lines ending with whitespace.
P_TRAILING_WHITESPACE = re.compile(r'\s+$')

# What kinds of blockquotes are allowed?
KNOWN_BLOCKQUOTES = {
    'callout',
@@ -106,6 +109,7 @@ def parse_args():
    parser = OptionParser()
    parser.add_option('-l', '--linelen',
                      default=False,
                      action="store_true",
                      dest='line_lengths',
                      help='Check line lengths')
    parser.add_option('-p', '--parser',
@@ -118,6 +122,7 @@ def parse_args():
                      help='source directory')
    parser.add_option('-w', '--whitespace',
                      default=False,
                      action="store_true",
                      dest='trailing_whitespace',
                      help='Check for trailing whitespace')

@@ -263,11 +268,11 @@ class CheckBase(object):
        """Check for whitespace at the ends of lines."""

        if self.args.trailing_whitespace:
            trailing = [i for (i, l, n) in self.lines if l.endswidth(' ')]
            trailing = [i for (i, l, n) in self.lines if P_TRAILING_WHITESPACE.match(l)]
            self.reporter.check(not trailing,
                                self.filename,
                                'Line(s) end with whitespace: {0}',
                                ', '.join([str[i] for i in over]))
                                ', '.join([str(i) for i in trailing]))


    def check_blockquote_classes(self):